File: html-list

package info (click to toggle)
lmbench 3.0-a9%2Bdebian.1-3
  • links: PTS
  • area: non-free
  • in suites: bullseye
  • size: 2,752 kB
  • sloc: ansic: 12,328; perl: 6,531; sh: 3,965; makefile: 730
file content (123 lines) | stat: -rwxr-xr-x 3,235 bytes parent folder | download | duplicates (5)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/usr/bin/env perl
# Take the list of files and turn them into an html file that points
# at their context & mem latency GIFs.
#
# Usage: html-list file file file....
#
# Hacked into existence by Larry McVoy (lm@sun.com now lm@sgi.com).
# Copyright (c) 1995 Larry McVoy.  GPLed software.
# $Id$
eval 'exec perl -Ssw $0 "$@"'
	if 0;

open(H, ">HTML/specific.html");
print H <<EOF;
<title>LMBENCH System Results</title>
<h1>LMBENCH System Results</h1>
<h2><a href=summary>Summary of results</a></h2>
<hr>
EOF

# The order that is passed in is the order of the generated 
# graphs so save that.
$val = 0;
foreach $file (@ARGV) {
	$number{$file} = ++$val;
}

# Now sort them so we can group by OS
@ARGV = sort(@ARGV);

# Figure out the different OS
foreach $file (@ARGV) {
	($os = $file) =~ s|/.*||;
	push(@os, $os);
	$done{$os} = 0;
}

foreach $os (@os) {
	next if $done{$os};
	$done{$os} = 1;
	# Print out an OS specific heading
	print H "<hr><h2>Results from $os</h2><p>\n";

	for ($i = 0; $i <= $#os; $i++) {
		$file = $ARGV[$i];
		next unless $file =~ /$os/;
		open(F, $file);
		$_ = <F>;
		close(F);
		next unless /lmbench1.[01]/;
		chop;
		$title = $_;
		#s/.lmbench1.? results for //;
		($sys = $file) =~ s|.*/||;
		if ($i > 0) {
			($prev_sys = $ARGV[$i - 1]) =~ s|.*/||;
		}
		if ($i < $#os) {
			($next_sys = $ARGV[$i + 1]) =~ s|.*/||;
		}
		print H <<EOF;
<h3>Dataset: $sys</h3>
<h4>$title</h4>
<a href="${sys}-ctx.html">Context switch details</a>,
<a href="${sys}-bwmem.html">memory bandwidths</a>,
<a href="${sys}-bwfile.html">file reread vs. memory bandwidths</a>,
and
<a href="${sys}-mem.html">memory latencies</a>.
EOF

		# Create the files referencing the data GIFs
		$N = sprintf("%02d", $number{$file});
		$prev = $next = "";
		%label = ('ctx', 'context switching',
		    	   'mem', 'memory latency',
			   'bwmem', 'memory bandwidth',
			   'bwfile', 'file reread bandwidth');
		%doc = ('ctx', 'lat_ctx.8.html',
		    	   'mem', 'lat_mem_rd.8.html',
			   'bwmem', 'bw_mem.8.html',
			   'bwfile', 'bw_file_rd.8.html');
		$back = "<img align=middle src=\"../gifs/arrows/back.gif\">";
		$forward = "<img align=middle src=\"../gifs/arrows/forward.gif\">";
		for $what ('ctx', 'mem', 'bwmem', 'bwfile') {
			for $scale ('', '-unscaled') {
				open(S, ">HTML/${sys}-${what}${scale}.html");
				if ($scale eq '') {
					$notscale = "-unscaled";
					$lab = "";
					$Lab = "Unscaled ";
				} else {
					$notscale = "";
					$lab = "scaled ";
					$Lab = "Scaled ";
				}
				$prev =
				    "<a href=${prev_sys}-${what}${scale}.html>
				    Previous ${lab}$label{$what} result</a><p>"
				    if $i > 0;
				$next =
				    "<a href=${next_sys}-${what}.html>
				    Next ${lab}$label{$what} result</a><p>"
				    if $i < $#os;
				print S<<EOF;
<h4>$title</h4>
<a href=../$doc{$what}>Information on this benchmark</a> (Not up to date)
<p><IMG SRC="${what}${scale}$N.gif">\n<p>
<a href=../lmbench.html>
<img align=middle src="../gifs/arrows/b_arrow.gif">LMBENCH table of contents</a>
<a href=specific.html>
<img align=middle src=\"../gifs/graph.gif\">System results table of contents</a>
<p>
$next
$prev
<a href=${sys}-${what}${notscale}.html>
${Lab}$label{$what} results for this system</a>
EOF
			}
		}

	}
}
exit 0;