File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,24 @@ mutable struct Parameters
19
19
linux_perf_options: :@NamedTuple {events:: Expr , spaces:: Expr , threads:: Bool }
20
20
end
21
21
22
- # TODO : determine whether perf is available
22
+ function perf_available ()
23
+ if ! Sys. islinux ()
24
+ return false
25
+ end
26
+
27
+ try
28
+ opts = LinuxPerf. parse_pstats_options ([])
29
+ groups = BenchmarkTools. LinuxPerf. set_default_spaces (
30
+ opts. events,
31
+ opts. spaces,
32
+ )
33
+ bench = make_bench_threaded (groups, threads = opts. threads)
34
+ return true
35
+ catch
36
+ return false
37
+ end
38
+ end
39
+
23
40
const DEFAULT_PARAMETERS = Parameters (
24
41
5.0 ,
25
42
10000 ,
@@ -30,7 +47,7 @@ const DEFAULT_PARAMETERS = Parameters(
30
47
false ,
31
48
0.05 ,
32
49
0.01 ,
33
- Sys . islinux (),
50
+ perf_available (),
34
51
LinuxPerf. parse_pstats_options ([]),
35
52
)
36
53
You can’t perform that action at this time.
0 commit comments