[471b1e]: events.pl Maximize Restore History

Download this file

events.pl    60 lines (50 with data), 1.1 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
#!/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];
sub print_event() {
print("<tr>");
print("<td>$name</td>");
print("<td>$desc</td>");
print("<td>$counters</td>");
if ($group) {
print("<td>$group</td>\n\n");
} else {
print("<td>\n");
for ($i=0; $i < $umcount; $i++) {
print ("$unitmasks[$i] <br />\n");
}
print("</td>\n\n");
}
print("</tr>\n\n");
}
while (<>) {
if (/\(counter:/) {
if ($hasone == 1) {
print_event();
}
chomp;
($name, $b, $counters) = split(":");
#print("name is $name\n\n\n");
$counters =~ s/\).*//;
$hasone = 1;
$umcount = 0;
} elsif (/min count/) {
chomp;
($group, $desc, $mincount) = /(.*\(Group.*?\))?(.*)(\(min count: .*\))/;
$group =~ s/\(//;
$group =~ s/\)//;
} elsif (/^ [0-9]/) {
$unitmasks[$umcount] = $_;
$umcount++;
} elsif (/^ ----/) {
}
}
if ($hasone == 1) {
print_event();
}