OLD | NEW |
1 import os, re | 1 import os, re |
2 from autotest_lib.client.bin import test, utils | 2 from autotest_lib.client.bin import test, utils |
3 from autotest_lib.client.common_lib import error | 3 from autotest_lib.client.common_lib import error |
4 | 4 |
5 | 5 |
6 class unixbench(test.test): | 6 class unixbench(test.test): |
7 version = 2 | 7 version = 2 |
8 | 8 |
9 def initialize(self): | 9 def initialize(self): |
10 self.job.require_gcc() | 10 self.job.require_gcc() |
11 self.err = None | 11 self.err = None |
12 | 12 |
13 | 13 |
14 # http://www.tux.org/pub/tux/niemi/unixbench/unixbench-4.1.0.tgz | 14 # http://www.tux.org/pub/tux/niemi/unixbench/unixbench-4.1.0.tgz |
15 def setup(self, tarball = 'unixbench-4.1.0.tar.bz2'): | 15 def setup(self, tarball = 'unixbench-4.1.0.tar.bz2'): |
16 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) | 16 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) |
17 utils.extract_tarball_to_dir(tarball, self.srcdir) | 17 utils.extract_tarball_to_dir(tarball, self.srcdir) |
18 os.chdir(self.srcdir) | 18 os.chdir(self.srcdir) |
19 | 19 |
20 utils.system('patch -p1 < ../unixbench.patch') | 20 utils.system('patch -p1 < ../unixbench.patch') |
21 utils.system('patch -p1 < ../Makefile.patch') | 21 utils.system('patch -p1 < ../Makefile.patch') |
22 utils.system('make') | 22 utils.make() |
23 utils.system('rm pgms/select') | 23 utils.system('rm pgms/select') |
24 | 24 |
25 | 25 |
26 def run_once(self, args='', stepsecs=0): | 26 def run_once(self, args='', stepsecs=0): |
27 vars = ('TMPDIR=\"%s\" RESULTDIR=\"%s\" FLAVOR=Linux' % | 27 vars = ('TMPDIR=\"%s\" RESULTDIR=\"%s\" FLAVOR=Linux' % |
28 (self.tmpdir, self.resultsdir)) | 28 (self.tmpdir, self.resultsdir)) |
29 if stepsecs: | 29 if stepsecs: |
30 # change time per subtest from unixbench's defaults of | 30 # change time per subtest from unixbench's defaults of |
31 # 10 secs for small tests, 30 secs for bigger tests | 31 # 10 secs for small tests, 30 secs for bigger tests |
32 vars += ' systime=%i looper=%i seconds=%i'\ | 32 vars += ' systime=%i looper=%i seconds=%i'\ |
33 ' dhrytime=%i arithtime=%i' \ | 33 ' dhrytime=%i arithtime=%i' \ |
34 % ((stepsecs,)*5) | 34 % ((stepsecs,)*5) |
35 | 35 |
36 os.chdir(self.srcdir) | 36 os.chdir(self.srcdir) |
37 utils.system(vars + ' ./Run ' + args) | 37 try: |
| 38 utils.system(vars + ' ./Run ' + args) |
| 39 finally: |
| 40 times_path = os.path.join(self.resultsdir, 'times') |
| 41 # The 'times' file can be needlessly huge as it contains warnings |
| 42 # and error messages printed out by small benchmarks that are |
| 43 # run in a loop. It can easily compress 100x in such cases. |
| 44 if os.path.exists(times_path): |
| 45 utils.system("gzip -9 '%s'" % (times_path,), ignore_status=True) |
38 | 46 |
39 report_path = os.path.join(self.resultsdir, 'report') | 47 report_path = os.path.join(self.resultsdir, 'report') |
40 self.report_data = open(report_path).readlines()[9:] | 48 self.report_data = open(report_path).readlines()[9:] |
41 | 49 |
42 | 50 |
43 def cleanup(self): | 51 def cleanup(self): |
44 # check err string and possible throw | 52 # check err string and possible throw |
45 if self.err is not None: | 53 if self.err is not None: |
46 raise error.TestError(self.err) | 54 raise error.TestError(self.err) |
47 | 55 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 File Copy 256 bufsize 500 maxblocks 1655.0 143989.0 870.0 | 138 File Copy 256 bufsize 500 maxblocks 1655.0 143989.0 870.0 |
131 File Copy 4096 bufsize 8000 maxblocks 5800.0 793041.0 1367.3 | 139 File Copy 4096 bufsize 8000 maxblocks 5800.0 793041.0 1367.3 |
132 Pipe Throughput 12440.0 1048491.9 842.8 | 140 Pipe Throughput 12440.0 1048491.9 842.8 |
133 Pipe-based Context Switching 4000.0 300778.3 751.9 | 141 Pipe-based Context Switching 4000.0 300778.3 751.9 |
134 Process Creation 126.0 11508.6 913.4 | 142 Process Creation 126.0 11508.6 913.4 |
135 Shell Scripts (8 concurrent) 6.0 1109.0 1848.3 | 143 Shell Scripts (8 concurrent) 6.0 1109.0 1848.3 |
136 System Call Overhead 15000.0 1427272.7 951.5 | 144 System Call Overhead 15000.0 1427272.7 951.5 |
137 ========= | 145 ========= |
138 FINAL SCORE 902.1 | 146 FINAL SCORE 902.1 |
139 """ | 147 """ |
OLD | NEW |