summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/ChangeLog6
-rw-r--r--testsuite/systemtap.maps/linear_nearlyempty.exp25
-rw-r--r--testsuite/systemtap.maps/linear_nearlyempty.stp18
3 files changed, 49 insertions, 0 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index 4c5d811b..a2317b5f 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-22 Frank Ch. Eigler <fche@elastic.org>
+
+ PR 5057.
+ * systemtap.maps/linear_nearlyempty.*: New test for
+ histogram printing elision.
+
2007-09-21 Martin Hunt <hunt@redhat.com>
* systemtap.maps/linear*: Updated linear histogram tests.
diff --git a/testsuite/systemtap.maps/linear_nearlyempty.exp b/testsuite/systemtap.maps/linear_nearlyempty.exp
new file mode 100644
index 00000000..dfb5e9ef
--- /dev/null
+++ b/testsuite/systemtap.maps/linear_nearlyempty.exp
@@ -0,0 +1,25 @@
+# Test nearly empty linear histogram
+
+set test "linear_nearlyempty"
+set ::result_string {count=2
+sum=1443
+min=444
+max=999
+avg=721
+value |-------------------------------------------------- count
+ 300 | 0
+ 350 | 0
+ 400 |@ 1
+ 450 | 0
+ 500 | 0
+ ~
+ 850 | 0
+ 900 | 0
+ 950 |@ 1
+ 1000 | 0
+ 1050 | 0
+}
+
+stap_run2 $srcdir/$subdir/$test.stp
+
+
diff --git a/testsuite/systemtap.maps/linear_nearlyempty.stp b/testsuite/systemtap.maps/linear_nearlyempty.stp
new file mode 100644
index 00000000..f0b70607
--- /dev/null
+++ b/testsuite/systemtap.maps/linear_nearlyempty.stp
@@ -0,0 +1,18 @@
+# test that we can check the count of an empty array
+
+global agg
+
+probe begin
+{
+ agg <<< 444
+ agg <<< 999
+ printf("count=%d\n", @count(agg))
+ if (@count(agg) > 0) {
+ printf("sum=%d\n", @sum(agg))
+ printf("min=%d\n", @min(agg))
+ printf("max=%d\n", @max(agg))
+ printf("avg=%d\n", @avg(agg))
+ print(@hist_linear(agg, 0, 1500, 50))
+ }
+ exit()
+}