Debian Codegraph @

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

raw
1 /*
2 * be_order.stp
3 *
4 * Check that ordering of begin/end probes works
5 */
6
7 probe begin { println("systemtap starting probe") }
8 probe end { println("systemtap ending probe") }
9
10 global beginstr, endstr
11
12 probe begin { beginstr .= "c" }
13 probe begin(1) { beginstr .= "d" }
14 probe begin(-1) { beginstr .= "b" }
15 probe begin(0) { beginstr .= "c" }
16 probe begin(9223372036854775807) { beginstr .= "e" }
17 probe begin(-9223372036854775808) { beginstr .= "a" }
18
19 probe end { endstr .= "x" }
20 probe end(1) { endstr .= "y" }
21 probe end(-1) { endstr .= "w" }
22 probe end(0) { endstr .= "x" }
23 probe end(9223372036854775807) {
24 endstr .= "z"
25 rc = 0
26
27 if (beginstr == "abccde")
28 rc += 1
29 else
30 printf("systemtap test failure - beginstr:%s != abccde\n", beginstr)
31
32 if (endstr == "vwxxyz")
33 rc += 1
34 else
35 printf("systemtap test failure - endstr:%s != vwxxyz\n", endstr)
36
37 if (rc == 2)
38 println("systemtap test success")
39 else
40 printf("systemtap test failure (%d passes)\n", rc)
41 }
42 probe end(-9223372036854775808) { endstr .= "v" }
43