author | Walther Neuper <wneuper@ist.tugraz.at> |
Tue, 07 Feb 2017 08:57:42 +0100 | |
changeset 59316 | 3a60188d9cc3 |
parent 59180 | 85ec71012df8 |
permissions | -rwxr-xr-x |
wneuper@59180 | 1 |
#!/usr/bin/env perl |
wneuper@59180 | 2 |
# |
wneuper@59180 | 3 |
# Author: Makarius |
wneuper@59180 | 4 |
# |
wneuper@59180 | 5 |
# DESCRIPTION: Simple report generator for Poly/ML profiling output. |
wneuper@59180 | 6 |
|
wneuper@59180 | 7 |
use strict; |
wneuper@59180 | 8 |
|
wneuper@59180 | 9 |
my %log = (); |
wneuper@59180 | 10 |
my @output = (); |
wneuper@59180 | 11 |
|
wneuper@59180 | 12 |
while (<ARGV>) { |
wneuper@59180 | 13 |
if (m,^([ 0-9]{10}) (\S+$|GARBAGE COLLECTION.*$),) { |
wneuper@59180 | 14 |
my $count = $1; |
wneuper@59180 | 15 |
my $fun = $2; |
wneuper@59180 | 16 |
$fun =~ s,-?\(\d+\).*$,,g; |
wneuper@59180 | 17 |
$fun =~ s,/\d+$,,g; |
wneuper@59180 | 18 |
if ($count =~ m,^\s*(\d)+$,) { |
wneuper@59180 | 19 |
if (defined($log{$fun})) { |
wneuper@59180 | 20 |
$log{$fun} += $count; |
wneuper@59180 | 21 |
} else { |
wneuper@59180 | 22 |
$log{$fun} = $count; |
wneuper@59180 | 23 |
} |
wneuper@59180 | 24 |
} |
wneuper@59180 | 25 |
} |
wneuper@59180 | 26 |
} |
wneuper@59180 | 27 |
|
wneuper@59180 | 28 |
foreach my $fun (keys %log) { |
wneuper@59180 | 29 |
push @output, (sprintf "%14u %s\n", $log{$fun}, $fun); |
wneuper@59180 | 30 |
} |
wneuper@59180 | 31 |
|
wneuper@59180 | 32 |
print (sort @output); |