diff options
Diffstat (limited to 'testsuite/buildok/iterate_histogram_buckets.stp')
-rwxr-xr-x | testsuite/buildok/iterate_histogram_buckets.stp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/buildok/iterate_histogram_buckets.stp b/testsuite/buildok/iterate_histogram_buckets.stp new file mode 100755 index 00000000..e7b4e48e --- /dev/null +++ b/testsuite/buildok/iterate_histogram_buckets.stp @@ -0,0 +1,30 @@ +#! stap -p4 + +global foo +global i + +probe begin +{ + print("starting up\n") + i = 0 +} + +probe timer.jiffies(100) +{ + printf("ping %d\n", i) + foo <<< i + if (i++ > 15) + exit() +} + +probe end +{ + print("shutting down\n") + printf("count %d, avg %d\n", @count(foo), @avg(foo)) + foreach (bucket in @hist_log(foo)) + { + if (@hist_log(foo)[bucket] > 0) + printf("bucket %d: %d\n", bucket, @hist_log(foo)[bucket]) + } +} + |