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

index 10c536f75a092b568fcbc5ac3fde755a5d6c2c2b..0af78e097bc8b9ff036b6d2124cfda3b1a979018 100644 (file)
@@ -1,49 +1,4 @@
 
-# timer_create _______________________________________________
-#
-# long sys_timer_create(clockid_t which_clock,
-#                      struct sigevent __user *timer_event_spec,
-#                      timer_t __user * created_timer_id)
-# long compat_sys_timer_create(clockid_t which_clock,
-#                      struct sigevent __user *timer_event_spec,
-#                      timer_t __user * created_timer_id)
-#
-probe nd_syscall.timer_create = __nd_syscall.timer_create,
-                                __nd_syscall.compat_timer_create ?
-{
-       name = "timer_create"
-}
-probe __nd_syscall.timer_create = kprobe.function("sys_timer_create")
-{
-       @__syscall_gate(@const("__NR_timer_create"))
-       asmlinkage()
-       clockid = int_arg(1)
-       clockid_str = _get_wc_str(clockid)
-       evp_uaddr = pointer_arg(2)
-       timerid_uaddr = pointer_arg(3)
-       argstr = sprintf("%s, %p, %p", clockid_str, evp_uaddr, timerid_uaddr)
-}
-probe __nd_syscall.compat_timer_create = kprobe.function("compat_sys_timer_create") ?
-{
-       asmlinkage()
-       clockid = int_arg(1)
-       clockid_str = _get_wc_str(clockid)
-       evp_uaddr = pointer_arg(2)
-       timerid_uaddr = pointer_arg(3)
-       argstr = sprintf("%s, %p, %p", clockid_str, evp_uaddr, timerid_uaddr)
-}
-probe nd_syscall.timer_create.return =
-       __nd_syscall.timer_create.return,
-       kprobe.function("compat_sys_timer_create").return ?
-{
-       name = "timer_create"
-       retstr = returnstr(1)
-}
-probe __nd_syscall.timer_create.return = kprobe.function("sys_timer_create").return
-{
-       @__syscall_gate(@const("__NR_timer_create"))
-}
-
 # timer_delete _______________________________________________
 #
 # long sys_timer_delete(timer_t timer_id)
diff --git a/tapset/linux/sysc_timer_create.stp b/tapset/linux/sysc_timer_create.stp
new file mode 100644 (file)
index 0000000..3ed6fe6
--- /dev/null
@@ -0,0 +1,89 @@
+# timer_create _______________________________________________
+#
+# long sys_timer_create(clockid_t which_clock,
+#                      struct sigevent __user *timer_event_spec,
+#                      timer_t __user * created_timer_id)
+# long compat_sys_timer_create(clockid_t which_clock,
+#                      struct sigevent __user *timer_event_spec,
+#                      timer_t __user * created_timer_id)
+#
+
+@define _SYSCALL_TIMER_CREATE_NAME
+%(
+       name = "timer_create"
+%)
+
+@define _SYSCALL_TIMER_CREATE_ARGSTR
+%(
+       argstr = sprintf("%s, %p, %p", clockid_str, evp_uaddr, timerid_uaddr)
+%)
+
+probe syscall.timer_create = dw_syscall.timer_create !, nd_syscall.timer_create {}
+probe syscall.timer_create.return = dw_syscall.timer_create.return !,
+                                    nd_syscall.timer_create.return {}
+
+# dw_timer_create _____________________________________________________
+
+probe dw_syscall.timer_create = __syscall.timer_create,
+                             kernel.function("compat_sys_timer_create").call ?
+{
+       @_SYSCALL_TIMER_CREATE_NAME
+       clockid = __int32($which_clock)
+       clockid_str = _get_wc_str(__int32($which_clock))
+       evp_uaddr = $timer_event_spec
+       timerid_uaddr = $created_timer_id
+       @_SYSCALL_TIMER_CREATE_ARGSTR
+}
+probe __syscall.timer_create = kernel.function("sys_timer_create").call
+{
+       @__syscall_gate(@const("__NR_timer_create"))
+}
+probe dw_syscall.timer_create.return =
+       __syscall.timer_create.return,
+       kernel.function("compat_sys_timer_create").return ?
+{
+       @_SYSCALL_TIMER_CREATE_NAME
+       retstr = return_str(1, $return)
+}
+probe __syscall.timer_create.return = kernel.function("sys_timer_create").return
+{
+       @__syscall_gate(@const("__NR_timer_create"))
+}
+
+# nd_timer_create _____________________________________________________
+
+probe nd_syscall.timer_create = __nd_syscall.timer_create,
+                                __nd_syscall.compat_timer_create ?
+{
+       @_SYSCALL_TIMER_CREATE_NAME
+}
+probe __nd_syscall.timer_create = kprobe.function("sys_timer_create")
+{
+       @__syscall_gate(@const("__NR_timer_create"))
+       asmlinkage()
+       clockid = int_arg(1)
+       clockid_str = _get_wc_str(clockid)
+       evp_uaddr = pointer_arg(2)
+       timerid_uaddr = pointer_arg(3)
+       @_SYSCALL_TIMER_CREATE_ARGSTR
+}
+probe __nd_syscall.compat_timer_create = kprobe.function("compat_sys_timer_create") ?
+{
+       asmlinkage()
+       clockid = int_arg(1)
+       clockid_str = _get_wc_str(clockid)
+       evp_uaddr = pointer_arg(2)
+       timerid_uaddr = pointer_arg(3)
+       @_SYSCALL_TIMER_CREATE_ARGSTR
+}
+probe nd_syscall.timer_create.return =
+       __nd_syscall.timer_create.return,
+       kprobe.function("compat_sys_timer_create").return ?
+{
+       @_SYSCALL_TIMER_CREATE_NAME
+       retstr = returnstr(1)
+}
+probe __nd_syscall.timer_create.return = kprobe.function("sys_timer_create").return
+{
+       @__syscall_gate(@const("__NR_timer_create"))
+}
index d651014835b2d9e1b2da5126979bcc53298878ae..83d5b601ecdeb4107ac1b95438fa2e13534625c2 100644 (file)
@@ -1,39 +1,4 @@
 
-# timer_create _______________________________________________
-#
-# long sys_timer_create(clockid_t which_clock,
-#                      struct sigevent __user *timer_event_spec,
-#                      timer_t __user * created_timer_id)
-# long compat_sys_timer_create(clockid_t which_clock,
-#                      struct sigevent __user *timer_event_spec,
-#                      timer_t __user * created_timer_id)
-#
-probe syscall.timer_create = __syscall.timer_create,
-                             kernel.function("compat_sys_timer_create").call ?
-{
-       name = "timer_create"
-       clockid = __int32($which_clock)
-       clockid_str = _get_wc_str(__int32($which_clock))
-       evp_uaddr = $timer_event_spec
-       timerid_uaddr = $created_timer_id
-       argstr = sprintf("%s, %p, %p", clockid_str, $timer_event_spec, $created_timer_id)
-}
-probe __syscall.timer_create = kernel.function("sys_timer_create").call
-{
-       @__syscall_gate(@const("__NR_timer_create"))
-}
-probe syscall.timer_create.return =
-       __syscall.timer_create.return,
-       kernel.function("compat_sys_timer_create").return ?
-{
-       name = "timer_create"
-       retstr = return_str(1, $return)
-}
-probe __syscall.timer_create.return = kernel.function("sys_timer_create").return
-{
-       @__syscall_gate(@const("__NR_timer_create"))
-}
-
 # timer_delete _______________________________________________
 #
 # long sys_timer_delete(timer_t timer_id)
This page took 0.031701 seconds and 5 git commands to generate.