@@ -319,24 +319,29 @@ module Recording = struct
319
319
|> Deferred. return
320
320
in
321
321
let kcore_opts =
322
- match
323
- collection_mode, trace_scope, Perf_capabilities. (do_intersect capabilities kcore)
324
- with
325
- | Intel_processor_trace _ , Userspace , _ | Stacktrace_sampling _ , _ , _ -> []
326
- | Intel_processor_trace _ , (Kernel | Userspace_and_kernel ), true -> [ " --kcore" ]
327
- | Intel_processor_trace _ , (Kernel | Userspace_and_kernel ), false ->
328
- (* Strictly speaking, we could recreate tools/perf/perf-with-kcore.sh
329
- here instead of bailing. But that's tricky, and upgrading to a newer
330
- perf is easier. *)
331
- Core. eprintf
332
- " Warning: old perf version detected! perf userspace tools v5.5 contain an \
333
- important feature, kcore, that make decoding kernel traces more reliable. In \
334
- our experience, tracing the kernel mostly works without this feature, but you \
335
- may run into problems if you're trying to trace through self-modifying code \
336
- (the kernel may do this more than you think). Install a perf version >= 5.5 \
337
- to avoid this.\n \
338
- %!" ;
339
- []
322
+ if Env_vars. perf_no_kcore
323
+ then []
324
+ else (
325
+ match
326
+ ( collection_mode
327
+ , trace_scope
328
+ , Perf_capabilities. (do_intersect capabilities kcore) )
329
+ with
330
+ | Intel_processor_trace _ , Userspace , _ | Stacktrace_sampling _ , _ , _ -> []
331
+ | Intel_processor_trace _ , (Kernel | Userspace_and_kernel ), true -> [ " --kcore" ]
332
+ | Intel_processor_trace _ , (Kernel | Userspace_and_kernel ), false ->
333
+ (* Strictly speaking, we could recreate tools/perf/perf-with-kcore.sh
334
+ here instead of bailing. But that's tricky, and upgrading to a newer
335
+ perf is easier. *)
336
+ Core. eprintf
337
+ " Warning: old perf version detected! perf userspace tools v5.5 contain an \
338
+ important feature, kcore, that make decoding kernel traces more reliable. \
339
+ In our experience, tracing the kernel mostly works without this feature, \
340
+ but you may run into problems if you're trying to trace through \
341
+ self-modifying code (the kernel may do this more than you think). Install a \
342
+ perf version >= 5.5 to avoid this.\n \
343
+ %!" ;
344
+ [] )
340
345
in
341
346
let snapshot_size_opt =
342
347
match snapshot_size, collection_mode with
0 commit comments