Admin/profiling_report
author wenzelm
Tue Jul 05 16:49:15 2005 +0200 (2005-07-05)
changeset 16693 75f39d66425d
parent 16671 ca316edcb031
child 16705 33f38450cab6
permissions -rwxr-xr-x
fixed regexp grouping;
     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,^([ 0-9]{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);