16671
|
1 |
#!/usr/bin/env perl
|
|
2 |
#
|
|
3 |
# Author: Makarius
|
|
4 |
#
|
|
5 |
# DESCRIPTION: Simple report generator for Poly/ML profiling output.
|
|
6 |
|
|
7 |
use strict;
|
|
8 |
|
|
9 |
my %log = ();
|
|
10 |
my @output = ();
|
|
11 |
|
|
12 |
while (<ARGV>) {
|
16693
|
13 |
if (m,^([ 0-9]{10}) (\S+$|GARBAGE COLLECTION.*$),) {
|
16671
|
14 |
my $count = $1;
|
|
15 |
my $fun = $2;
|
16705
|
16 |
$fun =~ s,-?\(\d+\).*$,,g;
|
|
17 |
$fun =~ s,/\d+$,,g;
|
16671
|
18 |
if ($count =~ m,^\s*(\d)+$,) {
|
|
19 |
if (defined($log{$fun})) {
|
|
20 |
$log{$fun} += $count;
|
|
21 |
} else {
|
|
22 |
$log{$fun} = $count;
|
|
23 |
}
|
|
24 |
}
|
|
25 |
}
|
|
26 |
}
|
|
27 |
|
|
28 |
foreach my $fun (keys %log) {
|
17001
|
29 |
push @output, (sprintf "%14u %s\n", $log{$fun}, $fun);
|
16671
|
30 |
}
|
|
31 |
|
|
32 |
print (sort @output);
|