#!/bin/sh # # CDDL HEADER START # # The contents of this file are subject to the terms # of the Common Development and Distribution License # (the "License"). You may not use this file except # in compliance with the License. # # You can obtain a copy of the license at # src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing # permissions and limitations under the License. # # When distributing Covered Code, include this CDDL # HEADER in each file and include the License file at # usr/src/OPENSOLARIS.LICENSE. If applicable, # add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your # own identifying information: Portions Copyright [yyyy] # [name of copyright owner] # # CDDL HEADER END # # # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)multiview 1.6 05/08/04 SMI" # # # output html comparison of several libmicro output data files # usage: multiview file1 file2 file3 file4 ... # # relative ranking is calculated using first as reference # color interpolation is done to indicate relative performance; # the redder the color, the slower the result, the greener the # faster /usr/bin/awk ' BEGIN { benchmark_count = 0; header_count = 0; } /^#/ { next; } /errors/ { next; } /^\!/ { split($0, A_header, ":"); name = substr(A_header[1],2); headers[name]=name; header_data[name,FILENAME] = substr($0, length(name) + 3); if (header_names[name] == 0) { header_names[name] = ++header_count; headers[header_count] = name; } next; } { if(NF >= 7) { if (benchmark_names[$1] == 0) { benchmark_names[$1] = ++benchmark_count; benchmarks[benchmark_count] = $1; } if ($6 == 0) benchmark_data[$1,FILENAME] = $4; else benchmark_data[$1,FILENAME] = -1; } } END { printf("\n"); printf("
\n"); printf("\n"); printf("\n"); printf("%s | \n", hname); for (j = 1; j <= ARGC; j++) { printf("%s | \n", header_data[hname, ARGV[j]]); } } printf("||||||
BENCHMARK | \n");
printf("USECS | \n");
for (i = 2; i < ARGC; i++)
printf("USECS [percentage] | \n");
for(i = 1; i < benchmark_count; i++) {
for(j = 1; j < benchmark_count; j++) {
if (benchmarks[j] > benchmarks[j + 1]) {
tmp = benchmarks[j];
benchmarks[j] = benchmarks[j+1];
benchmarks[j+1] = tmp;
}
}
}
for(i = 1; i <= benchmark_count; i++) {
name = benchmarks[i];
a = benchmark_data[name, ARGV[1]];
printf("|||||
%25s | \n", name); if (a > 0) printf("%25.5f | \n", a); else { if (a < 0) printf("%25s | \n", "ERRORS"); else printf("%25s | \n", "missing"); for (j = 2; j < ARGC; j++) printf("%25s | \n", "not computed"); next; } for (j = 2; j < ARGC; j++) { b = benchmark_data[name, ARGV[j]]; if (b > 0) { factor = b/a; bgcolor = colormap(factor); if (factor > 1) percentage = -(factor * 100 - 100); if (factor <= 1) percentage = 100/factor - 100; printf("%11.5f[%#+7.1f%%] | \n",
bgcolor, b, percentage);
}
else if (b < 0)
printf("%25s | \n", "ERRORS"); else printf("%25s | \n", "missing"); } printf("