Admin/profiling_report
changeset 16671 ca316edcb031
child 16693 75f39d66425d
equal deleted inserted replaced
16670:6eeed52043dd 16671:ca316edcb031
       
     1 #!/usr/bin/env perl
       
     2 #
       
     3 # $Id$
       
     4 # Author: Makarius
       
     5 #
       
     6 # DESCRIPTION: Simple report generator for Poly/ML profiling output.
       
     7 
       
     8 use strict;
       
     9 
       
    10 my %log = ();
       
    11 my @output = ();
       
    12 
       
    13 while (<ARGV>) {
       
    14     if (m,^( |\d){10} (\S+$|GARBAGE COLLECTION.*$),) {
       
    15 	my $count = $1;
       
    16 	my $fun = $2;
       
    17 	if ($count =~ m,^\s*(\d)+$,) {
       
    18 	    if (defined($log{$fun})) {
       
    19 		$log{$fun} += $count;
       
    20 	    } else {
       
    21 		$log{$fun} = $count;
       
    22 	    }
       
    23 	}
       
    24     }
       
    25 }
       
    26 
       
    27 foreach my $fun (keys %log) {
       
    28     push @output, (sprintf "%8d %s\n", $log{$fun}, $fun);
       
    29 }
       
    30 
       
    31 print (sort @output);