Admin/profiling_report
author wenzelm
Mon, 30 Jul 2012 14:29:12 +0200
changeset 48603 a37463482e5f
parent 36859 51af1657263b
permissions -rwxr-xr-x
discontinued unused isabelle jedit debugger; tuned;
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
# Author: Makarius
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     4
#
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     5
# DESCRIPTION: Simple report generator for Poly/ML profiling output.
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     6
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     7
use strict;
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     8
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
     9
my %log = ();
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    10
my @output = ();
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    11
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    12
while (<ARGV>) {
16693
75f39d66425d fixed regexp grouping;
wenzelm
parents: 16671
diff changeset
    13
    if (m,^([ 0-9]{10}) (\S+$|GARBAGE COLLECTION.*$),) {
16671
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    14
	my $count = $1;
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    15
	my $fun = $2;
16705
wenzelm
parents: 16693
diff changeset
    16
	$fun =~ s,-?\(\d+\).*$,,g;
wenzelm
parents: 16693
diff changeset
    17
	$fun =~ s,/\d+$,,g;
16671
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    18
	if ($count =~ m,^\s*(\d)+$,) {
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    19
	    if (defined($log{$fun})) {
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    20
		$log{$fun} += $count;
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    21
	    } else {
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    22
		$log{$fun} = $count;
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    23
	    }
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
foreach my $fun (keys %log) {
17001
wenzelm
parents: 16858
diff changeset
    29
    push @output, (sprintf "%14u %s\n", $log{$fun}, $fun);
16671
ca316edcb031 Simple report generator for Poly/ML profiling output.
wenzelm
parents:
diff changeset
    30
}
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
print (sort @output);