]> sourceware.org Git - systemtap.git/commitdiff
PR20333/mkdir
authorMartin Cermak <mcermak@redhat.com>
Mon, 2 Jan 2017 05:56:42 +0000 (06:56 +0100)
committerMartin Cermak <mcermak@redhat.com>
Mon, 2 Jan 2017 05:56:42 +0000 (06:56 +0100)
tapset/linux/nd_syscalls.stp
tapset/linux/sysc_mkdir.stp [new file with mode: 0644]
tapset/linux/syscalls.stp

index 3550ac148ca1195f5b1942b55fff8f00663b796f..5673c0493026ccd44ab038abe2de190556256e95 100644 (file)
@@ -1,21 +1,4 @@
 
-# mkdir ______________________________________________________
-# long sys_mkdir(const char __user * pathname, int mode)
-probe nd_syscall.mkdir = kprobe.function("sys_mkdir") ?
-{
-       name = "mkdir"
-       asmlinkage()
-       pathname_uaddr = pointer_arg(1)
-       pathname = user_string_quoted(pathname_uaddr)
-       mode = uint_arg(2)
-       argstr = sprintf("%s, %#o", user_string_quoted(pathname_uaddr), mode)
-}
-probe nd_syscall.mkdir.return = kprobe.function("sys_mkdir").return ?
-{
-       name = "mkdir"
-       retstr = returnstr(1)
-}
-
 # mkdirat ____________________________________________________
 # new function with 2.6.16
 # long sys_mkdirat(int dfd, const char __user *pathname, int mode)
diff --git a/tapset/linux/sysc_mkdir.stp b/tapset/linux/sysc_mkdir.stp
new file mode 100644 (file)
index 0000000..23a34d3
--- /dev/null
@@ -0,0 +1,48 @@
+# mkdir ______________________________________________________
+# long sys_mkdir(const char __user * pathname, int mode)
+
+@define _SYSCALL_MKDIR_NAME
+%(
+       name = "mkdir"
+%)
+
+@define _SYSCALL_MKDIR_ARGSTR
+%(
+       argstr = sprintf("%s, %#o", pathname, mode)
+%)
+
+probe syscall.mkdir = dw_syscall.mkdir !, nd_syscall.mkdir {}
+probe syscall.mkdir.return = dw_syscall.mkdir.return !, nd_syscall.mkdir.return {}
+
+# dw_mkdir _____________________________________________________
+
+probe dw_syscall.mkdir = kernel.function("sys_mkdir").call
+{
+       @_SYSCALL_MKDIR_NAME
+       pathname_uaddr = $pathname
+       pathname = user_string_quoted($pathname)
+       mode = __uint32($mode)
+       @_SYSCALL_MKDIR_ARGSTR
+}
+probe dw_syscall.mkdir.return = kernel.function("sys_mkdir").return
+{
+       @_SYSCALL_MKDIR_NAME
+       retstr = return_str(1, $return)
+}
+
+# nd_mkdir _____________________________________________________
+
+probe nd_syscall.mkdir = kprobe.function("sys_mkdir") ?
+{
+       @_SYSCALL_MKDIR_NAME
+       asmlinkage()
+       pathname_uaddr = pointer_arg(1)
+       pathname = user_string_quoted(pathname_uaddr)
+       mode = uint_arg(2)
+       @_SYSCALL_MKDIR_ARGSTR
+}
+probe nd_syscall.mkdir.return = kprobe.function("sys_mkdir").return ?
+{
+       @_SYSCALL_MKDIR_NAME
+       retstr = returnstr(1)
+}
index 24261e054f04b75d52dcba2d5194dd06ef8e9c12..e601ec1fc6ac0eafa4e265054e497840831fe5aa 100644 (file)
@@ -1,21 +1,4 @@
 
-# mkdir ______________________________________________________
-# long sys_mkdir(const char __user * pathname, int mode)
-probe syscall.mkdir = kernel.function("sys_mkdir").call
-{
-       name = "mkdir"
-       pathname_uaddr = $pathname
-       pathname = user_string_quoted($pathname)
-       mode = __uint32($mode)
-       argstr = sprintf("%s, %#o", user_string_quoted($pathname),
-                        __uint32($mode))
-}
-probe syscall.mkdir.return = kernel.function("sys_mkdir").return
-{
-       name = "mkdir"
-       retstr = return_str(1, $return)
-}
-
 # mkdirat ____________________________________________________
 # new function with 2.6.16
 # long sys_mkdirat(int dfd, const char __user *pathname, int mode)
This page took 0.031624 seconds and 5 git commands to generate.