Debian Codegraph @

tapset/linux/s390/sysc_ipc.stp

raw
1 %( systemtap_v < "2.7" %?
2 # sys32_ipc() is just a syscall multiplexer (similar to
3 # sys_socketcall()). So, we don't really need to probe it, since we'll
4 # be probing what sys32_ipc() will call (semget, msgsnd, msgrcv,
5 # shmat, etc.).
6
7 # ipc _________________________________________________
8 # long sys32_ipc(u32 call, int first, int second, int third, u32 ptr)
9 #
10
11 @define _SYSCALL_IPC_NAME
12 %(
13 name = "ipc"
14 %)
15
16 @define _SYSCALL_IPC_ARGSTR
17 %(
18 argstr = sprintf("%d, %d, %d, %d, %p", call, first, second, third, ptr)
19 %)
20
21 probe syscall.ipc = dw_syscall.ipc !, nd_syscall.ipc ? {}
22 probe syscall.ipc.return = dw_syscall.ipc.return !, nd_syscall.ipc.return ? {}
23
24 # dw_ipc _____________________________________________________
25
26 probe dw_syscall.ipc = kernel.function("sys32_ipc") ?
27 {
28 @_SYSCALL_IPC_NAME
29 call = $call
30 first = $first
31 second = $second
32 third = $third
33 ptr = $ptr
34 @_SYSCALL_IPC_ARGSTR
35 }
36 probe dw_syscall.ipc.return = kernel.function("sys32_ipc").return ?
37 {
38 @_SYSCALL_IPC_NAME
39 @SYSC_RETVALSTR($return)
40 }
41
42 # nd_ipc _____________________________________________________
43
44 probe nd_syscall.ipc = kprobe.function("sys32_ipc") ?
45 {
46 @_SYSCALL_IPC_NAME
47 asmlinkage()
48 call = uint_arg(1)
49 first = int_arg(2)
50 second = int_arg(3)
51 third = int_arg(4)
52 ptr = uint_arg(5)
53 @_SYSCALL_IPC_ARGSTR
54 }
55 probe nd_syscall.ipc.return = kprobe.function("sys32_ipc").return ?
56 {
57 @_SYSCALL_IPC_NAME
58 @SYSC_RETVALSTR(returnval())
59 }
60 %)