summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrzemysław Pawełczyk <przemyslaw@pawelczyk.it>2010-02-11 15:10:39 -0500
committerFrank Ch. Eigler <fche@elastic.org>2010-02-11 15:10:39 -0500
commit84b49730802c1cc625b85a2bfd473f6839d4e99c (patch)
treea7e9a80225566d5c985ed739b0843d6aa61e5d69
parent42048078ab7712361ce54fa9face358f75e1d699 (diff)
downloadsystemtap-steved-84b49730802c1cc625b85a2bfd473f6839d4e99c.tar.gz
systemtap-steved-84b49730802c1cc625b85a2bfd473f6839d4e99c.tar.xz
systemtap-steved-84b49730802c1cc625b85a2bfd473f6839d4e99c.zip
Add simple test for PR10257 (sprint(@hist_linear)).
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.
-rw-r--r--testsuite/systemtap.maps/hist_in_string.exp8
-rw-r--r--testsuite/systemtap.maps/hist_in_string.stp10
2 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/systemtap.maps/hist_in_string.exp b/testsuite/systemtap.maps/hist_in_string.exp
new file mode 100644
index 00000000..02f201af
--- /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 00000000..f9d0e81a
--- /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()
+}