]> granicus.if.org Git - strace/commitdiff
strace-graph: handle strace -T
authorKeith Owens <kaos.ocs@gmail.com>
Mon, 18 Jan 2016 02:03:41 +0000 (13:03 +1100)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 5 Feb 2016 00:41:23 +0000 (00:41 +0000)
* strace-graph: Ignore extra ' <time.spent>' field added by strace -T.

strace-graph

index 169c82c36355248e4afdee1ef8f69fcc024cb814..b09c92803269e0b477156bca04bc5ea2e692367b 100755 (executable)
@@ -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;