Debian Codegraph @

tapset/linux/sysc_timer_gettime.stp

raw
1 # timer_gettime ______________________________________________
2 #
3 # long sys_timer_gettime(timer_t timer_id,
4 # struct itimerspec __user *setting)
5 # long compat_sys_timer_gettime(timer_t timer_id,
6 # struct itimerspec __user *setting)
7 #
8
9 @define _SYSCALL_TIMER_GETTIME_NAME
10 %(
11 name = "timer_gettime"
12 %)
13
14 @define _SYSCALL_TIMER_GETTIME_ARGSTR
15 %(
16 argstr = sprintf("%d, %p", timerid, value_uaddr)
17 %)
18
19 @define _SYSCALL_TIMER_GETTIME_REGARGS
20 %(
21 timerid = int_arg(1)
22 value_uaddr = pointer_arg(2)
23 %)
24
25 @define _SYSCALL_TIMER_GETTIME_REGARGS_STORE
26 %(
27 if (@probewrite(timerid))
28 set_int_arg(1, timerid)
29
30 if (@probewrite(value_uaddr))
31 set_pointer_arg(2, value_uaddr)
32 %)
33
34 probe syscall.timer_gettime = dw_syscall.timer_gettime !,
35 nd_syscall.timer_gettime ? {}
36 probe syscall.timer_gettime.return = dw_syscall.timer_gettime.return !,
37 nd_syscall.timer_gettime.return ? {}
38
39 # dw_timer_gettime _____________________________________________________
40
41 probe dw_syscall.timer_gettime = __syscall.timer_gettime,
42 kernel.function("compat_sys_timer_gettime").call ?
43 {
44 @_SYSCALL_TIMER_GETTIME_NAME
45 timerid = __int32($timer_id)
46 value_uaddr = $setting
47 @_SYSCALL_TIMER_GETTIME_ARGSTR
48 }
49 probe __syscall.timer_gettime = kernel.function("sys_timer_gettime").call
50 {
51 @__syscall_gate(@const("__NR_timer_gettime"))
52 }
53 probe dw_syscall.timer_gettime.return =
54 __syscall.timer_gettime.return,
55 kernel.function("compat_sys_timer_gettime").return ?
56 {
57 @_SYSCALL_TIMER_GETTIME_NAME
58 @SYSC_RETVALSTR($return)
59 }
60 probe __syscall.timer_gettime.return = kernel.function("sys_timer_gettime").return
61 {
62 @__syscall_gate(@const("__NR_timer_gettime"))
63 }
64
65 # nd_timer_gettime _____________________________________________________
66
67 probe nd_syscall.timer_gettime = nd1_syscall.timer_gettime!, nd2_syscall.timer_gettime!, tp_syscall.timer_gettime
68 { }
69
70 probe nd1_syscall.timer_gettime = __nd1_syscall.timer_gettime,
71 __nd1_syscall.compat_timer_gettime ?
72 {
73 @_SYSCALL_TIMER_GETTIME_NAME
74 }
75
76 probe __nd1_syscall.timer_gettime = kprobe.function("sys_timer_gettime")
77 {
78 @__syscall_gate(@const("__NR_timer_gettime"))
79 asmlinkage()
80 @_SYSCALL_TIMER_GETTIME_REGARGS
81 @_SYSCALL_TIMER_GETTIME_ARGSTR
82 }
83 probe __nd1_syscall.compat_timer_gettime = kprobe.function("compat_sys_timer_gettime") ?
84 {
85 asmlinkage()
86 @_SYSCALL_TIMER_GETTIME_REGARGS
87 @_SYSCALL_TIMER_GETTIME_ARGSTR
88 }
89
90 /* kernel 4.17+ */
91 probe nd2_syscall.timer_gettime = __nd2_syscall.timer_gettime,
92 __nd2_syscall.compat_timer_gettime ?
93 {
94 @_SYSCALL_TIMER_GETTIME_NAME
95 }
96 probe __nd2_syscall.timer_gettime =
97 kprobe.function(@arch_syscall_prefix "sys_timer_gettime")
98 {
99 __set_syscall_pt_regs(pointer_arg(1))
100 @_SYSCALL_TIMER_GETTIME_REGARGS
101 @_SYSCALL_TIMER_GETTIME_ARGSTR
102 },
103 {
104 %( @_IS_SREG_KERNEL %? @_SYSCALL_TIMER_GETTIME_REGARGS_STORE %)
105 }
106 probe __nd2_syscall.compat_timer_gettime =
107 kprobe.function(@arch_syscall_prefix "compat_sys_timer_gettime") ?
108 {
109 __set_syscall_pt_regs(pointer_arg(1))
110 @_SYSCALL_TIMER_GETTIME_REGARGS
111 @_SYSCALL_TIMER_GETTIME_ARGSTR
112 },
113 {
114 %( @_IS_SREG_KERNEL %? @_SYSCALL_TIMER_GETTIME_REGARGS_STORE %)
115 }
116
117 /* kernel 3.5+, but undesirable because it affects all syscalls */
118 probe tp_syscall.timer_gettime = kernel.trace("sys_enter")
119 {
120 __set_syscall_pt_regs($regs)
121 @__syscall_compat_gate(@const("__NR_timer_gettime"), @const("__NR_compat_timer_gettime"))
122 @_SYSCALL_TIMER_GETTIME_NAME
123 @_SYSCALL_TIMER_GETTIME_REGARGS
124 @_SYSCALL_TIMER_GETTIME_ARGSTR
125 },
126 {
127 %( @_IS_SREG_KERNEL %? @_SYSCALL_TIMER_GETTIME_REGARGS_STORE %)
128 }
129
130 probe nd_syscall.timer_gettime.return = nd1_syscall.timer_gettime.return!, nd2_syscall.timer_gettime.return!, tp_syscall.timer_gettime.return
131 { }
132
133 probe nd1_syscall.timer_gettime.return =
134 __nd1_syscall.timer_gettime.return,
135 kprobe.function("compat_sys_timer_gettime").return ?
136 {
137 @_SYSCALL_TIMER_GETTIME_NAME
138 @SYSC_RETVALSTR(returnval())
139 }
140 probe __nd1_syscall.timer_gettime.return = kprobe.function("sys_timer_gettime").return
141 {
142 @__syscall_gate(@const("__NR_timer_gettime"))
143 }
144
145 /* kernel 4.17+ */
146 probe nd2_syscall.timer_gettime.return =
147 kprobe.function(@arch_syscall_prefix "sys_timer_gettime").return,
148 kprobe.function(@arch_syscall_prefix "compat_sys_timer_gettime").return ?
149 {
150 @_SYSCALL_TIMER_GETTIME_NAME
151 @SYSC_RETVALSTR(returnval())
152 }
153
154 /* kernel 3.5+, but undesirable because it affects all syscalls */
155 probe tp_syscall.timer_gettime.return = kernel.trace("sys_exit")
156 {
157 __set_syscall_pt_regs($regs)
158 @__syscall_compat_gate(@const("__NR_timer_gettime"), @const("__NR_compat_timer_gettime"))
159 @_SYSCALL_TIMER_GETTIME_NAME
160 @SYSC_RETVALSTR($ret)
161 }