From 71572ba8dfa3b045dfdcd0c8e0a2db168659ea10 Mon Sep 17 00:00:00 2001 From: graydon Date: Thu, 8 Dec 2005 02:33:55 +0000 Subject: 2005-12-07 Graydon Hoare * staptree.cxx (traversing_visitor::visit_foreach_loop): Visit the base indexable of the foreach loop. * translate.cxx (c_tmpcounter::visit_foreach_loop): Implement histogram bucket iteration arm. (c_unparser::visit_foreach_loop): Likewise. (c_tmpcounter::visit_arrayindex): Fix typo. * testsuite/buildok/iterate_histogram_buckets.stp: New test. --- testsuite/buildok/iterate_histogram_buckets.stp | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 testsuite/buildok/iterate_histogram_buckets.stp (limited to 'testsuite') 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]) + } +} + -- cgit