]> sourceware.org Git - systemtap.git/commitdiff
PR20333/gettimeofday
authorMartin Cermak <mcermak@redhat.com>
Fri, 23 Dec 2016 15:58:25 +0000 (16:58 +0100)
committerMartin Cermak <mcermak@redhat.com>
Fri, 23 Dec 2016 15:58:25 +0000 (16:58 +0100)
tapset/linux/nd_syscalls.stp
tapset/linux/sysc_gettimeofday.stp [new file with mode: 0644]
tapset/linux/syscalls.stp

index 7916da1f06036bbfba34a3a71eca6c9d8a5c72c9..e885ec632d5270dfdf6c5545def19e4d00103cac 100644 (file)
@@ -1,30 +1,4 @@
 
-# gettimeofday _______________________________________________
-# long sys_gettimeofday(struct timeval  __user *tv,
-#      struct timezone __user *tz)
-# long sys32_gettimeofday(struct compat_timeval __user *tv,
-#      struct timezone __user *tz)
-# long compat_sys_gettimeofday(struct compat_timeval __user *tv,
-#      struct timezone __user *tz)
-probe nd_syscall.gettimeofday = kprobe.function("compat_sys_gettimeofday") ?,
-                                kprobe.function("sys32_gettimeofday") ?,
-                                kprobe.function("sys_gettimeofday") ?
-{
-       name = "gettimeofday"
-       asmlinkage()
-       tv_uaddr = pointer_arg(1)
-       tz_uaddr = pointer_arg(2)
-       argstr = sprintf("%p, %p", tv_uaddr, tz_uaddr)
-}
-
-probe nd_syscall.gettimeofday.return = kprobe.function("compat_sys_gettimeofday").return ?,
-                                       kprobe.function("sys32_gettimeofday").return ?,
-                                       kprobe.function("sys_gettimeofday").return ?
-{
-       name = "gettimeofday"
-       retstr = returnstr(1)
-}
-
 # getuid _____________________________________________________
 # long sys_getuid(void
 # long sys_getuid16(void)
diff --git a/tapset/linux/sysc_gettimeofday.stp b/tapset/linux/sysc_gettimeofday.stp
new file mode 100644 (file)
index 0000000..1c3cc46
--- /dev/null
@@ -0,0 +1,61 @@
+# gettimeofday _______________________________________________
+# long sys_gettimeofday(struct timeval  __user *tv,
+#      struct timezone __user *tz)
+# long sys32_gettimeofday(struct compat_timeval __user *tv,
+#      struct timezone __user *tz)
+# long compat_sys_gettimeofday(struct compat_timeval __user *tv,
+#      struct timezone __user *tz)
+
+@define _SYSCALL_GETTIMEOFDAY_NAME
+%(
+       name = "gettimeofday"
+%)
+
+@define _SYSCALL_GETTIMEOFDAY_ARGSTR
+%(
+       argstr = sprintf("%p, %p", tv_uaddr, tz_uaddr)
+%)
+
+probe syscall.gettimeofday = dw_syscall.gettimeofday !, nd_syscall.gettimeofday {}
+probe syscall.gettimeofday.return = dw_syscall.gettimeofday.return !, nd_syscall.gettimeofday.return {}
+
+# dw_gettimeofday _____________________________________________________
+
+probe dw_syscall.gettimeofday = kernel.function("compat_sys_gettimeofday").call ?,
+                             kernel.function("sys32_gettimeofday").call ?,
+                             kernel.function("sys_gettimeofday").call
+{
+       @_SYSCALL_GETTIMEOFDAY_NAME
+       tv_uaddr = $tv
+       tz_uaddr = $tz
+       @_SYSCALL_GETTIMEOFDAY_ARGSTR
+}
+
+probe dw_syscall.gettimeofday.return = kernel.function("compat_sys_gettimeofday").return ?,
+                                    kernel.function("sys32_gettimeofday").return ?,
+                                    kernel.function("sys_gettimeofday").return
+{
+       @_SYSCALL_GETTIMEOFDAY_NAME
+       retstr = return_str(1, $return)
+}
+
+# nd_gettimeofday _____________________________________________________
+
+probe nd_syscall.gettimeofday = kprobe.function("compat_sys_gettimeofday") ?,
+                                kprobe.function("sys32_gettimeofday") ?,
+                                kprobe.function("sys_gettimeofday") ?
+{
+       @_SYSCALL_GETTIMEOFDAY_NAME
+       asmlinkage()
+       tv_uaddr = pointer_arg(1)
+       tz_uaddr = pointer_arg(2)
+       @_SYSCALL_GETTIMEOFDAY_ARGSTR
+}
+
+probe nd_syscall.gettimeofday.return = kprobe.function("compat_sys_gettimeofday").return ?,
+                                       kprobe.function("sys32_gettimeofday").return ?,
+                                       kprobe.function("sys_gettimeofday").return ?
+{
+       @_SYSCALL_GETTIMEOFDAY_NAME
+       retstr = returnstr(1)
+}
index 17cba6ebb498a9da8735f532a38c17527d5332f0..9f059a5a77ad7c24861942f4379abf0bee329148 100644 (file)
@@ -1,29 +1,4 @@
 
-# gettimeofday _______________________________________________
-# long sys_gettimeofday(struct timeval  __user *tv,
-#      struct timezone __user *tz)
-# long sys32_gettimeofday(struct compat_timeval __user *tv,
-#      struct timezone __user *tz)
-# long compat_sys_gettimeofday(struct compat_timeval __user *tv,
-#      struct timezone __user *tz)
-probe syscall.gettimeofday = kernel.function("compat_sys_gettimeofday").call ?,
-                             kernel.function("sys32_gettimeofday").call ?,
-                             kernel.function("sys_gettimeofday").call
-{
-       name = "gettimeofday"
-       tv_uaddr = $tv
-       tz_uaddr = $tz
-       argstr = sprintf("%p, %p", $tv, $tz)
-}
-
-probe syscall.gettimeofday.return = kernel.function("compat_sys_gettimeofday").return ?,
-                                    kernel.function("sys32_gettimeofday").return ?,
-                                    kernel.function("sys_gettimeofday").return
-{
-       name = "gettimeofday"
-       retstr = return_str(1, $return)
-}
-
 # getuid _____________________________________________________
 # long sys_getuid(void
 # long sys_getuid16(void)
This page took 0.032858 seconds and 5 git commands to generate.