Debian Codegraph @

testsuite/systemtap.printf/print_user_buffer.stp

raw
1 global errors = 0
2
3 probe begin { println("systemtap starting probe") }
4 probe end
5 {
6 println("systemtap ending probe")
7 if (!errors)
8 println("systemtap test success")
9 }
10
11 probe syscall.write
12 {
13 if (!target_set_pid(pid())) next;
14
15 value = sprintf("%#.*M", count, buf_uaddr)
16 if (value != "666f6f6261720a"&& value!= "000a")
17 errors++
18
19 value = sprintf("%#.*m", count, buf_uaddr)
20 if (value != "foobar\n" && value !="\0\n")
21 errors++
22
23 try {
24 errors++
25 value = sprintf("%#.*M", count, fd)
26 }
27 catch {
28 errors--
29 }
30 try {
31 errors++
32 value = sprintf("%#.*m", count, fd)
33 }
34 catch {
35 errors--
36 }
37
38 }