Admin/profiling_report
author wenzelm
Thu, 15 Apr 2010 18:09:22 +0200
changeset 36153 1ac501e16a6a
parent 17001 51ff2bc32774
child 36859 51af1657263b
permissions -rwxr-xr-x
replaced slightly odd Typedecl.predeclare_constraints by plain declaration of type arguments -- also avoid "recursive" declaration of type constructor, which can cause problems with sequential definitions B.foo = A.foo; simplified via ProofContext.check_tfree;

#!/usr/bin/env perl
#
# $Id$
# Author: Makarius
#
# DESCRIPTION: Simple report generator for Poly/ML profiling output.

use strict;

my %log = ();
my @output = ();

while (<ARGV>) {
    if (m,^([ 0-9]{10}) (\S+$|GARBAGE COLLECTION.*$),) {
	my $count = $1;
	my $fun = $2;
	$fun =~ s,-?\(\d+\).*$,,g;
	$fun =~ s,/\d+$,,g;
	if ($count =~ m,^\s*(\d)+$,) {
	    if (defined($log{$fun})) {
		$log{$fun} += $count;
	    } else {
		$log{$fun} = $count;
	    }
	}
    }
}

foreach my $fun (keys %log) {
    push @output, (sprintf "%14u %s\n", $log{$fun}, $fun);
}

print (sort @output);