Debian Codegraph @

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

raw
1 # stap stmt_counting_functions.stp ##
2 # where ## > 5
3
4 global num
5 probe begin {
6 printf("systemtap starting probe\n");
7 if ($1 != func1($1))
8 num = 0;
9 else {
10 func1($1);
11 if (num < 0)
12 num = 0;
13 else
14 num = num + $1;
15 }
16
17 printf("systemtap ending probe\n");
18 if (num = (num + $1))
19 printf("pass\n");
20 else
21 printf("fail\n");
22 exit();
23 }
24
25 function func1 (a){
26 if (a == 1) { a = -300; }
27 else { num++; }
28 if (a == 2) { a = -300; }
29 else { num++; }
30 if (a == 3) { a = -300; }
31 else { num++; }
32 if (a == 4) { a = -300; }
33 else { num++; }
34 if (a == 5) { a = -300; }
35 else { num++; }
36 return a;
37 }
38