Skip to content

Commit dc0726a

Browse files
committed
Clean up and format
1 parent 38c2b95 commit dc0726a

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

src/parameters.jl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,8 @@ function perf_available()
2626

2727
try
2828
opts = LinuxPerf.parse_pstats_options([])
29-
groups = BenchmarkTools.LinuxPerf.set_default_spaces(
30-
opts.events,
31-
opts.spaces,
32-
)
33-
bench = make_bench_threaded(groups, threads = opts.threads)
29+
groups = BenchmarkTools.LinuxPerf.set_default_spaces(opts.events, opts.spaces)
30+
bench = make_bench_threaded(groups; threads=opts.threads)
3431
return true
3532
catch
3633
return false
@@ -139,9 +136,9 @@ function Base.copy(p::Parameters)
139136
p.memory_tolerance,
140137
p.experimental_enable_linux_perf,
141138
(
142-
events = copy(p.linux_perf_options.events),
143-
spaces = copy(p.linux_perf_options.spaces),
144-
threads = copy(p.linux_perf_options.threads)
139+
events=copy(p.linux_perf_options.events),
140+
spaces=copy(p.linux_perf_options.spaces),
141+
threads=copy(p.linux_perf_options.threads),
145142
),
146143
)
147144
end

src/serialization.jl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,17 @@ Base.convert(::Type{LinuxPerf.Stats}, d::Dict{String}) = LinuxPerf.Stats(d["thre
4040
function Base.convert(::Type{LinuxPerf.ThreadStats}, d::Dict{String})
4141
return LinuxPerf.ThreadStats(d["pid"], d["groups"])
4242
end
43-
JSON.lower(counter::LinuxPerf.Counter) = [counter.event.category, counter.event.event, counter.value, counter.enabled, counter.running]
43+
function JSON.lower(counter::LinuxPerf.Counter)
44+
return [
45+
counter.event.category,
46+
counter.event.event,
47+
counter.value,
48+
counter.enabled,
49+
counter.running,
50+
]
51+
end
4452
function Base.convert(::Type{LinuxPerf.Counter}, v::Vector)
45-
return LinuxPerf.Counter(
46-
LinuxPerf.EventType(v[1], v[2]),
47-
v[3],
48-
v[4],
49-
v[5],
50-
)
53+
return LinuxPerf.Counter(LinuxPerf.EventType(v[1], v[2]), v[3], v[4], v[5])
5154
end
5255

5356
# a minimal 'eval' function, mirroring KeyTypes, but being slightly more lenient
@@ -182,7 +185,7 @@ function load(io::IO, args...)
182185
),
183186
)
184187
end
185-
parsed = JSON.parse(io; dicttype=Dict)
188+
parsed = JSON.parse(io)
186189
if !isa(parsed, Vector) ||
187190
length(parsed) != 2 ||
188191
!isa(parsed[1], Dict) ||

src/trials.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ mutable struct TrialEstimate
134134
end
135135

136136
function TrialEstimate(trial::Trial, t, gct)
137-
return TrialEstimate(params(trial), t, gct, memory(trial), allocs(trial), trial.linux_perf_stats)
137+
return TrialEstimate(
138+
params(trial), t, gct, memory(trial), allocs(trial), trial.linux_perf_stats
139+
)
138140
end
139141

140142
# Should we compare linux_perf_stats here?

0 commit comments

Comments
 (0)