Commit 93e492ec authored by Brendan Gregg's avatar Brendan Gregg

opensnoop to trace openat

parent 01382c5a
......@@ -21,15 +21,22 @@ BEGIN
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
{
@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]/
{
$ret = args->ret;
$ret = *(ctx + 16); // workaround for #132
$fd = $ret > 0 ? $ret : -1;
$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