Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.maps/agg_delete1.stp

raw
1 global index = 0
2 global stats
3 global timer_index
4
5 probe timer.profile {
6 stats[0, 0] <<< index++
7 stats[0, 1] <<< 1
8 }
9
10 probe timer.s(5) {
11 if (++timer_index > 3) exit()
12
13 for (b = 0; b < 2; b++) {
14 printf("[%d, %d]: %d\n", 0, b,
15 (b == 0 ? @max(stats[0, b]) : @count(stats[0, b])))
16 delete stats[0, b]
17 if ([0, b] in stats) {
18 printf("eek! [%d, %d] in stats after deletion??\n",
19 0, b);
20 }
21 if (@count(stats[0, b]) != 0) {
22 printf("eek! [%d, %d] @count() != 0 after deletion??\n",
23 0, b);
24 }
25 }
26 }