-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsys_open.stap
More file actions
executable file
·39 lines (34 loc) · 1.11 KB
/
Copy pathsys_open.stap
File metadata and controls
executable file
·39 lines (34 loc) · 1.11 KB
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
#! /usr/bin/stap
# Copyright 2015 vonnyfly(lifeng1519@gmail.com)
# suppress some run-time errors here for cleaner output
//bin/true && exec stap --all-modules --suppress-handler-errors --skip-badvars $0 ${1+"$@"}
/* configuration options; set these with stap -G */
global g_extra = 1
global black_lists
global g_incalls
function trace(entry_p, extra) {
if (g_extra == 0) extra = ""
if (tid() in g_incalls)
printf("%s%s%s %s\n",
thread_indent (entry_p),
(entry_p>0?"->":"<-"),
ppfunc (),
extra)
}
probe syscall.read.call {
black_lists["stapio"] = 1
black_lists["swapper/0"] = 1
g_incalls[tid()] = 1
trace(1, $$parms)
}
probe syscall.read.return {
trace(-1, $$return)
delete g_incalls[tid()]
printf("\nkernel backtrace:\n")
print_backtrace()
printf("---------------------------------------------------------\n")
}
##############################################################################
# Generated by gen_stap.sh using cmd:
# ./gen_stap.sh -e sys_open
# Author: Feng Li (lifeng1519@gmail.com)