[2925b4]: events.pl Maximize Restore History

Download this file

events.pl    50 lines (42 with data), 964 Bytes

 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
#!/usr/bin/perl
# L2_IFETCH: (counter: all) (supported cpu: Pentium Pro, PII, PIII)
# number of L2 instruction fetches (min count: 500)
# Unit masks
# ----------
# 08: (M)odified cache state
$hasone=0;
$umcount=0;
$unitmasks[10];
while (<>) {
if (/counter/) {
if ($hasone == 1) {
print("<tr>");
print("<td>$name</td>");
print("<td>$desc</td>");
print("<td>$counters</td>");
print("<td>$cpus</td>");
print("<td>\n");
for ($i=0; $i < $umcount; $i++) {
print ("$unitmasks[$i] <br />\n");
}
print("</td>\n\n");
print("</tr>\n\n");
}
chomp;
($name, $b, $counters, $cpus) = split(":");
#print("name is $name\n\n\n");
$counters =~ s/\).*//;
$cpus =~ s/\)//;
$hasone = 1;
$umcount = 0;
} elsif (/min count/) {
chomp;
($desc, $mincount) = split('\(');
$mincount =~ s/min count: //;
$mincount =~ s/\)//;
} elsif (/^ [0-9]/) {
$unitmasks[$umcount] = $_;
$umcount++;
} elsif (/^ ----/) {
}
}