Debian Codegraph @

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

raw
1 global errors
2
3 %( arch == "i386" %?
4 global regname = "eax"
5 %)
6 %( arch == "x86_64" %?
7 global regname = "rax"
8 %)
9 %( arch == "powerpc" || arch == "s390x" %?
10 global regname = "r0"
11 %)
12 %( arch == "arm64" %?
13 global regname = "x0"
14 %)
15
16 probe begin
17 {
18 println("systemtap starting probe")
19 }
20
21 probe process.function("main")
22 {
23 if (@uregister(0) != register(regname)) {
24 errors++
25 println("user register mismatch")
26 }
27 }
28
29 probe syscall.getpid
30 {
31 if (@kregister(0) != register(regname)) {
32 errors++
33 println("kernel register mismatch")
34 }
35 }
36
37 probe end
38 {
39 println("systemtap ending probe")
40 if (errors == 0)
41 println("systemtap test success")
42 }