Debian Codegraph @

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

raw
1 # stap stmt_counting_straight.stp 6
2
3 global num
4 global a
5 probe begin {
6 a = $1
7 printf("systemtap starting probe\n");
8 if (a == 1) { a = -300; }
9 else { num++; }
10 if (a == 2) { a = -300; }
11 else { num++; }
12 if (a == 3) { a = -300; }
13 else { num++; }
14 if (a == 4) { a = -300; }
15 else { num++; }
16 if (a == 5) { a = -300; }
17 else { num++; }
18
19 printf("systemtap ending probe\n");
20 if (num == 5)
21 printf("pass\n");
22 else
23 printf("fail\n");
24 exit();
25 }
26