| 1 |
# sched_rr_get_interval ______________________________________ |
| 2 |
# |
| 3 |
# long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval) |
| 4 |
# |
| 5 |
|
| 6 |
@define _SYSCALL_SCHED_RR_GET_INTERVAL_NAME |
| 7 |
%( |
| 8 |
name = "sched_rr_get_interval" |
| 9 |
%) |
| 10 |
|
| 11 |
@define _SYSCALL_SCHED_RR_GET_INTERVAL_ARGSTR |
| 12 |
%( |
| 13 |
argstr = sprintf("%d, %p", pid, tp_uaddr) |
| 14 |
%) |
| 15 |
|
| 16 |
@define _SYSCALL_SCHED_RR_GET_INTERVAL_REGARGS |
| 17 |
%( |
| 18 |
pid = int_arg(1) |
| 19 |
tp_uaddr = pointer_arg(2) |
| 20 |
%) |
| 21 |
|
| 22 |
@define _SYSCALL_SCHED_RR_GET_INTERVAL_REGARGS_STORE |
| 23 |
%( |
| 24 |
if (@probewrite(pid)) |
| 25 |
set_int_arg(1, pid) |
| 26 |
|
| 27 |
if (@probewrite(tp_uaddr)) |
| 28 |
set_pointer_arg(2, tp_uaddr) |
| 29 |
%) |
| 30 |
|
| 31 |
probe syscall.sched_rr_get_interval = dw_syscall.sched_rr_get_interval !, |
| 32 |
nd_syscall.sched_rr_get_interval ? {} |
| 33 |
probe syscall.sched_rr_get_interval.return = dw_syscall.sched_rr_get_interval.return !, |
| 34 |
nd_syscall.sched_rr_get_interval.return ? {} |
| 35 |
|
| 36 |
# dw_sched_rr_get_interval _____________________________________________________ |
| 37 |
|
| 38 |
probe dw_syscall.sched_rr_get_interval = __syscall.sched_rr_get_interval, |
| 39 |
kernel.function("compat_sys_sched_rr_get_interval").call ?, |
| 40 |
kernel.function("sys32_sched_rr_get_interval").call ? |
| 41 |
{ |
| 42 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_NAME |
| 43 |
pid = __int32($pid) |
| 44 |
tp_uaddr = @__pointer($interval) |
| 45 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_ARGSTR |
| 46 |
} |
| 47 |
probe __syscall.sched_rr_get_interval = |
| 48 |
kernel.function("sys_sched_rr_get_interval").call |
| 49 |
{ |
| 50 |
@__syscall_gate(@const("__NR_sched_rr_get_interval")) |
| 51 |
} |
| 52 |
probe dw_syscall.sched_rr_get_interval.return = |
| 53 |
__syscall.sched_rr_get_interval.return, |
| 54 |
kernel.function("compat_sys_sched_rr_get_interval").return ?, |
| 55 |
kernel.function("sys32_sched_rr_get_interval").return ? |
| 56 |
{ |
| 57 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_NAME |
| 58 |
@SYSC_RETVALSTR($return) |
| 59 |
} |
| 60 |
probe __syscall.sched_rr_get_interval.return = |
| 61 |
kernel.function("sys_sched_rr_get_interval").return |
| 62 |
{ |
| 63 |
@__syscall_gate(@const("__NR_sched_rr_get_interval")) |
| 64 |
} |
| 65 |
|
| 66 |
# nd_sched_rr_get_interval _____________________________________________________ |
| 67 |
|
| 68 |
probe nd_syscall.sched_rr_get_interval = nd1_syscall.sched_rr_get_interval!, nd2_syscall.sched_rr_get_interval!, tp_syscall.sched_rr_get_interval |
| 69 |
{ } |
| 70 |
|
| 71 |
probe nd1_syscall.sched_rr_get_interval = __nd1_syscall.sched_rr_get_interval, |
| 72 |
kprobe.function("compat_sys_sched_rr_get_interval").call ?, |
| 73 |
kprobe.function("sys32_sched_rr_get_interval").call ? |
| 74 |
{ |
| 75 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_NAME |
| 76 |
asmlinkage() |
| 77 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_REGARGS |
| 78 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_ARGSTR |
| 79 |
} |
| 80 |
probe __nd1_syscall.sched_rr_get_interval = |
| 81 |
kprobe.function("sys_sched_rr_get_interval").call |
| 82 |
{ |
| 83 |
@__syscall_gate(@const("__NR_sched_rr_get_interval")) |
| 84 |
} |
| 85 |
|
| 86 |
/* kernel 4.17+ */ |
| 87 |
probe nd2_syscall.sched_rr_get_interval = |
| 88 |
kprobe.function(@arch_syscall_prefix "sys_sched_rr_get_interval") ?, |
| 89 |
kprobe.function(@arch_syscall_prefix "compat_sys_sched_rr_get_interval") ? |
| 90 |
{ |
| 91 |
__set_syscall_pt_regs(pointer_arg(1)) |
| 92 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_NAME |
| 93 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_REGARGS |
| 94 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_ARGSTR |
| 95 |
}, |
| 96 |
{ |
| 97 |
%( @_IS_SREG_KERNEL %? @_SYSCALL_SCHED_RR_GET_INTERVAL_REGARGS_STORE %) |
| 98 |
} |
| 99 |
|
| 100 |
/* kernel 3.5+, but undesirable because it affects all syscalls */ |
| 101 |
probe tp_syscall.sched_rr_get_interval = kernel.trace("sys_enter") |
| 102 |
{ |
| 103 |
__set_syscall_pt_regs($regs) |
| 104 |
@__syscall_compat_gate(@const("__NR_sched_rr_get_interval"), @const("__NR_compat_sched_rr_get_interval")) |
| 105 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_NAME |
| 106 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_REGARGS |
| 107 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_ARGSTR |
| 108 |
}, |
| 109 |
{ |
| 110 |
%( @_IS_SREG_KERNEL %? @_SYSCALL_SCHED_RR_GET_INTERVAL_REGARGS_STORE %) |
| 111 |
} |
| 112 |
|
| 113 |
probe nd_syscall.sched_rr_get_interval.return = nd1_syscall.sched_rr_get_interval.return!, nd2_syscall.sched_rr_get_interval.return!, tp_syscall.sched_rr_get_interval.return |
| 114 |
{ } |
| 115 |
|
| 116 |
probe nd1_syscall.sched_rr_get_interval.return = |
| 117 |
__nd1_syscall.sched_rr_get_interval.return, |
| 118 |
kprobe.function("compat_sys_sched_rr_get_interval").return ?, |
| 119 |
kprobe.function("sys32_sched_rr_get_interval").return ? |
| 120 |
{ |
| 121 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_NAME |
| 122 |
@SYSC_RETVALSTR(returnval()) |
| 123 |
} |
| 124 |
probe __nd1_syscall.sched_rr_get_interval.return = |
| 125 |
kprobe.function("sys_sched_rr_get_interval").return |
| 126 |
{ |
| 127 |
@__syscall_gate(@const("__NR_sched_rr_get_interval")) |
| 128 |
} |
| 129 |
|
| 130 |
/* kernel 4.17+ */ |
| 131 |
probe nd2_syscall.sched_rr_get_interval.return = |
| 132 |
kprobe.function(@arch_syscall_prefix "sys_sched_rr_get_interval").return ?, |
| 133 |
kprobe.function(@arch_syscall_prefix "compat_sys_sched_rr_get_interval").return ? |
| 134 |
{ |
| 135 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_NAME |
| 136 |
@SYSC_RETVALSTR(returnval()) |
| 137 |
} |
| 138 |
|
| 139 |
/* kernel 3.5+, but undesirable because it affects all syscalls */ |
| 140 |
probe tp_syscall.sched_rr_get_interval.return = kernel.trace("sys_exit") |
| 141 |
{ |
| 142 |
__set_syscall_pt_regs($regs) |
| 143 |
@__syscall_compat_gate(@const("__NR_sched_rr_get_interval"), @const("__NR_compat_sched_rr_get_interval")) |
| 144 |
@_SYSCALL_SCHED_RR_GET_INTERVAL_NAME |
| 145 |
@SYSC_RETVALSTR($ret) |
| 146 |
} |