Debian Codegraph @

tapset/linux/x86_64/sysc_pipe32.stp

raw
1 # pipe _______________________________________________________
2 #
3 # long sys32_pipe(int __user *fd)
4 # Not available in newer kernels.
5
6 @define _SYSCALL_PIPE32_NAME
7 %(
8 name = "pipe"
9 %)
10
11 probe syscall.pipe32 = dw_syscall.pipe32 !, nd_syscall.pipe32 ? {}
12 probe syscall.pipe32.return = dw_syscall.pipe32.return !, nd_syscall.pipe32.return ? {}
13
14 # dw_pipe32 _____________________________________________________
15
16 probe dw_syscall.pipe32 = kernel.function("sys32_pipe")?
17 {
18 @_SYSCALL_PIPE32_NAME
19 flags = 0;
20 flag_str = ""
21 if (@defined($fd)) {
22 fildes_uaddr = $fd
23 if (fildes_uaddr == 0) {
24 pipe0 = 0;
25 pipe1 = 0;
26 argstr = "NULL"
27 } else {
28 pipe0 = user_int(&$fd[0]);
29 pipe1 = user_int(&$fd[1]);
30 argstr = sprintf("[%d, %d]", pipe0, pipe1);
31 }
32 } else {
33 fildes_uaddr = 0;
34 pipe0 = 0;
35 pipe1 = 0;
36 argstr = "[0, 0]";
37 }
38 }
39 probe dw_syscall.pipe32.return = kernel.function("sys32_pipe").return?
40 {
41 @_SYSCALL_PIPE32_NAME
42 flags = 0;
43 if (@defined(@entry($fd))) {
44 fildes_uaddr = @entry($fd)
45 if (fildes_uaddr == 0) {
46 pipe0 = 0;
47 pipe1 = 0;
48 } else {
49 pipe0 = @entry(user_int(&$fd[0]));
50 pipe1 = @entry(user_int(&$fd[1]));
51 }
52 } else {
53 fildes_uaddr = 0;
54 pipe0 = 0;
55 pipe1 = 0;
56 }
57 @SYSC_RETVALSTR($return)
58 }
59
60 # nd_pipe32 _____________________________________________________
61
62 probe nd_syscall.pipe32 = kprobe.function("sys32_pipe")?
63 {
64 @_SYSCALL_PIPE32_NAME
65 asmlinkage()
66 argstr = sprintf("%p", pointer_arg(1))
67 }
68 probe nd_syscall.pipe32.return = kprobe.function("sys32_pipe").return?
69 {
70 @_SYSCALL_PIPE32_NAME
71 @SYSC_RETVALSTR(returnval())
72 }