Skip to content

Commit 912cba1

Browse files
committed
Use global system info.
1 parent 317ee2e commit 912cba1

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

UnixBench/Run

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ my $RESULTDIR = getDir('UB_RESULTDIR', $FindBin::Bin . "/results");
9999
# Directory where the tests are executed.
100100
my $TESTDIR = getDir('UB_TESTDIR', $FindBin::Bin . "/testdir");
101101

102+
# System information
103+
my $systemInfo = getSystemInfo();
102104

103105
############################################################################
104106
# TEST SPECIFICATIONS
@@ -1491,7 +1493,8 @@ sub runTests {
14911493
# Display a banner indicating the configuration of the system under test
14921494
# to the given file desc.
14931495
sub displaySystem {
1494-
my ( $info, $fd ) = @_;
1496+
my ( $fd ) = @_;
1497+
my $info = $systemInfo;
14951498

14961499
# Display basic system info.
14971500
printf $fd " System: %s: %s\n", $info->{'name'}, $info->{'system'};
@@ -1605,7 +1608,7 @@ sub logIndex {
16051608

16061609
# Dump the given run results into the given report file.
16071610
sub summarizeRun {
1608-
my ( $systemInfo, $results, $verbose, $reportFd ) = @_;
1611+
my ( $results, $verbose, $reportFd ) = @_;
16091612

16101613
# Display information about this test run.
16111614
printf $reportFd "------------------------------------------------------------------------\n";
@@ -1674,7 +1677,7 @@ sub summarizeRunCsvRows {
16741677

16751678
# Dump the given run results into the given report file.
16761679
sub runHeaderHtml {
1677-
my ( $systemInfo, $reportFd ) = @_;
1680+
my ( $reportFd ) = @_;
16781681

16791682
# Display information about this test run.
16801683
my $title = sprintf "Benchmark of %s / %s on %s",
@@ -1721,7 +1724,8 @@ EOF
17211724
# Display a banner indicating the configuration of the system under test
17221725
# to the given file desc.
17231726
sub displaySystemHtml {
1724-
my ( $info, $fd ) = @_;
1727+
my ( $fd ) = @_;
1728+
my $info = $systemInfo;
17251729

17261730
printf $fd "<h3>Test System Information</h3>\n";
17271731
printf $fd "<p><table>\n";
@@ -1875,7 +1879,7 @@ sub logResultsHtml {
18751879

18761880
# Dump the given run results into the given report file.
18771881
sub summarizeRunHtml {
1878-
my ( $systemInfo, $results, $verbose, $reportFd ) = @_;
1882+
my ( $results, $verbose, $reportFd ) = @_;
18791883

18801884
# Display information about this test run.
18811885
my $time = $results->{'end'} - $results->{'start'};
@@ -1942,7 +1946,6 @@ sub main {
19421946
createDirrectoriesIfNotExists(@creatingDirectories);
19431947

19441948
preChecks();
1945-
my $systemInfo = getSystemInfo();
19461949

19471950
# If the number of copies to run was not set, set it to 1
19481951
# and the number of CPUs in the system (if > 1).
@@ -1991,11 +1994,11 @@ sub main {
19911994
}
19921995

19931996
printf $reportFd " BYTE UNIX Benchmarks (Version %s)\n\n", $version;
1994-
runHeaderHtml($systemInfo, $reportFd2);
1997+
runHeaderHtml($reportFd2);
19951998

19961999
# Dump information about the system under test.
1997-
displaySystem($systemInfo, $reportFd);
1998-
displaySystemHtml($systemInfo, $reportFd2);
2000+
displaySystem($reportFd);
2001+
displaySystemHtml($reportFd2);
19992002

20002003
# Run the tests! Do a test run once for each desired number of copies;
20012004
# for example, on a 2-CPU system, we may do a single-processing run
@@ -2006,8 +2009,8 @@ sub main {
20062009
}
20072010
my $results = runTests($tests, $verbose, $logFile, $c);
20082011

2009-
summarizeRun($systemInfo, $results, $verbose, $reportFd);
2010-
summarizeRunHtml($systemInfo, $results, $verbose, $reportFd2);
2012+
summarizeRun($results, $verbose, $reportFd);
2013+
summarizeRunHtml($results, $verbose, $reportFd2);
20112014

20122015
if ($isOutputFormatCsv) {
20132016
if ( $is_csv_header_written == 0 ) {

0 commit comments

Comments
 (0)