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