]> sourceware.org Git - systemtap.git/commitdiff
PR20333/dup3
authorMartin Cermak <mcermak@redhat.com>
Thu, 22 Dec 2016 15:12:42 +0000 (16:12 +0100)
committerMartin Cermak <mcermak@redhat.com>
Thu, 22 Dec 2016 15:12:42 +0000 (16:12 +0100)
tapset/linux/nd_syscalls.stp
tapset/linux/sysc_dup3.stp [new file with mode: 0644]
tapset/linux/syscalls.stp

index ca399b4b0b4ec341b7ee2439247a3fe009fc586a..5ae19ee9a96a2e60db840ea19b83f9aba29d855a 100644 (file)
@@ -1,23 +1,4 @@
 
-# dup3 _______________________________________________________
-# SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
-probe nd_syscall.dup3 = kprobe.function("sys_dup3") ?
-{
-       @__syscall_compat_gate(@const("__NR_dup3"), @const("__NR_compat_dup3"))
-       name = "dup3";
-       asmlinkage()
-       oldfd = int_arg(1)
-       newfd = int_arg(2)
-       flags = int_arg(3)
-       argstr = sprintf("%d, %d, %s", oldfd, newfd, _dup3_flag_str(flags));
-}
-probe nd_syscall.dup3.return = kprobe.function("sys_dup3").return ?
-{
-       @__syscall_compat_gate(@const("__NR_dup3"), @const("__NR_compat_dup3"))
-       name = "dup3"
-       retstr = returnstr(1)
-}
-
 # epoll_create _______________________________________________
 # long sys_epoll_create(int size)
 # SYSCALL_DEFINE1(epoll_create1, int, flags)
diff --git a/tapset/linux/sysc_dup3.stp b/tapset/linux/sysc_dup3.stp
new file mode 100644 (file)
index 0000000..20db52e
--- /dev/null
@@ -0,0 +1,54 @@
+# dup3 _______________________________________________________
+# SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
+
+@define _SYSCALL_DUP3_NAME
+%(
+       name = "dup3";
+%)
+
+@define _SYSCALL_DUP3_ARGSTR
+%(
+       argstr = sprintf("%d, %d, %s", oldfd, newfd,  flags_str)
+%)
+
+probe syscall.dup3 = dw_syscall.dup3 !, nd_syscall.dup3 {}
+probe syscall.dup3.return = dw_syscall.dup3.return !, nd_syscall.dup3.return {}
+
+# dw_dup3 _____________________________________________________
+
+probe dw_syscall.dup3 = kernel.function("sys_dup3").call ?
+{
+       @__syscall_compat_gate(@const("__NR_dup3"), @const("__NR_compat_dup3"))
+       @_SYSCALL_DUP3_NAME
+       oldfd = __int32($oldfd)
+       newfd = __int32($newfd)
+       flags = __int32($flags)
+       flags_str = _dup3_flag_str(flags)
+       @_SYSCALL_DUP3_ARGSTR
+}
+probe dw_syscall.dup3.return = kernel.function("sys_dup3").return ?
+{
+       @__syscall_compat_gate(@const("__NR_dup3"), @const("__NR_compat_dup3"))
+       @_SYSCALL_DUP3_NAME
+       retstr = return_str(1, $return)
+}
+
+# nd_dup3 _____________________________________________________
+
+probe nd_syscall.dup3 = kprobe.function("sys_dup3") ?
+{
+       @__syscall_compat_gate(@const("__NR_dup3"), @const("__NR_compat_dup3"))
+       @_SYSCALL_DUP3_NAME
+       asmlinkage()
+       oldfd = int_arg(1)
+       newfd = int_arg(2)
+       flags = int_arg(3)
+       flags_str = _dup3_flag_str(flags)
+       @_SYSCALL_DUP3_ARGSTR
+}
+probe nd_syscall.dup3.return = kprobe.function("sys_dup3").return ?
+{
+       @__syscall_compat_gate(@const("__NR_dup3"), @const("__NR_compat_dup3"))
+       @_SYSCALL_DUP3_NAME
+       retstr = returnstr(1)
+}
index e7281c12a93cfe10188526fd4d2f159b5050853d..8cddad9c1a23fc73d2e030c8ba40334ac1b7b02b 100644 (file)
@@ -1,23 +1,4 @@
 
-# dup3 _______________________________________________________
-# SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
-probe syscall.dup3 = kernel.function("sys_dup3").call ?
-{
-       @__syscall_compat_gate(@const("__NR_dup3"), @const("__NR_compat_dup3"))
-       name = "dup3";
-       oldfd = __int32($oldfd)
-       newfd = __int32($newfd)
-       flags = __int32($flags)
-       argstr = sprintf("%d, %d, %s", __int32($oldfd), __int32($newfd),
-                        _dup3_flag_str(flags));
-}
-probe syscall.dup3.return = kernel.function("sys_dup3").return ?
-{
-       @__syscall_compat_gate(@const("__NR_dup3"), @const("__NR_compat_dup3"))
-       name = "dup3"
-       retstr = return_str(1, $return)
-}
-
 # epoll_create _______________________________________________
 # long sys_epoll_create(int size)
 # SYSCALL_DEFINE1(epoll_create1, int, flags)
This page took 0.031438 seconds and 5 git commands to generate.