From e51de9a8fea290a97f730c6a633ac037e1d201aa Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Tue, 3 Jan 2017 08:26:07 +0100 Subject: [PATCH] PR20333/setpriority --- tapset/linux/nd_syscalls2.stp | 23 ------------- tapset/linux/sysc_setpriority.stp | 55 +++++++++++++++++++++++++++++++ tapset/linux/syscalls2.stp | 22 ------------- 3 files changed, 55 insertions(+), 45 deletions(-) create mode 100644 tapset/linux/sysc_setpriority.stp diff --git a/tapset/linux/nd_syscalls2.stp b/tapset/linux/nd_syscalls2.stp index 837717280..9d2f82c36 100644 --- a/tapset/linux/nd_syscalls2.stp +++ b/tapset/linux/nd_syscalls2.stp @@ -1,27 +1,4 @@ -# setpriority ________________________________________________ -# -# asmlinkage long -# sys_setpriority(int which, -# int who, -# int niceval) -# -probe nd_syscall.setpriority = kprobe.function("sys_setpriority") ? -{ - name = "setpriority" - asmlinkage() - which = int_arg(1) - which_str = _priority_which_str(which) - who = int_arg(2) - prio = int_arg(3) - argstr = sprintf("%s, %d, %d", which_str, who, prio) -} -probe nd_syscall.setpriority.return = kprobe.function("sys_setpriority").return ? -{ - name = "setpriority" - retstr = returnstr(1) -} - # setregid ___________________________________________________ # long sys_setregid(gid_t rgid, gid_t egid) # diff --git a/tapset/linux/sysc_setpriority.stp b/tapset/linux/sysc_setpriority.stp new file mode 100644 index 000000000..00ab123c5 --- /dev/null +++ b/tapset/linux/sysc_setpriority.stp @@ -0,0 +1,55 @@ +# setpriority ________________________________________________ +# +# asmlinkage long +# sys_setpriority(int which, +# int who, +# int niceval) +# + +@define _SYSCALL_SETPRIORITY_NAME +%( + name = "setpriority" +%) + +@define _SYSCALL_SETPRIORITY_ARGSTR +%( + argstr = sprintf("%s, %d, %d", which_str, who, prio) +%) + +probe syscall.setpriority = dw_syscall.setpriority !, nd_syscall.setpriority {} +probe syscall.setpriority.return = dw_syscall.setpriority.return !, nd_syscall.setpriority.return {} + +# dw_setpriority _____________________________________________________ + +probe dw_syscall.setpriority = kernel.function("sys_setpriority").call +{ + @_SYSCALL_SETPRIORITY_NAME + which = __int32($which) + which_str = _priority_which_str(__int32($which)) + who = __int32($who) + prio = __int32($niceval) + @_SYSCALL_SETPRIORITY_ARGSTR +} +probe dw_syscall.setpriority.return = kernel.function("sys_setpriority").return +{ + @_SYSCALL_SETPRIORITY_NAME + retstr = return_str(1, $return) +} + +# nd_setpriority _____________________________________________________ + +probe nd_syscall.setpriority = kprobe.function("sys_setpriority") ? +{ + @_SYSCALL_SETPRIORITY_NAME + asmlinkage() + which = int_arg(1) + which_str = _priority_which_str(which) + who = int_arg(2) + prio = int_arg(3) + @_SYSCALL_SETPRIORITY_ARGSTR +} +probe nd_syscall.setpriority.return = kprobe.function("sys_setpriority").return ? +{ + @_SYSCALL_SETPRIORITY_NAME + retstr = returnstr(1) +} diff --git a/tapset/linux/syscalls2.stp b/tapset/linux/syscalls2.stp index 9de57ccd7..af86a1948 100644 --- a/tapset/linux/syscalls2.stp +++ b/tapset/linux/syscalls2.stp @@ -1,25 +1,3 @@ -# setpriority ________________________________________________ -# -# asmlinkage long -# sys_setpriority(int which, -# int who, -# int niceval) -# -probe syscall.setpriority = kernel.function("sys_setpriority").call -{ - name = "setpriority" - which = __int32($which) - which_str = _priority_which_str(__int32($which)) - who = __int32($who) - prio = __int32($niceval) - argstr = sprintf("%s, %d, %d", which_str, __int32($who), - __int32($niceval)) -} -probe syscall.setpriority.return = kernel.function("sys_setpriority").return -{ - name = "setpriority" - retstr = return_str(1, $return) -} # setregid ___________________________________________________ # long sys_setregid(gid_t rgid, gid_t egid) -- 2.43.5