Debian Codegraph @

tapset/linux/sysc_io_destroy.stp

raw
1 # io_destroy _________________________________________________
2 # long sys_io_destroy(aio_context_t ctx)
3
4 @define _SYSCALL_IO_DESTROY_NAME
5 %(
6 name = "io_destroy"
7 %)
8
9 @define _SYSCALL_IO_DESTROY_ARGSTR
10 %(
11 argstr = sprintf("%u", ctx)
12 %)
13
14 @define _SYSCALL_IO_DESTROY_REGARGS
15 %(
16 ctx = ulong_arg(1)
17 %)
18
19 @define _SYSCALL_IO_DESTROY_REGARGS_STORE
20 %(
21 if (@probewrite(ctx))
22 set_ulong_arg(1, ctx)
23 %)
24
25 probe syscall.io_destroy = dw_syscall.io_destroy !, nd_syscall.io_destroy ? {}
26 probe syscall.io_destroy.return = dw_syscall.io_destroy.return !,
27 nd_syscall.io_destroy.return ? {}
28
29 # dw_io_destroy _____________________________________________________
30
31 probe dw_syscall.io_destroy = kernel.function("sys_io_destroy").call
32 {
33 @_SYSCALL_IO_DESTROY_NAME
34 ctx = @__compat_ulong($ctx)
35 @_SYSCALL_IO_DESTROY_ARGSTR
36 }
37 probe dw_syscall.io_destroy.return = kernel.function("sys_io_destroy").return
38 {
39 @_SYSCALL_IO_DESTROY_NAME
40 @SYSC_RETVALSTR($return)
41 }
42
43 # nd_io_destroy _____________________________________________________
44
45 probe nd_syscall.io_destroy = nd1_syscall.io_destroy!, nd2_syscall.io_destroy!, tp_syscall.io_destroy
46 { }
47
48 probe nd1_syscall.io_destroy = kprobe.function("sys_io_destroy") ?
49 {
50 @_SYSCALL_IO_DESTROY_NAME
51 asmlinkage()
52 @_SYSCALL_IO_DESTROY_REGARGS
53 @_SYSCALL_IO_DESTROY_ARGSTR
54 }
55
56 /* kernel 4.17+ */
57 probe nd2_syscall.io_destroy = kprobe.function(@arch_syscall_prefix "sys_io_destroy")
58 {
59 __set_syscall_pt_regs(pointer_arg(1))
60 @_SYSCALL_IO_DESTROY_NAME
61 @_SYSCALL_IO_DESTROY_REGARGS
62 @_SYSCALL_IO_DESTROY_ARGSTR
63 },
64 {
65 %( @_IS_SREG_KERNEL %? @_SYSCALL_IO_DESTROY_REGARGS_STORE %)
66 }
67
68 /* kernel 3.5+, but undesirable because it affects all syscalls */
69 probe tp_syscall.io_destroy = kernel.trace("sys_enter")
70 {
71 __set_syscall_pt_regs($regs)
72 @__syscall_compat_gate(@const("__NR_io_destroy"), @const("__NR_compat_io_destroy"))
73 @_SYSCALL_IO_DESTROY_NAME
74 @_SYSCALL_IO_DESTROY_REGARGS
75 @_SYSCALL_IO_DESTROY_ARGSTR
76 },
77 {
78 %( @_IS_SREG_KERNEL %? @_SYSCALL_IO_DESTROY_REGARGS_STORE %)
79 }
80
81 probe nd_syscall.io_destroy.return = nd1_syscall.io_destroy.return!, nd2_syscall.io_destroy.return!, tp_syscall.io_destroy.return
82 { }
83
84 probe nd1_syscall.io_destroy.return = kprobe.function("sys_io_destroy").return ?
85 {
86 @_SYSCALL_IO_DESTROY_NAME
87 @SYSC_RETVALSTR(returnval())
88 }
89
90 /* kernel 4.17+ */
91 probe nd2_syscall.io_destroy.return = kprobe.function(@arch_syscall_prefix "sys_io_destroy").return
92 {
93 @_SYSCALL_IO_DESTROY_NAME
94 @SYSC_RETVALSTR(returnval())
95 }
96
97 /* kernel 3.5+, but undesirable because it affects all syscalls */
98 probe tp_syscall.io_destroy.return = kernel.trace("sys_exit")
99 {
100 __set_syscall_pt_regs($regs)
101 @__syscall_compat_gate(@const("__NR_io_destroy"), @const("__NR_compat_io_destroy"))
102 @_SYSCALL_IO_DESTROY_NAME
103 @SYSC_RETVALSTR($ret)
104 }