Skip to content

Commit

Permalink
Close LinuxPerf bench when done with it
Browse files Browse the repository at this point in the history
  • Loading branch information
Zentrik committed Dec 30, 2023
1 parent a350550 commit b48f5ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ function perf_available()
return false
end

bench = nothing
try
opts = LinuxPerf.parse_pstats_options([])
groups = BenchmarkTools.LinuxPerf.set_default_spaces(opts.events, opts.spaces)
bench = make_bench_threaded(groups; threads=opts.threads)
return true
catch
return false
finally
if !isnothing(bench)
close(bench)
end
end
end

Expand Down

0 comments on commit b48f5ce

Please sign in to comment.