summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.maps/foreach_limit.stp
diff options
context:
space:
mode:
authorhunt <hunt>2007-09-12 18:21:55 +0000
committerhunt <hunt>2007-09-12 18:21:55 +0000
commit674f70a0371c1f97a83c66268d03332ebbf9e62f (patch)
treed910409c003bc72463253cc7ef0c07bb522721fb /testsuite/systemtap.maps/foreach_limit.stp
parentcf9be511f05d0b310b2c4ce4c050d3707be9e65a (diff)
downloadsystemtap-steved-674f70a0371c1f97a83c66268d03332ebbf9e62f.tar.gz
systemtap-steved-674f70a0371c1f97a83c66268d03332ebbf9e62f.tar.xz
systemtap-steved-674f70a0371c1f97a83c66268d03332ebbf9e62f.zip
2007-09-12 Martin Hunt <hunt@redhat.com>
* systemtap.maps/foreach_limit.stp: Clean up the aggregates section. * systemtap.maps/foreach_limit2.stp: Remove newline that was confusing the output match. * systemtap.maps/linear_bad.exp: Fix expected output. * systemtap.maps/linear_neg.exp: Ditto. * systemtap.maps/log.*: New files. * systemtap.maps/log_edge.*: New files. * lib/stap_run2.exp (stap_run2): Rewrite. Previous version was too complex and buggy.
Diffstat (limited to 'testsuite/systemtap.maps/foreach_limit.stp')
-rw-r--r--testsuite/systemtap.maps/foreach_limit.stp21
1 files changed, 11 insertions, 10 deletions
diff --git a/testsuite/systemtap.maps/foreach_limit.stp b/testsuite/systemtap.maps/foreach_limit.stp
index 6ce0f361..d4646dbc 100644
--- a/testsuite/systemtap.maps/foreach_limit.stp
+++ b/testsuite/systemtap.maps/foreach_limit.stp
@@ -104,6 +104,8 @@ probe begin
printf("\nAggregates:\n");
# Add items to the aggregate
+ # 10 keys, 15 entries each = 150 entries.
+ # min = 4, max = 15 * 40 = 600
foreach (key in array)
{
agg <<< array[key]
@@ -118,24 +120,23 @@ probe begin
agg <<< array[key] * 10
agg <<< array[key] * 11
agg <<< array[key] * 12
- agg <<< array[key] * 12
agg <<< array[key] * 13
agg <<< array[key] * 14
agg <<< array[key] * 15
}
- # Find the total number of aggregate entries
- i = 0
- foreach (bucket in @hist_log(agg))
- i++;
- printf("%d total aggregate entries\n", i);
+ printf("count=%d sum=%d\n", @count(agg), @sum(agg))
+ printf("min=%d max=%d\n", @min(agg), @max(agg))
+ print(@hist_log(agg))
- # Print the 1st 5 aggregate entries
- printf("\naggregate limit 5:\n");
+ # This is useless, but test anyway. Maybe it will
+ # trigger some obscure edge condition.
+ # log buckets run from 0 to 127.
i = 0
- foreach (bucket in @hist_log(agg) limit 5)
+ foreach (bucket in @hist_log(agg) limit 71)
{
- printf("bucket %d: %d\n", bucket, @hist_log(agg)[bucket]);
+ if (@hist_log(agg)[bucket])
+ printf("bucket %d: %d\n", bucket, @hist_log(agg)[bucket]);
i++;
}
printf("loop had %d iterations\n", i);