From 6dec17f73803fabe3af41d76528bcf0975fce9e7 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Fri, 23 Dec 2016 15:13:53 +0100 Subject: [PATCH] PR20333/getitimer --- tapset/linux/nd_syscalls.stp | 31 -------------- tapset/linux/sysc_getitimer.stp | 74 +++++++++++++++++++++++++++++++++ tapset/linux/syscalls.stp | 29 ------------- 3 files changed, 74 insertions(+), 60 deletions(-) create mode 100644 tapset/linux/sysc_getitimer.stp diff --git a/tapset/linux/nd_syscalls.stp b/tapset/linux/nd_syscalls.stp index 997abcb4e..212627a53 100644 --- a/tapset/linux/nd_syscalls.stp +++ b/tapset/linux/nd_syscalls.stp @@ -1,35 +1,4 @@ -# getitimer __________________________________________________ -# sys_getitimer(int which, struct itimerval __user *value) -# -probe nd_syscall.getitimer = kprobe.function("sys_getitimer") ? -{ - name = "getitimer" - asmlinkage() - which = int_arg(1) - value_uaddr = pointer_arg(2) - argstr = sprintf("%s, %p", _itimer_which_str(which), value_uaddr) -} -probe nd_syscall.getitimer.return = kprobe.function("sys_getitimer").return ? -{ - name = "getitimer" - retstr = returnstr(1) -} -# long compat_sys_getitimer(int which, struct compat_itimerval __user *it -probe nd_syscall.compat_getitimer = kprobe.function("compat_sys_getitimer") ? -{ - name = "getitimer" - asmlinkage() - which = int_arg(1) - value_uaddr = pointer_arg(2) - argstr = sprintf("%s, %p", _itimer_which_str(which), value_uaddr) -} -probe nd_syscall.compat_getitimer.return = kprobe.function("compat_sys_getitimer").return ? -{ - name = "getitimer" - retstr = returnstr(1) -} - # get_mempolicy ______________________________________________ # long sys_get_mempolicy(int __user *policy, # unsigned long __user *nmask, diff --git a/tapset/linux/sysc_getitimer.stp b/tapset/linux/sysc_getitimer.stp new file mode 100644 index 000000000..b7a7c7ebd --- /dev/null +++ b/tapset/linux/sysc_getitimer.stp @@ -0,0 +1,74 @@ +# getitimer __________________________________________________ +# sys_getitimer(int which, struct itimerval __user *value) +# + +@define _SYSCALL_GETITIMER_NAME +%( + name = "getitimer" +%) + +@define _SYSCALL_GETITIMER_ARGSTR +%( + argstr = sprintf("%s, %p", _itimer_which_str(which), value_uaddr) +%) + +probe syscall.getitimer = dw_syscall.getitimer !, nd_syscall.getitimer {} +probe syscall.getitimer.return = dw_syscall.getitimer.return !, nd_syscall.getitimer.return {} + +# dw_getitimer _____________________________________________________ + +probe dw_syscall.getitimer = kernel.function("sys_getitimer").call +{ + @_SYSCALL_GETITIMER_NAME + which = __int32($which) + value_uaddr = $value + @_SYSCALL_GETITIMER_ARGSTR +} +probe dw_syscall.getitimer.return = kernel.function("sys_getitimer").return +{ + @_SYSCALL_GETITIMER_NAME + retstr = return_str(1, $return) +} +# long compat_sys_getitimer(int which, struct compat_itimerval __user *it +probe syscall.compat_getitimer = kernel.function("compat_sys_getitimer").call ? +{ + @_SYSCALL_GETITIMER_NAME + which = __int32($which) + value_uaddr = @__pointer($it) + @_SYSCALL_GETITIMER_ARGSTR +} +probe syscall.compat_getitimer.return = kernel.function("compat_sys_getitimer").return ? +{ + @_SYSCALL_GETITIMER_NAME + retstr = return_str(1, $return) +} + +# nd_getitimer _____________________________________________________ + +probe nd_syscall.getitimer = kprobe.function("sys_getitimer") ? +{ + @_SYSCALL_GETITIMER_NAME + asmlinkage() + which = int_arg(1) + value_uaddr = pointer_arg(2) + @_SYSCALL_GETITIMER_ARGSTR +} +probe nd_syscall.getitimer.return = kprobe.function("sys_getitimer").return ? +{ + @_SYSCALL_GETITIMER_NAME + retstr = returnstr(1) +} +# long compat_sys_getitimer(int which, struct compat_itimerval __user *it +probe nd_syscall.compat_getitimer = kprobe.function("compat_sys_getitimer") ? +{ + @_SYSCALL_GETITIMER_NAME + asmlinkage() + which = int_arg(1) + value_uaddr = pointer_arg(2) + @_SYSCALL_GETITIMER_ARGSTR +} +probe nd_syscall.compat_getitimer.return = kprobe.function("compat_sys_getitimer").return ? +{ + @_SYSCALL_GETITIMER_NAME + retstr = returnstr(1) +} diff --git a/tapset/linux/syscalls.stp b/tapset/linux/syscalls.stp index c4da7c31c..230e1ee0e 100644 --- a/tapset/linux/syscalls.stp +++ b/tapset/linux/syscalls.stp @@ -1,33 +1,4 @@ -# getitimer __________________________________________________ -# sys_getitimer(int which, struct itimerval __user *value) -# -probe syscall.getitimer = kernel.function("sys_getitimer").call -{ - name = "getitimer" - which = __int32($which) - value_uaddr = $value - argstr = sprintf("%s, %p", _itimer_which_str(which), $value) -} -probe syscall.getitimer.return = kernel.function("sys_getitimer").return -{ - name = "getitimer" - retstr = return_str(1, $return) -} -# long compat_sys_getitimer(int which, struct compat_itimerval __user *it -probe syscall.compat_getitimer = kernel.function("compat_sys_getitimer").call ? -{ - name = "getitimer" - which = __int32($which) - value_uaddr = @__pointer($it) - argstr = sprintf("%s, %p", _itimer_which_str(which), value_uaddr) -} -probe syscall.compat_getitimer.return = kernel.function("compat_sys_getitimer").return ? -{ - name = "getitimer" - retstr = return_str(1, $return) -} - # get_mempolicy ______________________________________________ # long sys_get_mempolicy(int __user *policy, # unsigned long __user *nmask, -- 2.43.5