| 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 |
# int sys_ipc (uint call, int first, int second, int third, void __user *ptr, long fifth) |
| 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, %d", call, first, |
| 19 |
second, third, ptr_uaddr, fifth) |
| 20 |
%) |
| 21 |
|
| 22 |
probe syscall.ipc = dw_syscall.ipc !, nd_syscall.ipc ? {} |
| 23 |
probe syscall.ipc.return = dw_syscall.ipc.return !, nd_syscall.ipc.return ? {} |
| 24 |
|
| 25 |
# dw_ipc _____________________________________________________ |
| 26 |
|
| 27 |
probe dw_syscall.ipc = kernel.function("sys_ipc") ? |
| 28 |
{ |
| 29 |
@_SYSCALL_IPC_NAME |
| 30 |
call = $call |
| 31 |
first = $first |
| 32 |
second = $second |
| 33 |
third = $third |
| 34 |
ptr_uaddr = $ptr |
| 35 |
fifth = $fifth |
| 36 |
@_SYSCALL_IPC_ARGSTR |
| 37 |
} |
| 38 |
probe dw_syscall.ipc.return = kernel.function("sys_ipc").return ? |
| 39 |
{ |
| 40 |
@_SYSCALL_IPC_NAME |
| 41 |
@SYSC_RETVALSTR($return) |
| 42 |
} |
| 43 |
|
| 44 |
# nd_ipc _____________________________________________________ |
| 45 |
|
| 46 |
probe nd_syscall.ipc = kprobe.function("sys_ipc") ? |
| 47 |
{ |
| 48 |
@_SYSCALL_IPC_NAME |
| 49 |
asmlinkage() |
| 50 |
call = uint_arg(1) |
| 51 |
first = int_arg(2) |
| 52 |
second = int_arg(3) |
| 53 |
third = int_arg(4) |
| 54 |
ptr_uaddr = pointer_arg(5) |
| 55 |
fifth = long_arg(6) |
| 56 |
@_SYSCALL_IPC_ARGSTR |
| 57 |
} |
| 58 |
probe nd_syscall.ipc.return = kprobe.function("sys_ipc").return ? |
| 59 |
{ |
| 60 |
@_SYSCALL_IPC_NAME |
| 61 |
@SYSC_RETVALSTR(returnval()) |
| 62 |
} |
| 63 |
%) |