Skip to content

Commit a568a66

Browse files
committed
Add deserialisation support for linux perf parameters
1 parent 2600cfe commit a568a66

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/serialization.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,22 @@ function recover(x::Vector)
6060
# JSON spec doesn't support Inf
6161
# These fields should all be >= 0, so we can ignore -Inf case
6262
typemax(ft)
63+
elseif fn == "enable_linux_perf" && !haskey(fields, fn)
64+
false
65+
elseif fn in (
66+
"linux_perf_groups",
67+
"linux_perf_spaces",
68+
"linux_perf_threads",
69+
"linux_perf_gcscrub",
70+
) && !haskey(fields, fn)
71+
getfield(BenchmarkTools.DEFAULT_PARAMETERS, Symbol(fn))
72+
elseif fn == "linux_perf_spaces" && haskey(fields, fn)
73+
length(fields[fn]) == 3 || throw(
74+
ArgumentError(
75+
"Expecting a vector of length 3 for linux_perf_spaces parameter",
76+
),
77+
)
78+
xsi = convert(ft, (fields[fn][1], fields[fn][2], fields[fn][3]))
6379
else
6480
convert(ft, fields[fn])
6581
end

0 commit comments

Comments
 (0)