]> sourceware.org Git - systemtap.git/commitdiff
Merge syscall.pipe and syscall.pipe2 to get around "nesting".
authorMark Wielaard <mjw@redhat.com>
Fri, 19 Mar 2010 15:53:19 +0000 (16:53 +0100)
committerMark Wielaard <mjw@redhat.com>
Fri, 19 Mar 2010 15:53:19 +0000 (16:53 +0100)
* tapset/syscalls2.stp (syscall.pipe[2][.return]): Merge into syscall.pipe
  and syscall.pipe.return. Set name according to flags.

tapset/syscalls2.stp

index efe1d744c95b53d938ccfbe0d6343e1126a377f5..93ca2c276b7ee9968ef3617baad477484c15383c 100644 (file)
@@ -291,11 +291,19 @@ probe syscall.personality.return = kernel.function("SyS_personality").return !,
 # asmlinkage int
 # sys_pipe(unsigned long __user * fildes)
 #
-probe syscall.pipe = kernel.function("SyS_pipe").call !,
+# SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
+# pipe2() was added to Linux in version 2.6.27.
+probe syscall.pipe = kernel.function("SyS_pipe2").call !,
+                     kernel.function("sys_pipe2").call !,
+                     kernel.function("SyS_pipe").call !,
                      kernel.function("sys_ia64_pipe").call ?,
                      kernel.function("sys_pipe").call
 {
-       name = "pipe"
+       if (@defined($flags)) {
+               flags = $flags
+               flag_str = _sys_pipe2_flag_str(flags);
+       }
+       name = flags == 0 ? "pipe" : "pipe2";
        if (@defined($fildes)) {
                fildes_uaddr = $fildes
                if (fildes_uaddr == 0) {
@@ -305,7 +313,12 @@ probe syscall.pipe = kernel.function("SyS_pipe").call !,
                } else {
                        pipe0 = user_int(&$fildes[0]);
                        pipe1 = user_int(&$fildes[1]);
-                       argstr = sprintf("[%d, %d]", pipe0, pipe1)
+                       if (flags == 0)
+                               argstr = sprintf("[%d, %d]", pipe0, pipe1);
+                       else
+                               argstr = sprintf("[%d, %d], %s",
+                                                pipe0, pipe1, flag_str);
+
                }
        } else {
                fildes_uaddr = 0;
@@ -314,13 +327,17 @@ probe syscall.pipe = kernel.function("SyS_pipe").call !,
                argstr = "";
        }
 }
-probe syscall.pipe.return = kernel.function("SyS_pipe").return !,
-%( arch == "ia64" %?
+probe syscall.pipe.return = kernel.function("SyS_pipe2").return !,
+                            kernel.function("sys_pipe2").return !,
+                            kernel.function("SyS_pipe").return !,
                             kernel.function("sys_ia64_pipe").return ?,
-%)
                             kernel.function("sys_pipe").return
 {
-       name = "pipe"
+       if (@defined($flags)) {
+               flags = $flags
+               flag_str = _sys_pipe2_flag_str(flags);
+       }
+       name = flags == 0 ? "pipe" : "pipe2";
        if (@defined($fildes)) {
                fildes_uaddr = $fildes
                if (fildes_uaddr == 0) {
@@ -338,40 +355,6 @@ probe syscall.pipe.return = kernel.function("SyS_pipe").return !,
        retstr = returnstr(1)
 }
 
-# pipe2 ______________________________________________________
-#
-# SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
-# pipe2() was added to Linux in version 2.6.27.
-probe syscall.pipe2 = kernel.function("sys_pipe2").call?
-{
-       name = "pipe2"
-       flags = $flags
-       flag_str = _sys_pipe2_flag_str(flags);
-       fildes_uaddr = $fildes
-       if (fildes_uaddr == 0) {
-               pipe0 = 0;
-               pipe1 = 0;
-               argstr = "NULL"
-       } else {
-               pipe0 = user_int(&$fildes[0]);
-               pipe1 = user_int(&$fildes[1]);
-               argstr = sprintf("[%d, %d] %s", pipe0, pipe1, flag_str)
-       }
-}
-probe syscall.pipe2.return = kernel.function("sys_pipe2").return?
-{
-       name = "pipe"
-       fildes_uaddr = $fildes
-       if (fildes_uaddr == 0) {
-               pipe0 = 0;
-               pipe1 = 0;
-       } else {
-               pipe0 = user_int(&$fildes[0]);
-               pipe1 = user_int(&$fildes[1]);
-       }
-       retstr = returnstr(1)
-}
-
 # pivot_root _________________________________________________
 #
 # long sys_pivot_root(const char __user *new_root, const char __user *put_old)
This page took 0.036324 seconds and 5 git commands to generate.