@@ -8,39 +8,40 @@ require "#{LKP_SRC}/lib/log"
8
8
require "#{ LKP_SRC } /lib/string_ext"
9
9
require 'time'
10
10
11
- # Benchmark run time format displayed as below:
12
- # Benchmark Run: Tue Jan 01 2019 15:48:24 - 15:56:36
13
-
14
11
while ( line = $stdin. gets )
15
- line = line . resolve_invalid_bytes
12
+ line = line . chomp . resolve_invalid_bytes
16
13
17
- case line . chomp!
14
+ case line
18
15
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
20
18
start_time = Time . parse ( $1) . to_f
21
19
end_time = Time . parse ( $2) . to_f
22
20
duration = if end_time > start_time
23
21
end_time - start_time
24
22
else
25
- end_time + 3600 * 24 - start_time # date overflo
23
+ end_time + 3600 * 24 - start_time # date overflow
26
24
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
28
29
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?
33
33
when /^.+? ([\d .]+) KBps\s +\( [\d .]+ s, \d + samples?\) /
34
34
# 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)
35
36
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
38
39
end
39
40
end
40
41
41
42
if duration . nil? || throughput . nil?
42
- log_error 'unixbench: missing duration or throughput'
43
- exit
43
+ log_error 'miss duration or throughput'
44
+ exit 1
44
45
end
45
46
46
47
workload = duration * throughput
0 commit comments