summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2010-03-19 11:55:57 +0100
committerMark Wielaard <mjw@redhat.com>2010-03-19 13:20:56 +0100
commit58ea0457e185e7cbea71c16d88dfa43a3196f803 (patch)
treef05edb0859e79c201ffdc63c589d88af852e5ed9
parent7189a12dcef9b1c515e052f9d8a53e53a8d58b73 (diff)
downloadsystemtap-steved-58ea0457e185e7cbea71c16d88dfa43a3196f803.tar.gz
systemtap-steved-58ea0457e185e7cbea71c16d88dfa43a3196f803.tar.xz
systemtap-steved-58ea0457e185e7cbea71c16d88dfa43a3196f803.zip
Make pipe file descriptors available in syscall.pipe[.return].
The actual value of the pipe file descriptors can be interesting, especially in the syscall.pipe.return probe. This can be done without any embedded C now using @cast. So don't use _fildes_u() anymore. _fildes_u in aux_syscall.stp is still retained because it is used in nd_syscalls2.stp for pipe. * tapset/syscalls2.stp (syscall.pipe, syscall.pipe.return): Add pipe1 pipe2 convenience variables. Don't use _fildes_u for argstr anymore.
-rw-r--r--tapset/syscalls2.stp35
1 files changed, 34 insertions, 1 deletions
diff --git a/tapset/syscalls2.stp b/tapset/syscalls2.stp
index aba4be51..38f850f0 100644
--- a/tapset/syscalls2.stp
+++ b/tapset/syscalls2.stp
@@ -299,11 +299,24 @@ probe syscall.pipe = kernel.function("SyS_pipe").call !,
if (@defined($fildes))
{
fildes_uaddr = $fildes
- argstr = _fildes_u(fildes_uaddr)
+ 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]", pipe0, pipe1)
+ }
}
else
{
fildes_uaddr = 0;
+ pipe0 = 0;
+ pipe1 = 0;
argstr = ""
}
}
@@ -314,6 +327,26 @@ probe syscall.pipe.return = kernel.function("SyS_pipe").return !,
kernel.function("sys_pipe").return
{
name = "pipe"
+ if (@defined($fildes))
+ {
+ fildes_uaddr = $fildes
+ if (fildes_uaddr == 0)
+ {
+ pipe0 = 0;
+ pipe1 = 0;
+ }
+ else
+ {
+ pipe0 = user_int(&$fildes[0]);
+ pipe1 = user_int(&$fildes[1]);
+ }
+ }
+ else
+ {
+ fildes_uaddr = 0;
+ pipe0 = 0;
+ pipe1 = 0;
+ }
retstr = returnstr(1)
}