Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[39f87a]: events.pl Maximize Restore History

Download this file

events.pl    83 lines (71 with data), 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
#!/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>");
if ($ext) {
print("<td>$ext</td>");
} elsif ($counters) {
print("<td>$counters</td>");
}
if ($group) {
print("<td>$group</td>\n\n");
} else {
print("<td>\n");
for ($i=0; $i < $umcount; $i++) {
my $len = length $unitmasks[$i];
my $n = rindex $unitmasks[$i], " ";
if (($n eq $len-1) ||
(($n eq $len-2) && ((rindex $unitmasks[$i], "\n") eq $len-1))) {
my $ns = substr $unitmasks[$i],0,$n;
print ("$ns\n <br />\n");
} else {
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 (/\(ext:/) {
if ($hasone == 1) {
print_event();
}
chomp;
($name, $b, $ext) = split(":");
$ext =~ 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();
}