-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtabulate.pl
More file actions
executable file
·88 lines (72 loc) · 1.6 KB
/
Copy pathtabulate.pl
File metadata and controls
executable file
·88 lines (72 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/perl
#!/usr/local/bin/perl
use Getopt::Std;
# Tabulate combining information
$wsize = 64;
$machine = "haswell";
$directory = "results";
@roots = ("isb", "ipb", "lsb", "lpb", "fsb", "fpb", "dsb", "dpb");
getopts('hw:m:d:r:');
if ($opt_h) {
print STDOUT "Usage $0 [-h] [-w wordsize] [-m machine] [-d directory] [-r roots]\n";
exit(0);
}
if ($opt_w) {
$wsize = $opt_w;
}
if ($opt_m) {
$machine = $opt_m;
}
if ($opt_d) {
$directory = $opt_d;
}
if ($opt_r) {
@roots = split (":", $opt_r);
}
# Record all function names
@functs = ();
# Record all function descriptions
@descrs = ();
# Create tab-separated list of times
@times = ();
$first = 1;
foreach $root (@roots) {
$fname = "$directory/$root-$machine-$wsize.txt";
open (IN, $fname) || die ("Couldn't open '$fname'\n");
$cnt = 0;
$descr = "";
$data = "";
$operation = "";
$function = "";
$time = "";
while (<IN>) {
$line = $_;
chomp $line;
if ($line =~ "([0-9\.]+) cycles/element") {
$time = $1;
$times[$cnt] = $times[$cnt] . $time . "\t";
$cnt = $cnt+1;
} else {
($left, $descr) = split (/:\s*/,$line);
($data, $operation, $function) = split(/\s+/, $left);
if ($first == 1) {
$functs[$cnt] = $function;
$descrs[$cnt] = $descr;
$times[$cnt] = "";
}
}
}
close (IN);
$first = 0;
}
# Print header information
foreach $root (@roots) {
print "$root\t";
}
print "funct\t\tdescription\n";
for ($i = 0; $i < $cnt; $i++) {
$function = $functs[$i];
$description = $descrs[$i];
$time = $times[$i];
print "$time$function\t$description\n";
}