From fae37a9b588cd18161ab7f1d281bc6bf84ecc30d Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Tue, 3 Jan 2017 11:52:52 +0100 Subject: [PATCH] PR20333/stime --- tapset/linux/nd_syscalls2.stp | 21 -------------- tapset/linux/sysc_stime.stp | 54 +++++++++++++++++++++++++++++++++++ tapset/linux/syscalls2.stp | 20 ------------- 3 files changed, 54 insertions(+), 41 deletions(-) create mode 100644 tapset/linux/sysc_stime.stp diff --git a/tapset/linux/nd_syscalls2.stp b/tapset/linux/nd_syscalls2.stp index 8f13323fd..99e411862 100644 --- a/tapset/linux/nd_syscalls2.stp +++ b/tapset/linux/nd_syscalls2.stp @@ -1,25 +1,4 @@ -# stime ______________________________________________________ -# -# long sys_stime(time_t __user *tptr) -# long compat_sys_stime(compat_time_t __user *tptr) -# -probe nd_syscall.stime = kprobe.function("compat_sys_stime") ?, - kprobe.function("sys_stime") ? -{ - name = "stime" - /* FIXME. Decode time */ - asmlinkage() - t_uaddr = pointer_arg(1) - argstr = sprintf("%p", t_uaddr) -} -probe nd_syscall.stime.return = kprobe.function("compat_sys_stime").return ?, - kprobe.function("sys_stime").return ? -{ - name = "stime" - retstr = returnstr(1) -} - # swapoff ____________________________________________________ # # asmlinkage long diff --git a/tapset/linux/sysc_stime.stp b/tapset/linux/sysc_stime.stp new file mode 100644 index 000000000..117014f3b --- /dev/null +++ b/tapset/linux/sysc_stime.stp @@ -0,0 +1,54 @@ +# stime ______________________________________________________ +# +# long sys_stime(time_t __user *tptr) +# long compat_sys_stime(compat_time_t __user *tptr) +# + +@define _SYSCALL_STIME_NAME +%( + name = "stime" +%) + +@define _SYSCALL_STIME_ARGSTR +%( + argstr = sprintf("%p", t_uaddr) +%) + +probe syscall.stime = dw_syscall.stime !, nd_syscall.stime {} +probe syscall.stime.return = dw_syscall.stime.return !, + nd_syscall.stime.return {} + +# dw_stime _____________________________________________________ + +probe dw_syscall.stime = kernel.function("compat_sys_stime").call ?, + kernel.function("sys_stime").call ? +{ + @_SYSCALL_STIME_NAME + t_uaddr = $tptr + /* FIXME. Decode time */ + @_SYSCALL_STIME_ARGSTR +} +probe dw_syscall.stime.return = kernel.function("compat_sys_stime").return ?, + kernel.function("sys_stime").return ? +{ + @_SYSCALL_STIME_NAME + retstr = return_str(1, $return) +} + +# nd_stime _____________________________________________________ + +probe nd_syscall.stime = kprobe.function("compat_sys_stime") ?, + kprobe.function("sys_stime") ? +{ + @_SYSCALL_STIME_NAME + asmlinkage() + t_uaddr = pointer_arg(1) + /* FIXME. Decode time */ + @_SYSCALL_STIME_ARGSTR +} +probe nd_syscall.stime.return = kprobe.function("compat_sys_stime").return ?, + kprobe.function("sys_stime").return ? +{ + @_SYSCALL_STIME_NAME + retstr = returnstr(1) +} diff --git a/tapset/linux/syscalls2.stp b/tapset/linux/syscalls2.stp index e39b0ae29..54f3fe682 100644 --- a/tapset/linux/syscalls2.stp +++ b/tapset/linux/syscalls2.stp @@ -1,24 +1,4 @@ -# stime ______________________________________________________ -# -# long sys_stime(time_t __user *tptr) -# long compat_sys_stime(compat_time_t __user *tptr) -# -probe syscall.stime = kernel.function("compat_sys_stime").call ?, - kernel.function("sys_stime").call ? -{ - name = "stime" - t_uaddr = $tptr - /* FIXME. Decode time */ - argstr = sprintf("%p", $tptr) -} -probe syscall.stime.return = kernel.function("compat_sys_stime").return ?, - kernel.function("sys_stime").return ? -{ - name = "stime" - retstr = return_str(1, $return) -} - # swapoff ____________________________________________________ # # asmlinkage long -- 2.43.5