Debian Codegraph @

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

raw
1 // None of these global vars should be
2 // autoprinted because they are all used
3
4 @define __emitpriv
5 %(
6 %( $1 == 1 %?
7 private
8 %)
9 %)
10
11 @__emitpriv global a // if condition
12 @__emitpriv global b // function arg
13
14 @__emitpriv global arr // used in foreach
15 @__emitpriv global c // foreach array slice
16 @__emitpriv global d // foreach limit
17
18 @__emitpriv global e // return value
19 @__emitpriv global f // ternary cond
20 @__emitpriv global g // while condition
21 @__emitpriv global h // arrayindex index
22
23 function foo(b) {
24 if (b)
25 printf("e")
26 }
27
28 function bar() {
29 return ++e;
30 }
31
32 probe oneshot {
33
34 if (++a)
35 printf("h")
36
37 foo(++b)
38
39 arr[1,1] = 1
40 foreach ([i,j] in arr[*,++c] limit ++d) {
41 printf("l")
42 }
43
44 if (bar()) {
45 printf("l")
46 }
47
48 ++f ? printf("o") : printf("");
49
50 while (!g++)
51 printf("!")
52
53 arr[++h, 1]++
54 }