1#![allow(clippy::too_many_arguments, reason = "buildstructor")]
2#![allow(
3 unexpected_cfgs,
4 reason = "https://github.com/BrynCooke/buildstructor/issues/192"
5)]
67use std::path::PathBuf;
89use inferno::collapse::dtrace::Options as DtraceOptions;
10use inferno::collapse::perf::Options as PerfOptions;
1112type FlamegraphOptions = inferno::flamegraph::Options<'static>;
1314#[derive(Clone, buildstructor::Builder)]
15#[non_exhaustive] // Prevent direct construction.
16pub struct TracingOptions {
17/// Samples per second.
18pub frequency: u32,
1920/// Output filename for `dtrace`. Example: `my_worker.stacks`.
21pub dtrace_outfile: Option<PathBuf>,
2223/// Output filename for the raw data emitted by `perf record`. Example: `my_worker.perf.data`.
24pub perf_raw_outfile: Option<PathBuf>,
2526// /// Output filename for `perf script -i <`[`Self::perf_raw_outfile`]`>`. Example: `my_worker.perf`.
27 // pub perf_script_outfile: Option<PathBuf>,
28/// If set, what the write the folded output to.
29pub fold_outfile: Option<PathBuf>,
30pub fold_dtrace_options: Option<DtraceOptions>,
31pub fold_perf_options: Option<PerfOptions>,
32/// If set, what to write the output flamegraph SVG file to.
33pub flamegraph_outfile: Option<PathBuf>,
34// This type is super annoying and isn't `clone` and has a lifetime... so wrap in fn pointer for now.
35pub flamegraph_options: Option<fn() -> FlamegraphOptions>,
36}