Skip to content

Commit f08976a

Browse files
committed
programs/unixbench/parse: handle the output of graphical tests
Signed-off-by: Philip Li <[email protected]>
1 parent db55f15 commit f08976a

File tree

3 files changed

+34
-16
lines changed

3 files changed

+34
-16
lines changed

programs/unixbench/parse

+17-16
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,40 @@ require "#{LKP_SRC}/lib/log"
88
require "#{LKP_SRC}/lib/string_ext"
99
require 'time'
1010

11-
# Benchmark run time format displayed as below:
12-
# Benchmark Run: Tue Jan 01 2019 15:48:24 - 15:56:36
13-
1411
while (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
3940
end
4041

4142
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
4445
end
4546

4647
workload = duration * throughput

spec/stats/unixbench/03

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CPU 35: Intel(R) Core(TM) i9-10980XE CPU @ 3.00GHz (6000.0 bogomips)
2+
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
3+
03:49:06 up 0 min, 0 users, load average: 1.03, 0.24, 0.08; runlevel
4+
5+
------------------------------------------------------------------------
6+
Benchmark Run: Tue Feb 20 2024 03:49:06 - 03:53:47
7+
36 CPUs in system; running 1 parallel copy of tests
8+
9+
3D graphics: gears 3207.0 fps (20.0 s, 7 samples)
10+
11+
3D Graphics Benchmarks Index Values BASELINE RESULT INDEX
12+
3D graphics: gears 33.4 3207.0 960.2
13+
========
14+
3D Graphics Benchmarks Index Score 960.2

spec/stats/unixbench/03.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
score: 960.2
2+
throughput: 3207.0
3+
workload: 901167.0

0 commit comments

Comments
 (0)