From: Keith Owens Date: Mon, 18 Jan 2016 02:09:59 +0000 (+1100) Subject: strace-graph: handle recent strace output X-Git-Tag: v4.12~593 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef445b5dafa645d48ba22567eccf26f6efdd1a3b;p=strace strace-graph: handle recent strace output * strace-graph: Fix regex for --SIG. Ignore '+++ exited with +++' lines. Handle exit_group syscall as well as _exit. --- diff --git a/strace-graph b/strace-graph index b09c9280..ae355aa8 100755 --- a/strace-graph +++ b/strace-graph @@ -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; } }