This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] Add simple test for PR10257 (sprint(@hist_linear)).
- From: Przemyslaw Pawelczyk <przemyslaw at pawelczyk dot it>
- To: systemtap at sourceware dot org
- Date: Sat, 6 Feb 2010 22:45:13 +0100
- Subject: [PATCH] Add simple test for PR10257 (sprint(@hist_linear)).
- Mail-from: 8a7189e20aa1828669978af450f201c4a68a95c9 Mon Sep 17 00:00:00 2001
Test is simple, because print and sprint uses the same code for handling
@hist_* and it is not intended for playing with MAXSTRINGLEN, which is
required anyway for bigger histograms (the one generated here consists
of only 127 characters).
When PR10690 (need way to produce bigger procfs output) will be fixed,
then we should add another test for both PRs with normal histogram.
* testsuite/systemtap.maps/hist_in_string.exp: Test case.
* testsuite/systemtap.maps/hist_in_string.stp: Ditto.
---
testsuite/systemtap.maps/hist_in_string.exp | 8 ++++++++
testsuite/systemtap.maps/hist_in_string.stp | 10 ++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
create mode 100644 testsuite/systemtap.maps/hist_in_string.exp
create mode 100644 testsuite/systemtap.maps/hist_in_string.stp
diff --git a/testsuite/systemtap.maps/hist_in_string.exp b/testsuite/systemtap.maps/hist_in_string.exp
new file mode 100644
index 0000000..02f201a
--- /dev/null
+++ b/testsuite/systemtap.maps/hist_in_string.exp
@@ -0,0 +1,8 @@
+# test histogram printed to string
+
+set test "hist_in_string"
+set ::result_string {value |-------------------------------------------------- count
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 128
+}
+
+stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.maps/hist_in_string.stp b/testsuite/systemtap.maps/hist_in_string.stp
new file mode 100644
index 0000000..f9d0e81
--- /dev/null
+++ b/testsuite/systemtap.maps/hist_in_string.stp
@@ -0,0 +1,10 @@
+global l
+
+probe begin
+{
+ for (i = 0; i < 128; i++)
+ l <<< 0
+
+ print(sprint(@hist_linear(l, 0, 0, 1)))
+ exit()
+}
--
1.6.3.3