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

index 77f2ac6b731bbac52fe7274b155f3cb8bf01e314..8541cc8bbf7323611f8165cd16e25e7dff0293f7 100644 (file)
@@ -1,31 +1,4 @@
 
-# getdents ___________________________________________________
-# long sys_getdents(unsigned int fd, struct linux_dirent __user * dirent, unsigned int count)
-# long compat_sys_getdents(unsigned int fd, struct compat_linux_dirent __user *dirent, unsigned int count)
-# long sys_getdents64(unsigned int fd, struct linux_dirent64 __user * dirent, unsigned int count)
-# long compat_sys_getdents64(unsigned int fd, struct linux_dirent64 __user * dirent, unsigned int count)
-#
-probe nd_syscall.getdents = kprobe.function("sys_getdents") ?,
-                            kprobe.function("sys_getdents64") ?,
-                            kprobe.function("compat_sys_getdents") ?,
-                            kprobe.function("compat_sys_getdents64") ?
-{
-       name = "getdents"
-       asmlinkage()
-       fd = int_arg(1)
-       dirp_uaddr = pointer_arg(2)
-       count = uint_arg(3)
-       argstr = sprintf("%d, %p, %d", fd, dirp_uaddr, count)
-}
-probe nd_syscall.getdents.return = kprobe.function("sys_getdents").return ?,
-                                   kprobe.function("sys_getdents64").return ?,
-                                   kprobe.function("compat_sys_getdents").return ?,
-                                   kprobe.function("compat_sys_getdents64").return ?
-{
-       name = "getdents"
-       retstr = returnstr(1)
-}
-
 # getegid ____________________________________________________
 # long sys_getegid(void)
 # long sys_getegid16(void)
diff --git a/tapset/linux/sysc_getdents.stp b/tapset/linux/sysc_getdents.stp
new file mode 100644 (file)
index 0000000..ece948d
--- /dev/null
@@ -0,0 +1,64 @@
+# getdents ___________________________________________________
+# long sys_getdents(unsigned int fd, struct linux_dirent __user * dirent, unsigned int count)
+# long compat_sys_getdents(unsigned int fd, struct compat_linux_dirent __user *dirent, unsigned int count)
+# long sys_getdents64(unsigned int fd, struct linux_dirent64 __user * dirent, unsigned int count)
+# long compat_sys_getdents64(unsigned int fd, struct linux_dirent64 __user * dirent, unsigned int count)
+#
+
+@define _SYSCALL_GETDENTS_NAME
+%(
+       name = "getdents"
+%)
+
+@define _SYSCALL_GETDENTS_ARGSTR
+%(
+       argstr = sprintf("%d, %p, %d", fd, dirp_uaddr, count)
+%)
+
+probe syscall.getdents = dw_syscall.getdents !, nd_syscall.getdents {}
+probe syscall.getdents.return = dw_syscall.getdents.return !, nd_syscall.getdents.return {}
+
+# dw_getdents _____________________________________________________
+
+probe dw_syscall.getdents = kernel.function("sys_getdents").call ?,
+                         kernel.function("sys_getdents64").call ?,
+                         kernel.function("compat_sys_getdents").call ?,
+                         kernel.function("compat_sys_getdents64").call ?
+{
+       @_SYSCALL_GETDENTS_NAME
+       fd = __int32($fd)
+       dirp_uaddr = $dirent
+       count = __uint32($count)
+       @_SYSCALL_GETDENTS_ARGSTR
+}
+probe dw_syscall.getdents.return = kernel.function("sys_getdents").return ?,
+                                kernel.function("sys_getdents64").return ?,
+                                kernel.function("compat_sys_getdents").return ?,
+                                kernel.function("compat_sys_getdents64").return ?
+{
+       @_SYSCALL_GETDENTS_NAME
+       retstr = return_str(1, $return)
+}
+
+# nd_getdents _____________________________________________________
+
+probe nd_syscall.getdents = kprobe.function("sys_getdents") ?,
+                            kprobe.function("sys_getdents64") ?,
+                            kprobe.function("compat_sys_getdents") ?,
+                            kprobe.function("compat_sys_getdents64") ?
+{
+       @_SYSCALL_GETDENTS_NAME
+       asmlinkage()
+       fd = int_arg(1)
+       dirp_uaddr = pointer_arg(2)
+       count = uint_arg(3)
+       @_SYSCALL_GETDENTS_ARGSTR
+}
+probe nd_syscall.getdents.return = kprobe.function("sys_getdents").return ?,
+                                   kprobe.function("sys_getdents64").return ?,
+                                   kprobe.function("compat_sys_getdents").return ?,
+                                   kprobe.function("compat_sys_getdents64").return ?
+{
+       @_SYSCALL_GETDENTS_NAME
+       retstr = returnstr(1)
+}
index 14ab2854b48441eab5354e2384e4222729fa61fe..ab39c08a9c25a57925f297908586f6f56600475b 100644 (file)
@@ -1,30 +1,4 @@
 
-# getdents ___________________________________________________
-# long sys_getdents(unsigned int fd, struct linux_dirent __user * dirent, unsigned int count)
-# long compat_sys_getdents(unsigned int fd, struct compat_linux_dirent __user *dirent, unsigned int count)
-# long sys_getdents64(unsigned int fd, struct linux_dirent64 __user * dirent, unsigned int count)
-# long compat_sys_getdents64(unsigned int fd, struct linux_dirent64 __user * dirent, unsigned int count)
-#
-probe syscall.getdents = kernel.function("sys_getdents").call ?,
-                         kernel.function("sys_getdents64").call ?,
-                         kernel.function("compat_sys_getdents").call ?,
-                         kernel.function("compat_sys_getdents64").call ?
-{
-       name = "getdents"
-       fd = __int32($fd)
-       dirp_uaddr = $dirent
-       count = __uint32($count)
-       argstr = sprintf("%d, %p, %u", fd, $dirent, count)
-}
-probe syscall.getdents.return = kernel.function("sys_getdents").return ?,
-                                kernel.function("sys_getdents64").return ?,
-                                kernel.function("compat_sys_getdents").return ?,
-                                kernel.function("compat_sys_getdents64").return ?
-{
-       name = "getdents"
-       retstr = return_str(1, $return)
-}
-
 # getegid ____________________________________________________
 # long sys_getegid(void)
 # long sys_getegid16(void)
This page took 0.030052 seconds and 5 git commands to generate.