strace-graph: handle strace -T

* strace-graph: Ignore extra ' <time.spent>' field added by strace -T.
This commit is contained in:
Keith Owens 2016-01-18 13:03:41 +11:00 committed by Dmitry V. Levin
parent a0bc25f085
commit dbc1ffb2a4

View File

@ -43,7 +43,7 @@ my $floatform;
my $scale_factor = 3.5;
while (<>) {
my ($pid, $call, $args, $result, $time);
my ($pid, $call, $args, $result, $time, $time_spent);
chop;
$floatform = 0;
@ -88,6 +88,9 @@ while (<>) {
}
($call, $args, $result) = /(\S+)\((.*)\)\s+= (.*)$/;
if ($result =~ /^(.*) <([0-9.]*)>$/) {
($result, $time_spent) = ($1, $2);
}
unless (defined $result) {
print STDERR "$0: $ARGV: $.: cannot parse line.\n";
next;