Debian Codegraph @

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

raw
1 /*
2 * div.stp0
3 *
4 * Check the systemtap divide by 0 does not kill the machine
5 *
6 * Note: Error messages are written to stderr. That means it is
7 * possible that if a printf is followed by something that
8 * generates an error, the error will get displayed before the printf.
9 * That is why both print's are in the begin probe.
10 *
11 */
12
13 global x3
14 global x1
15 global x2
16
17 probe begin
18 {
19 print("systemtap starting probe\n")
20 print("systemtap ending probe\n")
21 x1 = 56088; x2 = 0;
22 }
23
24 probe end
25 {
26 x3 = x1 / x2
27 /* this part does not get executed */
28 if (x3 != 456 )
29 print("systemtap test failure\n")
30 else
31 print("systemtap test failure\n")
32 }