Strategy. OpenTelemetry (otel feature, in v0.0.44) gives application-level spans. eBPF gives kernel-level attribution without changing source code, and answers "where is the build pipeline spending wall-clock time" with zero overhead when probes are detached. Pairs with #422.
Files
- New:
tools/ebpf/build-trace.bt — bpftrace script that aggregates wall-time per plugin.
- Edit:
src/core/pipeline.rs — add USDT probes (usdt::probe!(ssg, plugin_enter, plugin_name) and matching plugin_exit).
- New:
Cargo.toml dep usdt = { version = "0.5", optional = true } under feature usdt-probes (off by default).
- New:
docs/ebpf.md documenting reproduction.
Why two layers (otel + usdt). otel is portable + downstream-friendly. usdt/eBPF is Linux-only and root-required, but gives flame-graph-compatible attribution without code changes and no allocation overhead.
Acceptance criteria
sudo bpftrace tools/ebpf/build-trace.bt -c 'ssg build' produces a per-plugin histogram on Linux 6.x.
- Output is flame-graph-compatible (collapsed-stack format).
- Default-feature build is byte-identical to v0.0.49 (USDT only emits when feature is on).
Limitation. Linux-only, requires root. Documented as a power-user tool, not a default workflow.
Strategy. OpenTelemetry (
otelfeature, in v0.0.44) gives application-level spans. eBPF gives kernel-level attribution without changing source code, and answers "where is the build pipeline spending wall-clock time" with zero overhead when probes are detached. Pairs with #422.Files
tools/ebpf/build-trace.bt—bpftracescript that aggregates wall-time per plugin.src/core/pipeline.rs— add USDT probes (usdt::probe!(ssg, plugin_enter, plugin_name)and matchingplugin_exit).Cargo.tomldepusdt = { version = "0.5", optional = true }under featureusdt-probes(off by default).docs/ebpf.mddocumenting reproduction.Why two layers (
otel+usdt).otelis portable + downstream-friendly.usdt/eBPF is Linux-only and root-required, but gives flame-graph-compatible attribution without code changes and no allocation overhead.Acceptance criteria
sudo bpftrace tools/ebpf/build-trace.bt -c 'ssg build'produces a per-plugin histogram on Linux 6.x.Limitation. Linux-only, requires root. Documented as a power-user tool, not a default workflow.