From 02601cffdbefc302d876efc365ae7da6e03cc929 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Wed, 4 Jan 2017 18:50:16 +0100 Subject: [PATCH] PR20333/compat_fadvise64 --- tapset/linux/x86_64/nd_syscalls.stp | 24 -------- tapset/linux/x86_64/sysc_compat_fadvise64.stp | 61 +++++++++++++++++++ tapset/linux/x86_64/syscalls.stp | 24 -------- 3 files changed, 61 insertions(+), 48 deletions(-) create mode 100644 tapset/linux/x86_64/sysc_compat_fadvise64.stp diff --git a/tapset/linux/x86_64/nd_syscalls.stp b/tapset/linux/x86_64/nd_syscalls.stp index c7c5ba633..0660708c0 100644 --- a/tapset/linux/x86_64/nd_syscalls.stp +++ b/tapset/linux/x86_64/nd_syscalls.stp @@ -1,28 +1,4 @@ -# fadvise64 _______________________________________________________ -# -# asmlinkage long sys32_fadvise64(int fd, unsigned offset_lo, -# unsigned offset_hi, -# size_t len, int advice) -# -probe nd_syscall.compat_fadvise64 = kprobe.function("sys32_fadvise64") ? -{ - asmlinkage() - name = "fadvise64" - fd = int_arg(1) - offset = ((uint_arg(3) << 32) | uint_arg(2)) - len = int_arg(4) - advice = int_arg(5) - argstr = sprintf("%d, %d, %d, %s", fd, offset, len, - _fadvice_advice_str(advice)) -} -probe nd_syscall.compat_fadvise64.return = - kprobe.function("sys32_fadvise64").return ? -{ - name = "fadvise64" - retstr = returnstr(1) -} - # fadvise64_64 __________________________________________________ # # long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high, diff --git a/tapset/linux/x86_64/sysc_compat_fadvise64.stp b/tapset/linux/x86_64/sysc_compat_fadvise64.stp new file mode 100644 index 000000000..35d11e8bd --- /dev/null +++ b/tapset/linux/x86_64/sysc_compat_fadvise64.stp @@ -0,0 +1,61 @@ +# fadvise64 _______________________________________________________ +# +# asmlinkage long sys32_fadvise64(int fd, unsigned offset_lo, +# unsigned offset_hi, +# size_t len, int advice) +# + +@define _SYSCALL_COMPAT_FADVISE64_NAME +%( + name = "fadvise64" +%) + +@define _SYSCALL_COMPAT_FADVISE64_ARGSTR +%( + argstr = sprintf("%d, %d, %d, %s", fd, offset, len, advice_str) +%) + +probe syscall.compat_fadvise64 = dw_syscall.compat_fadvise64 !, + nd_syscall.compat_fadvise64 {} +probe syscall.compat_fadvise64.return = dw_syscall.compat_fadvise64.return !, + nd_syscall.compat_fadvise64.return {} + +# dw_compat_fadvise64 _____________________________________________________ + +probe dw_syscall.compat_fadvise64 = kernel.function("sys32_fadvise64").call ? +{ + @_SYSCALL_COMPAT_FADVISE64_NAME + fd = __int32($fd) + + offset = (($offset_hi << 32) | $offset_lo) + len = __int32($len) + advice = __int32($advice) + advice_str = _fadvice_advice_str(advice) + @_SYSCALL_COMPAT_FADVISE64_ARGSTR +} +probe dw_syscall.compat_fadvise64.return = + kernel.function("sys32_fadvise64").return ? +{ + @_SYSCALL_COMPAT_FADVISE64_NAME + retstr = return_str(1, $return) +} + +# nd_compat_fadvise64 _____________________________________________________ + +probe nd_syscall.compat_fadvise64 = kprobe.function("sys32_fadvise64") ? +{ + asmlinkage() + @_SYSCALL_COMPAT_FADVISE64_NAME + fd = int_arg(1) + offset = ((uint_arg(3) << 32) | uint_arg(2)) + len = int_arg(4) + advice = int_arg(5) + advice_str = _fadvice_advice_str(advice) + @_SYSCALL_COMPAT_FADVISE64_ARGSTR +} +probe nd_syscall.compat_fadvise64.return = + kprobe.function("sys32_fadvise64").return ? +{ + @_SYSCALL_COMPAT_FADVISE64_NAME + retstr = returnstr(1) +} diff --git a/tapset/linux/x86_64/syscalls.stp b/tapset/linux/x86_64/syscalls.stp index 494b323c5..1fdc9e376 100644 --- a/tapset/linux/x86_64/syscalls.stp +++ b/tapset/linux/x86_64/syscalls.stp @@ -1,28 +1,4 @@ -# fadvise64 _______________________________________________________ -# -# asmlinkage long sys32_fadvise64(int fd, unsigned offset_lo, -# unsigned offset_hi, -# size_t len, int advice) -# -probe syscall.compat_fadvise64 = kernel.function("sys32_fadvise64").call ? -{ - name = "fadvise64" - fd = __int32($fd) - - offset = (($offset_hi << 32) | $offset_lo) - len = __int32($len) - advice = __int32($advice) - argstr = sprintf("%d, %d, %d, %s", __int32($fd), offset, len, - _fadvice_advice_str(__int32($advice))) -} -probe syscall.compat_fadvise64.return = - kernel.function("sys32_fadvise64").return ? -{ - name = "fadvise64" - retstr = return_str(1, $return) -} - # fadvise64_64 __________________________________________________ # # long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high, -- 2.43.5