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 @@ -594,19 +594,25 @@ function generate_benchmark_definition(
594
594
__linux_perf_bench = BenchmarkTools. LinuxPerf. make_bench_threaded (
595
595
__linux_perf_groups; threads= $ (params. linux_perf_options. threads)
596
596
)
597
- BenchmarkTools. LinuxPerf. enable! (__linux_perf_bench)
598
- # We'll just run it one time.
599
- __return_val_2 = $ (invocation)
600
- BenchmarkTools. LinuxPerf. disable! (__linux_perf_bench)
601
- # trick the compiler not to eliminate the code
602
- if rand () < 0
603
- __linux_perf_stats = __return_val_2
604
- else
605
- __linux_perf_stats = BenchmarkTools. LinuxPerf. Stats (
606
- __linux_perf_bench
607
- )
597
+ try
598
+ BenchmarkTools. LinuxPerf. enable! (__linux_perf_bench)
599
+ # We'll just run it one time.
600
+ __return_val_2 = $ (invocation)
601
+ BenchmarkTools. LinuxPerf. disable! (__linux_perf_bench)
602
+ # trick the compiler not to eliminate the code
603
+ if rand () < 0
604
+ __linux_perf_stats = __return_val_2
605
+ else
606
+ __linux_perf_stats = BenchmarkTools. LinuxPerf. Stats (
607
+ __linux_perf_bench
608
+ )
609
+ end
610
+ catch
611
+ rethrow ()
612
+ finally
613
+ close (__linux_perf_bench)
614
+ $ (teardown)
608
615
end
609
- $ (teardown)
610
616
else
611
617
__return_val_2 = nothing
612
618
__linux_perf_stats = nothing
You can’t perform that action at this time.
0 commit comments