]> sourceware.org Git - systemtap.git/commitdiff
PR20333/timerfd
authorMartin Cermak <mcermak@redhat.com>
Tue, 3 Jan 2017 11:55:54 +0000 (12:55 +0100)
committerMartin Cermak <mcermak@redhat.com>
Tue, 3 Jan 2017 11:55:54 +0000 (12:55 +0100)
tapset/linux/nd_syscalls2.stp
tapset/linux/sysc_timerfd.stp [new file with mode: 0644]
tapset/linux/syscalls2.stp

index db4b39e5efa70fe46bd61dd7509a5531f45fe804..849de9e8665a50c5c5ead1d1d193bb83c692d5a3 100644 (file)
@@ -1,29 +1,4 @@
 
-# timerfd ______________________________________________
-#
-# Note that timerfd() only existed between kernels 2.6.22 and 2.6.25
-# and was replaced by timerfd_create(), timerfd_gettime(),
-# and timerfd_settime().
-#
-# long sys_timerfd(int ufd, int clockid, int flags,
-#          const struct itimerspec __user *utmr)
-# long compat_sys_timerfd(int ufd, int clockid, int flags,
-#         const struct compat_itimerspec __user *utmr)
-#
-probe nd_syscall.timerfd = kprobe.function("sys_timerfd") ?,
-                           kprobe.function("compat_sys_timerfd") ?
-{
-       name = "timerfd"
-       asmlinkage()
-       argstr = sprintf("%d, %d, 0x%x", int_arg(1), int_arg(2), int_arg(3))
-}
-probe nd_syscall.timerfd.return = kprobe.function("sys_timerfd").return ?,
-                                  kprobe.function("compat_sys_timerfd").return ?
-{
-       name = "timerfd"
-       retstr = returnstr(1)
-}
-
 # timerfd_create _____________________________________________
 #
 # SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags)
diff --git a/tapset/linux/sysc_timerfd.stp b/tapset/linux/sysc_timerfd.stp
new file mode 100644 (file)
index 0000000..2adb8ae
--- /dev/null
@@ -0,0 +1,62 @@
+# timerfd ______________________________________________
+#
+# Note that timerfd() only existed between kernels 2.6.22 and 2.6.25
+# and was replaced by timerfd_create(), timerfd_gettime(),
+# and timerfd_settime().
+#
+# long sys_timerfd(int ufd, int clockid, int flags,
+#          const struct itimerspec __user *utmr)
+# long compat_sys_timerfd(int ufd, int clockid, int flags,
+#         const struct compat_itimerspec __user *utmr)
+#
+
+@define _SYSCALL_TIMERFD_NAME
+%(
+       name = "timerfd"
+%)
+
+@define _SYSCALL_TIMERFD_ARGSTR
+%(
+       argstr = sprintf("%d, %d, 0x%x", ufd, clockid, flags)
+%)
+
+probe syscall.timerfd = dw_syscall.timerfd !, nd_syscall.timerfd {}
+probe syscall.timerfd.return = dw_syscall.timerfd.return !,
+                               nd_syscall.timerfd.return {}
+
+# dw_timerfd _____________________________________________________
+
+probe dw_syscall.timerfd = kernel.function("sys_timerfd").call ?,
+                        kernel.function("compat_sys_timerfd").call ?
+{
+       @_SYSCALL_TIMERFD_NAME
+       ufd = $ufd
+       clockid = @__pointer($clockid)
+       flags = $flags
+       @_SYSCALL_TIMERFD_ARGSTR
+}
+probe dw_syscall.timerfd.return = kernel.function("sys_timerfd").return ?,
+                               kernel.function("compat_sys_timerfd").return ?
+{
+       @_SYSCALL_TIMERFD_NAME
+       retstr = return_str(1, $return)
+}
+
+# nd_timerfd _____________________________________________________
+
+probe nd_syscall.timerfd = kprobe.function("sys_timerfd") ?,
+                           kprobe.function("compat_sys_timerfd") ?
+{
+       @_SYSCALL_TIMERFD_NAME
+       asmlinkage()
+       ufd = int_arg(1)
+       clockid = int_arg(2)
+       flags = int_arg(3)
+       @_SYSCALL_TIMERFD_ARGSTR
+}
+probe nd_syscall.timerfd.return = kprobe.function("sys_timerfd").return ?,
+                                  kprobe.function("compat_sys_timerfd").return ?
+{
+       @_SYSCALL_TIMERFD_NAME
+       retstr = returnstr(1)
+}
index efab61727cb0979e5409758382d5d275944f8c09..c48397f60af3d4705242e1c9a016bb1b2e93a4d7 100644 (file)
@@ -1,28 +1,4 @@
 
-# timerfd ______________________________________________
-#
-# Note that timerfd() only existed between kernels 2.6.22 and 2.6.25
-# and was replaced by timerfd_create(), timerfd_gettime(),
-# and timerfd_settime().
-#
-# long sys_timerfd(int ufd, int clockid, int flags,
-#          const struct itimerspec __user *utmr)
-# long compat_sys_timerfd(int ufd, int clockid, int flags,
-#         const struct compat_itimerspec __user *utmr)
-#
-probe syscall.timerfd = kernel.function("sys_timerfd").call ?,
-                        kernel.function("compat_sys_timerfd").call ?
-{
-       name = "timerfd"
-       argstr = sprintf("%d, %d, 0x%x", $ufd, @__pointer($clockid), $flags)
-}
-probe syscall.timerfd.return = kernel.function("sys_timerfd").return ?,
-                               kernel.function("compat_sys_timerfd").return ?
-{
-       name = "timerfd"
-       retstr = return_str(1, $return)
-}
-
 # timerfd_create _____________________________________________
 #
 # SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags)
This page took 0.029852 seconds and 5 git commands to generate.