Admin/profiling_report
author wenzelm
Fri Jul 15 11:26:22 2005 +0200 (2005-07-15)
changeset 16858 fade1d3a2995
parent 16705 33f38450cab6
child 17001 51ff2bc32774
permissions -rwxr-xr-x
tuned;
     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 	$fun =~ s,-?\(\d+\).*$,,g;
    18 	$fun =~ s,/\d+$,,g;
    19 	if ($count =~ m,^\s*(\d)+$,) {
    20 	    if (defined($log{$fun})) {
    21 		$log{$fun} += $count;
    22 	    } else {
    23 		$log{$fun} = $count;
    24 	    }
    25 	}
    26     }
    27 }
    28 
    29 foreach my $fun (keys %log) {
    30     push @output, (sprintf "%12d %s\n", $log{$fun}, $fun);
    31 }
    32 
    33 print (sort @output);