File tree Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -596,19 +596,25 @@ function generate_benchmark_definition(
596
596
__linux_perf_bench = BenchmarkTools. LinuxPerf. make_bench_threaded (
597
597
__linux_perf_groups; threads= $ (params. linux_perf_options. threads)
598
598
)
599
- BenchmarkTools. LinuxPerf. enable! (__linux_perf_bench)
600
- # We'll just run it one time.
601
- __return_val_2 = $ (invocation)
602
- BenchmarkTools. LinuxPerf. disable! (__linux_perf_bench)
603
- # trick the compiler not to eliminate the code
604
- if rand () < 0
605
- __linux_perf_stats = __return_val_2
606
- else
607
- __linux_perf_stats = BenchmarkTools. LinuxPerf. Stats (
608
- __linux_perf_bench
609
- )
599
+ try
600
+ BenchmarkTools. LinuxPerf. enable! (__linux_perf_bench)
601
+ # We'll just run it one time.
602
+ __return_val_2 = $ (invocation)
603
+ BenchmarkTools. LinuxPerf. disable! (__linux_perf_bench)
604
+ # trick the compiler not to eliminate the code
605
+ if rand () < 0
606
+ __linux_perf_stats = __return_val_2
607
+ else
608
+ __linux_perf_stats = BenchmarkTools. LinuxPerf. Stats (
609
+ __linux_perf_bench
610
+ )
611
+ end
612
+ catch
613
+ rethrow ()
614
+ finally
615
+ close (__linux_perf_bench)
616
+ $ (teardown)
610
617
end
611
- $ (teardown)
612
618
else
613
619
__return_val_2 = nothing
614
620
__linux_perf_stats = nothing
You can’t perform that action at this time.
0 commit comments