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