aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/unixbench/files/patch-Run
blob: 0c0c51fc42e04d4d9ca317eef8d0b2f250e5bb5a (plain) (blame)
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
--- Run.orig	2020-06-11 08:18:10 UTC
+++ Run
@@ -91,10 +91,10 @@ chomp($BASEDIR);
 my $BINDIR = getDir('UB_BINDIR', $BASEDIR . "/pgms");
 
 # Temp directory, for temp files.
-my $TMPDIR = getDir('UB_TMPDIR', $BASEDIR . "/tmp");
+my $TMPDIR = "/tmp";
 
 # Directory to put results in.
-my $RESULTDIR = getDir('UB_RESULTDIR', $BASEDIR . "/results");
+my $RESULTDIR = "/tmp";
 
 # Directory where the tests are executed.
 my $TESTDIR = getDir('UB_TESTDIR', $BASEDIR . "/testdir");
@@ -672,6 +672,18 @@ sub processCpuFlags {
 # these fields:
 # describing the model etc.  Returns undef if the information can't be got.
 sub getCpuInfo {
+    my $ncpu = getCmdOutput("sysctl -n hw.ncpu");
+    my $cpus = [ ];
+    my $i;
+    for ($i=0;$i<$ncpu;$i++) {
+       $cpus->[$i]{'model'} = getCmdOutput("sysctl -n hw.model");
+       $cpus->[$i]{'bogo'} = 0;
+       $cpus->[$i]{'flags'} = getCmdOutput("sysctl -n hw.machine");
+    }
+    $cpus;
+}
+
+sub getCpuInfoBak {
     open(my $fd, "<", "/proc/cpuinfo") || return undef;
 
     my $cpus = [ ];
@@ -735,12 +747,10 @@ sub getSystemInfo {
 
     # Get the language info.
     my $lang = getCmdOutput("printenv LANG");
-    my $map = getCmdOutput("locale -k LC_CTYPE | grep charmap");
+    my $map = getCmdOutput("locale -k | grep charmap");
     $map =~ s/.*=//;
-    my $coll = getCmdOutput("locale -k LC_COLLATE | grep collate-codeset");
-    $coll =~ s/.*=//;
-    $info->{'language'} = sprintf "%s (charmap=%s, collate=%s)",
-                                   $lang, $map, $coll;
+    $info->{'language'} = sprintf "%s (charmap=%s)",
+                                   $lang, $map;
 
     # Get details on the CPUs, if possible.
     my $cpus = getCpuInfo();
@@ -750,10 +760,9 @@ sub getSystemInfo {
     }
 
     # Get graphics hardware info.
-    $info->{'graphics'} = getCmdOutput("3dinfo | cut -f1 -d\'(\'");
+    # $info->{'graphics'} = getCmdOutput("3dinfo | cut -f1 -d\'(\'");
 
     # Get system run state, load and usage info.
-    $info->{'runlevel'} = getCmdOutput("runlevel | cut -f2 -d\" \"");
     $info->{'load'} = getCmdOutput("uptime");
     $info->{'numUsers'} = getCmdOutput("who | wc -l");
 
@@ -781,6 +790,7 @@ sub abortRun {
 
 # Do checks that everything's ready for testing.
 sub preChecks {
+    return;
     # Set the language.
     $ENV{'LANG'} = $language;
 
@@ -1386,7 +1396,7 @@ sub displaySystem {
     }
 
     # Display system load and usage info.
-    printf $fd "   %s; runlevel %s\n\n", $info->{'load'}, $info->{'runlevel'};
+    printf $fd "   %s; \n\n", $info->{'load'};
 }
 
 
@@ -1603,8 +1613,8 @@ sub displaySystemHtml {
     # Display system runlevel, load and usage info.
     printf $fd "<tr>\n";
     printf $fd "   <td><b>Uptime:</b></td>\n";
-    printf $fd "   <td colspan=2>%s; runlevel %s</td>\n",
-                   $info->{'load'}, $info->{'runlevel'};
+    printf $fd "   <td colspan=2>%s</td>\n",
+                   $info->{'load'};
     printf $fd "</tr>\n";
 
     printf $fd "</table></p>\n\n";