Commit 5ef6e080 authored by Brendan Gregg's avatar Brendan Gregg Committed by GitHub

Merge pull request #134 from iovisor/tools

update more tools to use args
parents c318a884 9bdf5bf0
...@@ -23,19 +23,16 @@ BEGIN ...@@ -23,19 +23,16 @@ BEGIN
tracepoint:syscalls:sys_enter_kill tracepoint:syscalls:sys_enter_kill
{ {
$pid = *(ctx + 16); @tpid[tid] = args->pid;
$sig = *(ctx + 24); @tsig[tid] = args->sig;
@tpid[tid] = $pid;
@tsig[tid] = $sig;
} }
tracepoint:syscalls:sys_exit_kill tracepoint:syscalls:sys_exit_kill
/@tpid[tid]/ /@tpid[tid]/
{ {
$ret = *(ctx + 16);
time("%H:%M:%S "); time("%H:%M:%S ");
printf("%-6d %-16s %-4d %-6d %d\n", pid, comm, @tsig[tid], @tpid[tid], printf("%-6d %-16s %-4d %-6d %d\n", pid, comm, @tsig[tid], @tpid[tid],
$ret); args->ret);
delete(@tpid[tid]); delete(@tpid[tid]);
delete(@tsig[tid]); delete(@tsig[tid]);
} }
...@@ -26,26 +26,22 @@ BEGIN ...@@ -26,26 +26,22 @@ BEGIN
tracepoint:syscalls:sys_enter_statfs tracepoint:syscalls:sys_enter_statfs
{ {
$path = *(ctx + 16); @filename[tid] = args->pathname;
@filename[tid] = $path;
} }
tracepoint:syscalls:sys_enter_statx tracepoint:syscalls:sys_enter_statx
{ {
$file = *(ctx + 24); @filename[tid] = args->filename;
@filename[tid] = $file;
} }
tracepoint:syscalls:sys_enter_newstat tracepoint:syscalls:sys_enter_newstat
{ {
$file = *(ctx + 16); @filename[tid] = args->filename;
@filename[tid] = $file;
} }
tracepoint:syscalls:sys_enter_newlstat tracepoint:syscalls:sys_enter_newlstat
{ {
$file = *(ctx + 16); @filename[tid] = args->filename;
@filename[tid] = $file;
} }
tracepoint:syscalls:sys_exit_statfs, tracepoint:syscalls:sys_exit_statfs,
......
...@@ -37,22 +37,20 @@ BEGIN ...@@ -37,22 +37,20 @@ BEGIN
tracepoint:writeback:writeback_start tracepoint:writeback:writeback_start
{ {
$sb_dev = *(ctx + 48) & 0xffffffff; @start[args->sb_dev] = nsecs;
@start[$sb_dev] = nsecs;
} }
tracepoint:writeback:writeback_written tracepoint:writeback:writeback_written
{ {
$name = str(ctx + 8); $sb_dev = args->sb_dev;
$nr_pages = *(ctx + 40) & 0xffff;
$sb_dev = *(ctx + 48) & 0xffffffff;
$r = *(ctx + 68) & 0xffffffff;
$s = @start[$sb_dev]; $s = @start[$sb_dev];
delete(@start[$sb_dev]); delete(@start[$sb_dev]);
$lat = $s ? (nsecs - $s) / 1000 : 0; $lat = $s ? (nsecs - $s) / 1000 : 0;
time("%H:%M:%S "); time("%H:%M:%S ");
printf("%-8s %-8d %-16s %d.%03d\n", $name, $nr_pages, @reason[$r], printf("%-8s %-8d %-16s %d.%03d\n", args->name,
args->nr_pages & 0xffff, // TODO: explain these bitmasks
@reason[args->reason & 0xffffffff],
$lat / 1000, $lat % 1000); $lat / 1000, $lat % 1000);
} }
......
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