Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.bpf/bpf_tests/string1.stp

raw
1 // stapbpf string manipulation -- store string in global data structure
2
3 global var
4 global tab1
5 global tab2
6
7 @define test_print
8 %(
9 printf("[%s", "str0")
10 printf("%s", var)
11 printf("%s", tab1[15])
12 printf("%s]", tab2["key"])
13 %)
14
15 probe begin {
16 printf("BEGIN")
17
18 var = "str1"
19 tab1[15] = "str2"
20 tab2["key"] = "str3"
21
22 printf("begin")
23 @test_print
24 }
25
26 probe kernel.function("vfs_read") {
27 printf("probe")
28 @test_print
29 exit()
30 }
31
32 probe end {
33 printf("end")
34 @test_print
35 printf("END\n")
36 }