| 1 |
/** |
| 2 |
* probe syscall_any - Record entry into a syscall |
| 3 |
* |
| 4 |
* @syscall_nr: number of the syscall |
| 5 |
* @name: name of the syscall |
| 6 |
* |
| 7 |
* Context: The process performing the syscall |
| 8 |
* |
| 9 |
* The syscall_any probe point is designed to be a low overhead |
| 10 |
* that monitors all the syscalls entered via a kernel tracepoint. |
| 11 |
* Because of the breadth of syscalls it monitors it provides |
| 12 |
* no information about the syscall arguments or argstr string |
| 13 |
* representation of those arguments. |
| 14 |
* |
| 15 |
* This requires kernel 3.5+ and newer which have the |
| 16 |
* kernel.trace("sys_enter") probe point. |
| 17 |
*/ |
| 18 |
probe syscall_any = kernel.trace("sys_enter") |
| 19 |
{ |
| 20 |
__set_syscall_pt_regs($regs) |
| 21 |
syscall_nr = $id |
| 22 |
name = syscall_name($id) |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* probe syscall_any.return - Record exit from a syscall |
| 27 |
* |
| 28 |
* @syscall_nr: number of the syscall |
| 29 |
* @name: name of the syscall |
| 30 |
* @retval: return value of the syscall |
| 31 |
* |
| 32 |
* Context: The process performing the syscall |
| 33 |
* |
| 34 |
* The syscall_any.return probe point is designed to be a low overhead |
| 35 |
* that monitors all the syscalls returns via a kernel tracepoint. |
| 36 |
* Because of the breadth of syscalls it monitors it provides |
| 37 |
* no information about the syscall arguments, argstr string |
| 38 |
* representation of those arguments, or a string interpretation |
| 39 |
* of the return value (retval). |
| 40 |
* |
| 41 |
* This requires kernel 3.5+ and newer which have the |
| 42 |
* kernel.trace("sys_exit") probe point. |
| 43 |
*/ |
| 44 |
probe syscall_any.return = kernel.trace("sys_exit") |
| 45 |
{ |
| 46 |
__set_syscall_pt_regs($regs) |
| 47 |
syscall_nr = _stp_syscall_nr() |
| 48 |
name = syscall_name(_stp_syscall_nr()) |
| 49 |
retval = $ret |
| 50 |
} |