Skip to content

feat(obs): eBPF/usdt build-trace probes for per-plugin wall-time attribution #582

Description

@sebastienrousseau

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.btbpftrace 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions