Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/bench.stp

raw
1
2 // This bucket aims to trigger all basic generated C code constructs.
3 // It should be run with "-tu".
4
5 probe repeat = begin,begin,begin,begin,begin,begin,begin,begin,
6 begin,begin,begin,begin,begin,begin,begin,begin,
7 begin,begin,begin,begin,begin,begin,begin,begin,
8 begin,begin,begin,begin,begin,begin,begin,begin,
9 begin,begin,begin,begin,begin,begin,begin,begin
10 {}
11
12 probe test.null = repeat {} probe test.null {} // null probe
13 probe test.intassmt = repeat {i = 0} probe test.intassmt {}
14 probe test.gintassmt = repeat {gn = 0} probe test.gintassmt {} global gn
15 probe test.intincr = repeat {i++} probe test.intincr {}
16 probe test.gintincr = repeat {gn++} probe test.gintincr {}
17
18 probe test.strassmt = repeat {s=""} probe test.strassmt {}
19 probe test.gstrassmt = repeat {gs=""} probe test.gstrassmt {} global gs
20
21 probe test.forloop = repeat {for(i=0;i<10;i++) ;} probe test.forloop {}
22 probe test.ifgint = repeat {if (gn>0) ;} probe test.ifgint {}
23 probe test.next = repeat {next} probe test.next {}
24
25 probe test.stataccum = repeat {gS <<< 1} probe test.stataccum {} global gS
26 probe test.statcount = repeat {@count(gS)} probe test.statcount {}
27
28 probe test.nnarrassmt = repeat {gnn[1] = 1} probe test.nnarrassmt {} global gnn
29 probe test.ssarrassmt = repeat {gss["foo"] = "bar"} probe test.ssarrassmt {} global gss
30
31 probe begin(9999 /* ... after all the others! */) { exit () }