Admin/profiling_report
author wenzelm
Fri May 11 00:43:46 2007 +0200 (2007-05-11)
changeset 22932 53005f898665
parent 17001 51ff2bc32774
child 36859 51af1657263b
permissions -rwxr-xr-x
bang_facts: warning;
     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 "%14u %s\n", $log{$fun}, $fun);
    31 }
    32 
    33 print (sort @output);