From ddb92a3c6969d15bd0d1bf865b1440760b43f7ad Mon Sep 17 00:00:00 2001 From: "dp%netscape.com" Date: Sat, 17 Nov 2001 20:54:29 +0000 Subject: [PATCH] First version git-svn-id: svn://10.0.0.236/trunk@108390 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/tools/performance/startup/printlog.pl | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 mozilla/tools/performance/startup/printlog.pl diff --git a/mozilla/tools/performance/startup/printlog.pl b/mozilla/tools/performance/startup/printlog.pl new file mode 100644 index 00000000000..6e5aa382aef --- /dev/null +++ b/mozilla/tools/performance/startup/printlog.pl @@ -0,0 +1,34 @@ +# Post processor for timeline output +# Does a diff betn consecutive timeline outputs looking for +# big % differences + +my $percent = 1; # anything over 1% of total is of interest to us +my $ignoreDllLoads = 0; # by default dont ignore dll timings + +# Read in log to memory +my @lines = <>; + +my $total = 0; +# Look for main1's timing +foreach (@lines) { + if (/^([0-9\.]*): \.\.\.main1/) { + $total = $1 + 0; + print "Found main1 time: $total\n"; + last; + } +} + + +my $prev = 0; +my $t = $total * $percent / 100; +foreach (@lines) { + /^([0-9\.]*):/; + $cur = $1; + # if significant time elapsed print it + $diff = $cur - $prev; + if ($diff > $t && (!$ignoreDllLoads || ! /PR_LoadLibrary/)) { + printf "%4.2f%% %5.3f\n", $diff/$total*100, $diff; + } + print "\t$_"; + $prev = $cur; +}