@@ -8,39 +8,40 @@ require "#{LKP_SRC}/lib/log"
88require "#{ LKP_SRC } /lib/string_ext"
99require 'time'
1010
11- # Benchmark run time format displayed as below:
12- # Benchmark Run: Tue Jan 01 2019 15:48:24 - 15:56:36
13-
1411while ( line = $stdin. gets )
15- line = line . resolve_invalid_bytes
12+ line = line . chomp . resolve_invalid_bytes
1613
17- case line . chomp!
14+ case line
1815 when /^Benchmark Run: .+ (\d +:\d +:\d +) - (\d +:\d +:\d +)$/
19- # We only care about the difference value between end time and start time
16+ # Benchmark Run: Tue Jan 01 2019 15:48:24 - 15:56:36
17+ # We only care about the difference value between end time and start time
2018 start_time = Time . parse ( $1) . to_f
2119 end_time = Time . parse ( $2) . to_f
2220 duration = if end_time > start_time
2321 end_time - start_time
2422 else
25- end_time + 3600 * 24 - start_time # date overflo
23+ end_time + 3600 * 24 - start_time # date overflow
2624 end
27- when /^System Benchmarks Partial Index .* INDEX$/
25+ when /^(System|2D Graphics|3D Graphics) Benchmarks .*Index .* INDEX$/
26+ # System Benchmarks Partial Index BASELINE RESULT INDEX
27+ # 2D Graphics Benchmarks Partial Index BASELINE RESULT INDEX
28+ # 3D Graphics Benchmarks Index Values BASELINE RESULT INDEX
2829 line = $stdin. gets
29- if line . chomp!
30- lines = line . split
31- throughput = lines [ -2 ] . to_f
32- end
30+ line = line . chomp . resolve_invalid_bytes
31+
32+ throughput = line . split [ -2 ] . to_f unless line . empty?
3333 when /^.+? ([\d .]+) KBps\s +\( [\d .]+ s, \d + samples?\) /
3434 # File Write 1024 bufsize 2000 maxblocks 3121976.0 KBps (30.0 s, 7 samples)
35+ # File Read 1024 bufsize 2000 maxblocks 438625975.6 KBps (30.0 s, 7 samples)
3536 throughput = $1. to_f
36- when /^System Benchmarks Index Score .* ([0-9.]+)$/
37- score = $1
37+ when /^( System|2D Graphics|3D Graphics) Benchmarks Index Score .* ([0-9.]+)$/
38+ score = $2
3839 end
3940end
4041
4142if duration . nil? || throughput . nil?
42- log_error 'unixbench: missing duration or throughput'
43- exit
43+ log_error 'miss duration or throughput'
44+ exit 1
4445end
4546
4647workload = duration * throughput
0 commit comments