Admin/profiling_report
author wenzelm
Fri, 13 Mar 2009 19:58:26 +0100
changeset 30510 4120fc59dd85
parent 17001 51ff2bc32774
child 36859 51af1657263b
permissions -rwxr-xr-x
unified type Proof.method and pervasive METHOD combinators;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16671
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env perl
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     2
#
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     3
# $Id$
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     4
# Author: Makarius
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     5
#
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     6
# DESCRIPTION: Simple report generator for Poly/ML profiling output.
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     7
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     8
use strict;
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     9
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    10
my %log = ();
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    11
my @output = ();
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    12
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    13
while (<ARGV>) {
16693
75f39d66425d fixed regexp grouping;
wenzelm
parents: 16671
diff changeset
    14
    if (m,^([ 0-9]{10}) (\S+$|GARBAGE COLLECTION.*$),) {
16671
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    15
	my $count = $1;
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    16
	my $fun = $2;
16705
wenzelm
parents: 16693
diff changeset
    17
	$fun =~ s,-?\(\d+\).*$,,g;
wenzelm
parents: 16693
diff changeset
    18
	$fun =~ s,/\d+$,,g;
16671
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    19
	if ($count =~ m,^\s*(\d)+$,) {
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    20
	    if (defined($log{$fun})) {
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    21
		$log{$fun} += $count;
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    22
	    } else {
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    23
		$log{$fun} = $count;
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    24
	    }
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    25
	}
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    26
    }
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    27
}
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    28
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    29
foreach my $fun (keys %log) {
17001
wenzelm
parents: 16858
diff changeset
    30
    push @output, (sprintf "%14u %s\n", $log{$fun}, $fun);
16671
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    31
}
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    32
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    33
print (sort @output);