]> sourceware.org Git - systemtap.git/commitdiff
PR20333/clock_gettime
authorMartin Cermak <mcermak@redhat.com>
Thu, 22 Dec 2016 13:49:22 +0000 (14:49 +0100)
committerMartin Cermak <mcermak@redhat.com>
Thu, 22 Dec 2016 13:49:22 +0000 (14:49 +0100)
tapset/linux/nd_syscalls.stp
tapset/linux/sysc_clock_gettime.stp [new file with mode: 0644]
tapset/linux/syscalls.stp

index 934addcfd0f5e744a5e44d6542e0126c45c1c54a..ad9eab15351e944016e7c50f99ccab769855aba8 100644 (file)
@@ -1,33 +1,4 @@
 
-# clock_gettime ______________________________________________
-# long sys_clock_gettime(clockid_t which_clock, struct timespec __user *tp)
-#
-probe nd_syscall.clock_gettime = __nd_syscall.clock_gettime,
-       kprobe.function("compat_sys_clock_gettime") ?
-{
-       name = "clock_gettime"
-       asmlinkage()
-       clk_id = int_arg(1)
-       clk_id_str = _get_wc_str(clk_id)
-       tp_uaddr = pointer_arg(2)
-       argstr = sprintf("%s, %p", clk_id_str, tp_uaddr)
-}
-probe __nd_syscall.clock_gettime = kprobe.function("sys_clock_gettime").call
-{
-       @__syscall_gate(@const("__NR_clock_gettime"))
-}
-probe nd_syscall.clock_gettime.return = __nd_syscall.clock_gettime.return, 
-       kprobe.function("compat_sys_clock_gettime").return ?
-{
-       name = "clock_gettime"
-       retstr = returnstr(1)
-}
-probe __nd_syscall.clock_gettime.return =
-       kprobe.function("sys_clock_gettime").return
-{
-       @__syscall_gate(@const("__NR_clock_gettime"))
-}
-
 # clock_nanosleep ____________________________________________
 # long sys_clock_nanosleep(clockid_t which_clock,
 #                     int flags,
diff --git a/tapset/linux/sysc_clock_gettime.stp b/tapset/linux/sysc_clock_gettime.stp
new file mode 100644 (file)
index 0000000..fa28932
--- /dev/null
@@ -0,0 +1,71 @@
+# clock_gettime ______________________________________________
+# long sys_clock_gettime(clockid_t which_clock, struct timespec __user *tp)
+#
+
+@define _SYSCALL_CLOCK_GETTIME_NAME
+%(
+       name = "clock_gettime"
+%)
+
+@define _SYSCALL_CLOCK_GETTIME_ARGSTR
+%(
+       argstr = sprintf("%s, %p", clk_id_str, tp_uaddr)
+%)
+
+probe syscall.clock_gettime = dw_syscall.clock_gettime !, nd_syscall.clock_gettime {}
+probe syscall.clock_gettime.return = dw_syscall.clock_gettime.return !, nd_syscall.clock_gettime.return {}
+
+# dw_clock_gettime _____________________________________________________
+
+probe dw_syscall.clock_gettime = __syscall.clock_gettime,
+       kernel.function("compat_sys_clock_gettime").call ?
+{
+       @_SYSCALL_CLOCK_GETTIME_NAME
+       clk_id = __int32($which_clock)
+       clk_id_str = _get_wc_str(__int32($which_clock))
+       tp_uaddr = $tp
+       @_SYSCALL_CLOCK_GETTIME_ARGSTR
+}
+probe __syscall.clock_gettime = kernel.function("sys_clock_gettime").call
+{
+       @__syscall_gate(@const("__NR_clock_gettime"))
+}
+probe dw_syscall.clock_gettime.return = __syscall.clock_gettime.return,
+       kernel.function("compat_sys_clock_gettime").return ?
+{
+       @_SYSCALL_CLOCK_GETTIME_NAME
+       retstr = return_str(1, $return)
+}
+probe __syscall.clock_gettime.return =
+       kernel.function("sys_clock_gettime").return
+{
+       @__syscall_gate(@const("__NR_clock_gettime"))
+}
+
+# nd_clock_gettime _____________________________________________________
+
+probe nd_syscall.clock_gettime = __nd_syscall.clock_gettime,
+       kprobe.function("compat_sys_clock_gettime") ?
+{
+       @_SYSCALL_CLOCK_GETTIME_NAME
+       asmlinkage()
+       clk_id = int_arg(1)
+       clk_id_str = _get_wc_str(clk_id)
+       tp_uaddr = pointer_arg(2)
+       @_SYSCALL_CLOCK_GETTIME_ARGSTR
+}
+probe __nd_syscall.clock_gettime = kprobe.function("sys_clock_gettime").call
+{
+       @__syscall_gate(@const("__NR_clock_gettime"))
+}
+probe nd_syscall.clock_gettime.return = __nd_syscall.clock_gettime.return,
+       kprobe.function("compat_sys_clock_gettime").return ?
+{
+       @_SYSCALL_CLOCK_GETTIME_NAME
+       retstr = returnstr(1)
+}
+probe __nd_syscall.clock_gettime.return =
+       kprobe.function("sys_clock_gettime").return
+{
+       @__syscall_gate(@const("__NR_clock_gettime"))
+}
index 73b94b45a7f9196dd3f327b10cf73d9685a9af8f..3be149beaa928b86b51ceadf4c4ef2d845a3f3a7 100644 (file)
@@ -1,32 +1,4 @@
 
-# clock_gettime ______________________________________________
-# long sys_clock_gettime(clockid_t which_clock, struct timespec __user *tp)
-#
-probe syscall.clock_gettime = __syscall.clock_gettime,
-       kernel.function("compat_sys_clock_gettime").call ?
-{
-       name = "clock_gettime"
-       clk_id = __int32($which_clock)
-       clk_id_str = _get_wc_str(__int32($which_clock))
-       tp_uaddr = $tp
-       argstr = sprintf("%s, %p", _get_wc_str(__int32($which_clock)), $tp)
-}
-probe __syscall.clock_gettime = kernel.function("sys_clock_gettime").call
-{
-       @__syscall_gate(@const("__NR_clock_gettime"))
-}
-probe syscall.clock_gettime.return = __syscall.clock_gettime.return, 
-       kernel.function("compat_sys_clock_gettime").return ?
-{
-       name = "clock_gettime"
-       retstr = return_str(1, $return)
-}
-probe __syscall.clock_gettime.return =
-       kernel.function("sys_clock_gettime").return
-{
-       @__syscall_gate(@const("__NR_clock_gettime"))
-}
-
 # clock_nanosleep ____________________________________________
 # long sys_clock_nanosleep(clockid_t which_clock,
 #                     int flags,
This page took 0.033869 seconds and 5 git commands to generate.