Commit 6b3f1956 authored by Brendan Gregg's avatar Brendan Gregg Committed by GitHub

Merge pull request #212 from iovisor/tools

opensnoop to trace openat
parents 01382c5a 93e492ec
...@@ -21,15 +21,22 @@ BEGIN ...@@ -21,15 +21,22 @@ BEGIN
printf("%-6s %-16s %4s %3s %s\n", "PID", "COMM", "FD", "ERR", "PATH"); printf("%-6s %-16s %4s %3s %s\n", "PID", "COMM", "FD", "ERR", "PATH");
} }
// workaround for #132: the next two code blocks can't be combined yet
tracepoint:syscalls:sys_enter_open tracepoint:syscalls:sys_enter_open
{ {
@filename[tid] = args->filename; @filename[tid] = args->filename;
} }
tracepoint:syscalls:sys_exit_open tracepoint:syscalls:sys_enter_openat
{
@filename[tid] = args->filename;
}
tracepoint:syscalls:sys_exit_open,
tracepoint:syscalls:sys_exit_openat
/@filename[tid]/ /@filename[tid]/
{ {
$ret = args->ret; $ret = *(ctx + 16); // workaround for #132
$fd = $ret > 0 ? $ret : -1; $fd = $ret > 0 ? $ret : -1;
$errno = $ret > 0 ? 0 : - $ret; $errno = $ret > 0 ? 0 : - $ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment