From: Martin Cermak Date: Tue, 3 Jan 2017 12:43:00 +0000 (+0100) Subject: PR20333/umask X-Git-Tag: release-3.1~182 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=02ec9c0bb3f0396b97125870d234945a5ca9dcca;p=systemtap.git PR20333/umask --- diff --git a/tapset/linux/nd_syscalls2.stp b/tapset/linux/nd_syscalls2.stp index 8441c5ff0..89beaa9c1 100644 --- a/tapset/linux/nd_syscalls2.stp +++ b/tapset/linux/nd_syscalls2.stp @@ -1,20 +1,4 @@ -# umask ______________________________________________________ -# long sys_umask(int mask) -# -probe nd_syscall.umask = kprobe.function("sys_umask") ? -{ - name = "umask" - asmlinkage() - mask = uint_arg(1) - argstr = sprintf("%#o", mask) -} -probe nd_syscall.umask.return = kprobe.function("sys_umask").return ? -{ - name = "umask" - retstr = returnstr(3) -} - # umount _____________________________________________________ # long sys_umount(char __user * name, int flags) # SYSCALL_DEFINE1(oldumount, char __user *, name) diff --git a/tapset/linux/sysc_umask.stp b/tapset/linux/sysc_umask.stp new file mode 100644 index 000000000..a746ab688 --- /dev/null +++ b/tapset/linux/sysc_umask.stp @@ -0,0 +1,45 @@ +# umask ______________________________________________________ +# long sys_umask(int mask) +# + +@define _SYSCALL_UMASK_NAME +%( + name = "umask" +%) + +@define _SYSCALL_UMASK_ARGSTR +%( + argstr = sprintf("%#o", mask) +%) + +probe syscall.umask = dw_syscall.umask !, nd_syscall.umask {} +probe syscall.umask.return = dw_syscall.umask.return !, nd_syscall.umask.return {} + +# dw_umask _____________________________________________________ + +probe dw_syscall.umask = kernel.function("sys_umask").call +{ + @_SYSCALL_UMASK_NAME + mask = __uint32($mask) + @_SYSCALL_UMASK_ARGSTR +} +probe dw_syscall.umask.return = kernel.function("sys_umask").return +{ + @_SYSCALL_UMASK_NAME + retstr = return_str(3, $return) +} + +# nd_umask _____________________________________________________ + +probe nd_syscall.umask = kprobe.function("sys_umask") ? +{ + @_SYSCALL_UMASK_NAME + asmlinkage() + mask = uint_arg(1) + @_SYSCALL_UMASK_ARGSTR +} +probe nd_syscall.umask.return = kprobe.function("sys_umask").return ? +{ + @_SYSCALL_UMASK_NAME + retstr = returnstr(3) +} diff --git a/tapset/linux/syscalls2.stp b/tapset/linux/syscalls2.stp index ed378549e..5d01a0942 100644 --- a/tapset/linux/syscalls2.stp +++ b/tapset/linux/syscalls2.stp @@ -1,19 +1,4 @@ -# umask ______________________________________________________ -# long sys_umask(int mask) -# -probe syscall.umask = kernel.function("sys_umask").call -{ - name = "umask" - mask = __uint32($mask) - argstr = sprintf("%#o", __uint32($mask)) -} -probe syscall.umask.return = kernel.function("sys_umask").return -{ - name = "umask" - retstr = return_str(3, $return) -} - # umount _____________________________________________________ # long sys_umount(char __user * name, int flags) # SYSCALL_DEFINE1(oldumount, char __user *, name)