-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrace_vfs_write.stp
executable file
·61 lines (45 loc) · 1.08 KB
/
trace_vfs_write.stp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env stap
probe begin {
printf("vfs_write trace starts\n")
}
global trace
probe kernel.function("vfs_write").call {
trace[execname(), tid()] = 1
}
probe kernel.function("vfs_write").return {
delete trace[execname(), tid()]
}
function trace(t_name, entry_p, extra) {
if ([t_name, tid()] in trace) {
indent = thread_indent(entry_p)
if (entry_p > 0)
printf("%s%s%s %s\n", indent, "-> ", ppfunc(), extra)
}
}
probe kernel.function("*@block/*.c").call {
trace("dd", 3, $$parms)
}
probe kernel.function("*@block/*.c").return {
trace("dd", -3, $$return)
}
probe kernel.function("*@fs/read_write.c").call {
trace("dd", 3, $$parms)
}
probe kernel.function("*@fs/read_write.c").return {
trace("dd", -3, $$return)
}
probe kernel.function("*@fs/block_dev.c").call {
trace("dd", 3, $$parms)
}
probe kernel.function("*@fs/block_dev.c").return {
trace("dd", -3, $$return)
}
probe kernel.function("*@mm/filemap.c").call {
trace("dd", 3, $$parms)
}
probe kernel.function("*@mm/filemap.c").return {
trace("dd", -3, $$return)
}
probe end {
printf("vfs_write trace ends\n")
}