strace-graph: handle recent strace output

* strace-graph: Fix regex for --SIG.  Ignore '+++ exited with <n> +++'
lines.  Handle exit_group syscall as well as _exit.
This commit is contained in:
Keith Owens 2016-01-18 13:09:59 +11:00 committed by Dmitry V. Levin
parent dbc1ffb2a4
commit ef445b5daf

View File

@ -75,7 +75,7 @@ while (<>) {
delete $unfinished{$pid};
}
if (/^--- SIG(\S+) \(.*\) ---$/) {
if (/^--- SIG(\S+) (.*) ---$/) {
# $pid received signal $1
# currently we don't do anything with this
next;
@ -87,6 +87,12 @@ while (<>) {
next;
}
if (/^\+\+\+ exited with (\d+) \+\+\+$/) {
# $pid exited $1
# currently we don't do anything with this
next;
}
($call, $args, $result) = /(\S+)\((.*)\)\s+= (.*)$/;
if ($result =~ /^(.*) <([0-9.]*)>$/) {
($result, $time_spent) = ($1, $2);
@ -244,7 +250,7 @@ sub handle_trace {
push @$seq, ['FORK', $result];
$pr{$pid}{seq} = $seq;
$pr{$result}{parent} = $pid;
} elsif ($call eq '_exit') {
} elsif ($call eq '_exit' || $call eq 'exit_group') {
$pr{$pid}{end} = $time if defined $time;
}
}