Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: client/tests/unixbench5/unixbench5.py

Issue 6246035: Merge remote branch 'cros/upstream' into master (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 import os, re
2 from autotest_lib.client.bin import test, utils
3 from autotest_lib.client.common_lib import error
4
5
6 class unixbench5(test.test):
7 """
8 This test measure system wide performance by running the following tests:
9 - Dhrystone - focuses on string handling.
10 - Whetstone - measure floating point operations.
11 - Execl Throughput - measure the number of execl calls per second.
12 - File Copy
13 - Pipe throughput
14 - Pipe-based context switching
15 - Process creation - number of times a process can fork and reap
16 - Shell Scripts - number of times a process can start and reap a script
17 - System Call Overhead - estimates the cost of entering and leaving the
18 kernel.
19
20 @see: http://code.google.com/p/byte-unixbench/
21 @author: Dale Curtis <dalecurtis@google.com>
22 """
23 version = 1
24
25
26 def initialize(self):
27 self.job.require_gcc()
28 self.err = []
29
30
31 def setup(self, tarball='unixbench-5.1.3.tgz'):
32 """
33 Compiles unixbench.
34
35 @tarball: Path or URL to a unixbench tarball
36 @see: http://byte-unixbench.googlecode.com/files/unixbench-5.1.3.tgz
37 """
38 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
39 utils.extract_tarball_to_dir(tarball, self.srcdir)
40 os.chdir(self.srcdir)
41
42 utils.system('patch -p0 < ../Makefile.patch')
43 utils.make()
44
45
46 def run_once(self, args=''):
47 vars = 'UB_TMPDIR="%s" UB_RESULTDIR="%s"' % (self.tmpdir,
48 self.resultsdir)
49 os.chdir(self.srcdir)
50 self.report_data = utils.system_output(vars + ' ./Run ' + args)
51 self.results_path = os.path.join(self.resultsdir,
52 'raw_output_%s' % self.iteration)
53 utils.open_write_close(self.results_path, self.report_data)
54
55
56 def cleanup(self):
57 """
58 Check error index list and throw TestError if necessary.
59 """
60 if self.err:
61 e_msg = ("No measured results for output lines: %s\nOutput:%s" %
62 (" ".join(self.err), self.report_data))
63 raise error.TestError(e_msg)
64
65
66 def process_section(self, section, suffix):
67 keyval = {}
68 subsections = section.split('\n\n')
69
70 if len(subsections) < 3:
71 raise error.TestError('Invalid output format. Unable to parse')
72
73 # Process the subsection containing performance results first.
74 for index, line in enumerate(subsections[1].strip().split('\n')):
75 # Look for problems first.
76 if re.search('no measured results', line, flags=re.IGNORECASE):
77 self.err.append(str(index + 1))
78
79 # Every performance result line ends with 6 values, with the sixth
80 # being the actual result. Make sure there are at least that words
81 # in the line before processing.
82 words = line.lower().split()
83 if len(words) >= 6:
84 key = re.sub('\W', '', '_'.join(words[:-6]))
85 keyval[key + suffix] = words[-6]
86
87 # The final score should be the last item in the third subsection.
88 keyval['score' + suffix] = subsections[2].strip().split()[-1]
89
90 self.write_perf_keyval(keyval)
91
92
93 def postprocess_iteration(self):
94 # Break up sections around dividing lines.
95 sections = self.report_data.split('-'*72)
96
97 # First section is junk to us, second has results for single CPU run.
98 if len(sections) > 1:
99 self.process_section(section=sections[1], suffix='')
100
101 # Only machines with > 1 CPU will have a 3rd section.
102 if len(sections) > 2:
103 self.process_section(section=sections[2], suffix='_multi')
104 else:
105 raise error.TestError('Invalid output format. Unable to parse')
106
107
108 """ Here is a sample output:
109
110 # # # # # # # ##### ###### # # #### # #
111 # # ## # # # # # # # ## # # # # #
112 # # # # # # ## ##### ##### # # # # ######
113 # # # # # # ## # # # # # # # # #
114 # # # ## # # # # # # # ## # # # #
115 #### # # # # # ##### ###### # # #### # #
116
117 Version 5.1.2 Based on the Byte Magazine Unix Benchmark
118
119 Multi-CPU version Version 5 revisions by Ian Smith,
120 Sunnyvale, CA, USA
121 December 22, 2007 johantheghost at yahoo period com
122
123
124 1 x Dhrystone 2 using register variables 1 2 3 4 5 6 7 8 9 10
125
126 1 x Double-Precision Whetstone 1 2 3 4 5 6 7 8 9 10
127
128 1 x Execl Throughput 1 2 3
129
130 1 x File Copy 1024 bufsize 2000 maxblocks 1 2 3
131
132 1 x File Copy 256 bufsize 500 maxblocks 1 2 3
133
134 1 x File Copy 4096 bufsize 8000 maxblocks 1 2 3
135
136 1 x Pipe Throughput 1 2 3 4 5 6 7 8 9 10
137
138 1 x Pipe-based Context Switching 1 2 3 4 5 6 7 8 9 10
139
140 1 x Process Creation 1 2 3
141
142 1 x System Call Overhead 1 2 3 4 5 6 7 8 9 10
143
144 1 x Shell Scripts (1 concurrent) 1 2 3
145
146 1 x Shell Scripts (8 concurrent) 1 2 3
147
148 2 x Dhrystone 2 using register variables 1 2 3 4 5 6 7 8 9 10
149
150 2 x Double-Precision Whetstone 1 2 3 4 5 6 7 8 9 10
151
152 2 x Execl Throughput 1 2 3
153
154 2 x File Copy 1024 bufsize 2000 maxblocks 1 2 3
155
156 2 x File Copy 256 bufsize 500 maxblocks 1 2 3
157
158 2 x File Copy 4096 bufsize 8000 maxblocks 1 2 3
159
160 2 x Pipe Throughput 1 2 3 4 5 6 7 8 9 10
161
162 2 x Pipe-based Context Switching 1 2 3 4 5 6 7 8 9 10
163
164 2 x Process Creation 1 2 3
165
166 2 x System Call Overhead 1 2 3 4 5 6 7 8 9 10
167
168 2 x Shell Scripts (1 concurrent) 1 2 3
169
170 2 x Shell Scripts (8 concurrent) 1 2 3
171
172 ========================================================================
173 BYTE UNIX Benchmarks (Version 5.1.2)
174
175 System: localhost: GNU/Linux
176 OS: GNU/Linux -- 2.6.32.26+drm33.12 -- #1 SMP Wed Jan 12 16:16:05 PST 2011
177 Machine: i686 (GenuineIntel)
178 Language: en_US.utf8 (charmap=, collate=)
179 CPU 0: Intel(R) Atom(TM) CPU N455 @ 1.66GHz (3325.2 bogomips)
180 Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT
181 CPU 1: Intel(R) Atom(TM) CPU N455 @ 1.66GHz (3325.0 bogomips)
182 Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT
183 14:11:59 up 1 day, 1:10, 0 users, load average: 0.47, 0.48, 0.51; runlevel
184
185 ------------------------------------------------------------------------
186 Benchmark Run: Fri Jan 14 2011 14:11:59 - 14:41:26
187 2 CPUs in system; running 1 parallel copy of tests
188
189 Dhrystone 2 using register variables 2264000.6 lps (10.0 s, 7 samples)
190 Double-Precision Whetstone 507.0 MWIPS (10.1 s, 7 samples)
191 Execl Throughput 796.7 lps (30.0 s, 2 samples)
192 File Copy 1024 bufsize 2000 maxblocks 110924.1 KBps (30.1 s, 2 samples)
193 File Copy 256 bufsize 500 maxblocks 32600.5 KBps (30.1 s, 2 samples)
194 File Copy 4096 bufsize 8000 maxblocks 284236.5 KBps (30.0 s, 2 samples)
195 Pipe Throughput 301672.5 lps (10.0 s, 7 samples)
196 Pipe-based Context Switching 29475.3 lps (10.0 s, 7 samples)
197 Process Creation 3124.6 lps (30.0 s, 2 samples)
198 Shell Scripts (1 concurrent) 1753.0 lpm (60.0 s, 2 samples)
199 Shell Scripts (8 concurrent) 305.9 lpm (60.1 s, 2 samples)
200 System Call Overhead 592781.7 lps (10.0 s, 7 samples)
201
202 System Benchmarks Index Values BASELINE RESULT INDEX
203 Dhrystone 2 using register variables 116700.0 2264000.6 194.0
204 Double-Precision Whetstone 55.0 507.0 92.2
205 Execl Throughput 43.0 796.7 185.3
206 File Copy 1024 bufsize 2000 maxblocks 3960.0 110924.1 280.1
207 File Copy 256 bufsize 500 maxblocks 1655.0 32600.5 197.0
208 File Copy 4096 bufsize 8000 maxblocks 5800.0 284236.5 490.1
209 Pipe Throughput 12440.0 301672.5 242.5
210 Pipe-based Context Switching 4000.0 29475.3 73.7
211 Process Creation 126.0 3124.6 248.0
212 Shell Scripts (1 concurrent) 42.4 1753.0 413.4
213 Shell Scripts (8 concurrent) 6.0 305.9 509.8
214 System Call Overhead 15000.0 592781.7 395.2
215 ========
216 System Benchmarks Index Score 238.0
217
218 ------------------------------------------------------------------------
219 Benchmark Run: Fri Jan 14 2011 14:41:26 - 15:09:23
220 2 CPUs in system; running 2 parallel copies of tests
221
222 Dhrystone 2 using register variables 3411919.6 lps (10.0 s, 7 samples)
223 Double-Precision Whetstone 964.3 MWIPS (10.1 s, 7 samples)
224 Execl Throughput 2053.5 lps (30.0 s, 2 samples)
225 File Copy 1024 bufsize 2000 maxblocks 158308.0 KBps (30.0 s, 2 samples)
226 File Copy 256 bufsize 500 maxblocks 46249.5 KBps (30.0 s, 2 samples)
227 File Copy 4096 bufsize 8000 maxblocks 389881.9 KBps (30.0 s, 2 samples)
228 Pipe Throughput 410193.1 lps (10.0 s, 7 samples)
229 Pipe-based Context Switching 113780.0 lps (10.0 s, 7 samples)
230 Process Creation 7609.0 lps (30.0 s, 2 samples)
231 Shell Scripts (1 concurrent) 2355.0 lpm (60.0 s, 2 samples)
232 Shell Scripts (8 concurrent) 308.1 lpm (60.2 s, 2 samples)
233 System Call Overhead 1057063.2 lps (10.0 s, 7 samples)
234
235 System Benchmarks Index Values BASELINE RESULT INDEX
236 Dhrystone 2 using register variables 116700.0 3411919.6 292.4
237 Double-Precision Whetstone 55.0 964.3 175.3
238 Execl Throughput 43.0 2053.5 477.6
239 File Copy 1024 bufsize 2000 maxblocks 3960.0 158308.0 399.8
240 File Copy 256 bufsize 500 maxblocks 1655.0 46249.5 279.5
241 File Copy 4096 bufsize 8000 maxblocks 5800.0 389881.9 672.2
242 Pipe Throughput 12440.0 410193.1 329.7
243 Pipe-based Context Switching 4000.0 113780.0 284.5
244 Process Creation 126.0 7609.0 603.9
245 Shell Scripts (1 concurrent) 42.4 2355.0 555.4
246 Shell Scripts (8 concurrent) 6.0 308.1 513.5
247 System Call Overhead 15000.0 1057063.2 704.7
248 ========
249 System Benchmarks Index Score 407.4
250
251 """
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698