testsuite/buildok/stat_extract.stp
raw| 1 | #! stap -p4 |
| 2 | |
| 3 | # test the translatability of the statistic extraction operators |
| 4 | |
| 5 | global foo |
| 6 | global bar |
| 7 | |
| 8 | global i |
| 9 | |
| 10 | probe timer.ms(100) |
| 11 | { |
| 12 | foo <<< i++ |
| 13 | bar[10,"hello"] <<< (12 * i) |
| 14 | if (@count(foo) > 1000) |
| 15 | exit() |
| 16 | } |
| 17 | |
| 18 | probe begin |
| 19 | { |
| 20 | i = 1 |
| 21 | } |
| 22 | |
| 23 | probe end |
| 24 | { |
| 25 | printf("foo: min %d, max %d, count %d, sum %d, avg %d\n", |
| 26 | @min(foo), @max(foo), @count(foo), @sum(foo), @avg(foo)) |
| 27 | } |