From e046d1cbd7bab5739c2c92c93b0f87bafc04328f Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Thu, 22 Dec 2016 17:28:25 +0100 Subject: [PATCH] PR20333/fchdir --- tapset/linux/nd_syscalls.stp | 15 ------------ tapset/linux/sysc_fchdir.stp | 44 ++++++++++++++++++++++++++++++++++++ tapset/linux/syscalls.stp | 14 ------------ 3 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 tapset/linux/sysc_fchdir.stp diff --git a/tapset/linux/nd_syscalls.stp b/tapset/linux/nd_syscalls.stp index 404a2adff..f04a4b5d2 100644 --- a/tapset/linux/nd_syscalls.stp +++ b/tapset/linux/nd_syscalls.stp @@ -1,19 +1,4 @@ -# fchdir _____________________________________________________ -# long sys_fchdir(unsigned int fd) -probe nd_syscall.fchdir = kprobe.function("sys_fchdir") ? -{ - name = "fchdir" - asmlinkage() - fd = int_arg(1) - argstr = sprint(fd) -} -probe nd_syscall.fchdir.return = kprobe.function("sys_fchdir").return ? -{ - name = "fchdir" - retstr = returnstr(1) -} - # fchmod _____________________________________________________ # long sys_fchmod(unsigned int fd, mode_t mode) probe nd_syscall.fchmod = kprobe.function("sys_fchmod") ? diff --git a/tapset/linux/sysc_fchdir.stp b/tapset/linux/sysc_fchdir.stp new file mode 100644 index 000000000..899de3596 --- /dev/null +++ b/tapset/linux/sysc_fchdir.stp @@ -0,0 +1,44 @@ +# fchdir _____________________________________________________ +# long sys_fchdir(unsigned int fd) + +@define _SYSCALL_FCHDIR_NAME +%( + name = "fchdir" +%) + +@define _SYSCALL_FCHDIR_ARGSTR +%( + argstr = sprint(fd) +%) + +probe syscall.fchdir = dw_syscall.fchdir !, nd_syscall.fchdir {} +probe syscall.fchdir.return = dw_syscall.fchdir.return !, nd_syscall.fchdir.return {} + +# dw_fchdir _____________________________________________________ + +probe dw_syscall.fchdir = kernel.function("sys_fchdir").call +{ + @_SYSCALL_FCHDIR_NAME + fd = __int32($fd) + @_SYSCALL_FCHDIR_ARGSTR +} +probe dw_syscall.fchdir.return = kernel.function("sys_fchdir").return +{ + @_SYSCALL_FCHDIR_NAME + retstr = return_str(1, $return) +} + +# nd_fchdir _____________________________________________________ + +probe nd_syscall.fchdir = kprobe.function("sys_fchdir") ? +{ + @_SYSCALL_FCHDIR_NAME + asmlinkage() + fd = int_arg(1) + @_SYSCALL_FCHDIR_ARGSTR +} +probe nd_syscall.fchdir.return = kprobe.function("sys_fchdir").return ? +{ + @_SYSCALL_FCHDIR_NAME + retstr = returnstr(1) +} diff --git a/tapset/linux/syscalls.stp b/tapset/linux/syscalls.stp index 13810bd93..bdac73b70 100644 --- a/tapset/linux/syscalls.stp +++ b/tapset/linux/syscalls.stp @@ -1,18 +1,4 @@ -# fchdir _____________________________________________________ -# long sys_fchdir(unsigned int fd) -probe syscall.fchdir = kernel.function("sys_fchdir").call -{ - name = "fchdir" - fd = __int32($fd) - argstr = sprint(__int32($fd)) -} -probe syscall.fchdir.return = kernel.function("sys_fchdir").return -{ - name = "fchdir" - retstr = return_str(1, $return) -} - # fchmod _____________________________________________________ # long sys_fchmod(unsigned int fd, mode_t mode) probe syscall.fchmod = kernel.function("sys_fchmod").call -- 2.43.5