Simple report generator for Poly/ML profiling output.
authorwenzelm
Sat Jul 02 13:08:28 2005 +0200 (2005-07-02)
changeset 16671ca316edcb031
parent 16670 6eeed52043dd
child 16672 f83f3aef274d
Simple report generator for Poly/ML profiling output.
Admin/profiling_report
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Admin/profiling_report	Sat Jul 02 13:08:28 2005 +0200
     1.3 @@ -0,0 +1,31 @@
     1.4 +#!/usr/bin/env perl
     1.5 +#
     1.6 +# $Id$
     1.7 +# Author: Makarius
     1.8 +#
     1.9 +# DESCRIPTION: Simple report generator for Poly/ML profiling output.
    1.10 +
    1.11 +use strict;
    1.12 +
    1.13 +my %log = ();
    1.14 +my @output = ();
    1.15 +
    1.16 +while (<ARGV>) {
    1.17 +    if (m,^( |\d){10} (\S+$|GARBAGE COLLECTION.*$),) {
    1.18 +	my $count = $1;
    1.19 +	my $fun = $2;
    1.20 +	if ($count =~ m,^\s*(\d)+$,) {
    1.21 +	    if (defined($log{$fun})) {
    1.22 +		$log{$fun} += $count;
    1.23 +	    } else {
    1.24 +		$log{$fun} = $count;
    1.25 +	    }
    1.26 +	}
    1.27 +    }
    1.28 +}
    1.29 +
    1.30 +foreach my $fun (keys %log) {
    1.31 +    push @output, (sprintf "%8d %s\n", $log{$fun}, $fun);
    1.32 +}
    1.33 +
    1.34 +print (sort @output);