| 1 |
#! stap -p4 |
| 2 |
|
| 3 |
global foo |
| 4 |
global i |
| 5 |
|
| 6 |
probe begin |
| 7 |
{ |
| 8 |
print("starting up\n") |
| 9 |
i = 0 |
| 10 |
} |
| 11 |
|
| 12 |
probe timer.jiffies(100) |
| 13 |
{ |
| 14 |
printf("ping %d\n", i) |
| 15 |
foo <<< i |
| 16 |
if (i++ > 15) |
| 17 |
exit() |
| 18 |
} |
| 19 |
|
| 20 |
probe end |
| 21 |
{ |
| 22 |
print("shutting down\n") |
| 23 |
printf("count %d, avg %d\n", @count(foo), @avg(foo)) |
| 24 |
for (i = 0; i < 7; ++i) |
| 25 |
printf("bucket %d: %d\n", i, @hist_log(foo)[i]) |
| 26 |
println("the first bucket is ", @hist_log(foo)[0]) |
| 27 |
println(@hist_log(foo)[0], " is the first bucket") |
| 28 |
println(1 + @hist_log(foo)[0], " is one plus the first bucket") |
| 29 |
// XXX the parser fails on this bucket expression: |
| 30 |
// println(@hist_log(foo)[0] + 1, " is the first bucket plus one") |
| 31 |
} |
| 32 |
|