Debian Codegraph @

tapset/linux/sysc_rt_tgsigqueueinfo.stp

raw
1 # rt_tgsigqueueinfo ____________________________________________
2 #
3 # SYSCALL_DEFINE4(rt_tgsigqueueinfo, pid_t, tgid, pid_t, pid, int, sig,
4 # siginfo_t __user *, uinfo)
5 # COMPAT_SYSCALL_DEFINE4(rt_tgsigqueueinfo,
6 # compat_pid_t, tgid,
7 # compat_pid_t, pid,
8 # int, sig,
9 # struct compat_siginfo __user *, uinfo)
10 #
11
12 @define _SYSCALL_RT_TGSIGQUEUEINFO_NAME
13 %(
14 name = "rt_tgsigqueueinfo"
15 %)
16
17 @define _SYSCALL_RT_TGSIGQUEUEINFO_ARGSTR
18 %(
19 argstr = sprintf("%d, %d, %s, %s", tgid, tid, sig_str, uinfo_str)
20 %)
21
22 @define _SYSCALL_RT_TGSIGQUEUEINFO_REGARGS
23 %(
24 tgid = int_arg(1)
25 tid = int_arg(2)
26 sig = int_arg(3)
27 sig_str = _signal_name(sig)
28 uinfo_uaddr = pointer_arg(4)
29 uinfo_str = (@__compat_task ? _stp_compat_siginfo_u(uinfo_uaddr)
30 : _stp_siginfo_u(uinfo_uaddr))
31 %)
32
33 @define _SYSCALL_RT_TGSIGQUEUEINFO_REGARGS_STORE
34 %(
35 if (@probewrite(tgid))
36 set_int_arg(1, tgid)
37
38 if (@probewrite(tid))
39 set_int_arg(2, tid)
40
41 if (@probewrite(sig))
42 set_int_arg(3, sig)
43
44 if (@probewrite(uinfo_uaddr))
45 set_pointer_arg(4, uinfo_uaddr)
46 %)
47
48 probe syscall.rt_tgsigqueueinfo = dw_syscall.rt_tgsigqueueinfo !,
49 nd_syscall.rt_tgsigqueueinfo ? {}
50 probe syscall.rt_tgsigqueueinfo.return = dw_syscall.rt_tgsigqueueinfo.return !,
51 nd_syscall.rt_tgsigqueueinfo.return ? {}
52
53 # dw_rt_tgsigqueueinfo _____________________________________________________
54
55 probe dw_syscall.rt_tgsigqueueinfo =
56 kernel.function("sys_rt_tgsigqueueinfo").call ?,
57 kernel.function("compat_sys_rt_tgsigqueueinfo").call ?
58 {
59 @_SYSCALL_RT_TGSIGQUEUEINFO_NAME
60 tgid = __int32($tgid)
61 tid = __int32($pid)
62 sig = __int32($sig)
63 sig_str = _signal_name(sig)
64 uinfo_uaddr = $uinfo
65 uinfo_str = (@__compat_task ? _stp_compat_siginfo_u(uinfo_uaddr)
66 : _stp_siginfo_u(uinfo_uaddr))
67 @_SYSCALL_RT_TGSIGQUEUEINFO_ARGSTR
68 }
69 probe dw_syscall.rt_tgsigqueueinfo.return =
70 kernel.function("sys_rt_tgsigqueueinfo").return ?,
71 kernel.function("compat_sys_rt_tgsigqueueinfo").return ?
72 {
73 @_SYSCALL_RT_TGSIGQUEUEINFO_NAME
74 @SYSC_RETVALSTR($return)
75 }
76
77 # nd_rt_tgsigqueueinfo _____________________________________________________
78
79 probe nd_syscall.rt_tgsigqueueinfo = nd1_syscall.rt_tgsigqueueinfo!, nd2_syscall.rt_tgsigqueueinfo!, tp_syscall.rt_tgsigqueueinfo
80 { }
81
82 probe nd1_syscall.rt_tgsigqueueinfo =
83 kprobe.function("sys_rt_tgsigqueueinfo") ?,
84 kprobe.function("compat_sys_rt_tgsigqueueinfo") ?
85 {
86 @_SYSCALL_RT_TGSIGQUEUEINFO_NAME
87 asmlinkage()
88 @_SYSCALL_RT_TGSIGQUEUEINFO_REGARGS
89 @_SYSCALL_RT_TGSIGQUEUEINFO_ARGSTR
90 }
91
92 /* kernel 4.17+ */
93 probe nd2_syscall.rt_tgsigqueueinfo =
94 kprobe.function(@arch_syscall_prefix "sys_rt_tgsigqueueinfo") ?,
95 kprobe.function(@arch_syscall_prefix "compat_sys_rt_tgsigqueueinfo") ?
96 {
97 __set_syscall_pt_regs(pointer_arg(1))
98 @_SYSCALL_RT_TGSIGQUEUEINFO_NAME
99 @_SYSCALL_RT_TGSIGQUEUEINFO_REGARGS
100 @_SYSCALL_RT_TGSIGQUEUEINFO_ARGSTR
101 },
102 {
103 %( @_IS_SREG_KERNEL %? @_SYSCALL_RT_TGSIGQUEUEINFO_REGARGS_STORE %)
104 }
105
106 /* kernel 3.5+, but undesirable because it affects all syscalls */
107 probe tp_syscall.rt_tgsigqueueinfo = kernel.trace("sys_enter")
108 {
109 __set_syscall_pt_regs($regs)
110 @__syscall_compat_gate(@const("__NR_rt_tgsigqueueinfo"), @const("__NR_compat_rt_tgsigqueueinfo"))
111 @_SYSCALL_RT_TGSIGQUEUEINFO_NAME
112 @_SYSCALL_RT_TGSIGQUEUEINFO_REGARGS
113 @_SYSCALL_RT_TGSIGQUEUEINFO_ARGSTR
114 },
115 {
116 %( @_IS_SREG_KERNEL %? @_SYSCALL_RT_TGSIGQUEUEINFO_REGARGS_STORE %)
117 }
118
119 probe nd_syscall.rt_tgsigqueueinfo.return = nd1_syscall.rt_tgsigqueueinfo.return!, nd2_syscall.rt_tgsigqueueinfo.return!, tp_syscall.rt_tgsigqueueinfo.return
120 { }
121
122 probe nd1_syscall.rt_tgsigqueueinfo.return =
123 kprobe.function("sys_rt_tgsigqueueinfo").return ?,
124 kprobe.function("compat_sys_rt_tgsigqueueinfo").return ?
125 {
126 @_SYSCALL_RT_TGSIGQUEUEINFO_NAME
127 @SYSC_RETVALSTR(returnval())
128 }
129
130 /* kernel 4.17+ */
131 probe nd2_syscall.rt_tgsigqueueinfo.return =
132 kprobe.function(@arch_syscall_prefix "sys_rt_tgsigqueueinfo").return ?,
133 kprobe.function(@arch_syscall_prefix "compat_sys_rt_tgsigqueueinfo").return ?
134 {
135 @_SYSCALL_RT_TGSIGQUEUEINFO_NAME
136 @SYSC_RETVALSTR(returnval())
137 }
138
139 /* kernel 3.5+, but undesirable because it affects all syscalls */
140 probe tp_syscall.rt_tgsigqueueinfo.return = kernel.trace("sys_exit")
141 {
142 __set_syscall_pt_regs($regs)
143 @__syscall_compat_gate(@const("__NR_rt_tgsigqueueinfo"), @const("__NR_compat_rt_tgsigqueueinfo"))
144 @_SYSCALL_RT_TGSIGQUEUEINFO_NAME
145 @SYSC_RETVALSTR($ret)
146 }