Skip to content

Add Intel PT AUX trace range support - #386

Draft
namtran1812 wants to merge 1 commit into
janestreet:masterfrom
namtran1812:feature/perf-aux-action
Draft

Add Intel PT AUX trace range support#386
namtran1812 wants to merge 1 commit into
janestreet:masterfrom
namtran1812:feature/perf-aux-action

Conversation

@namtran1812

Copy link
Copy Markdown

Summary

Add record-time Intel PT range gating using perf AUX actions.

This introduces -aux-range "(START STOP)", which resolves the selected symbols to runtime addresses and configures perf so that:

  • Intel PT starts paused
  • hitting START resumes AUX tracing
  • hitting STOP pauses AUX tracing

The control events are emitted in the same perf event group as the Intel PT source.

Motivation

magic-trace currently relies on userspace snapshot/control paths for trigger-based workflows. perf's AUX pause/resume support allows tracing to be gated directly by perf events, avoiding unnecessary trace collection outside the selected region.

Implementation

  • add typed AUX actions (start-paused, resume, pause)
  • add breakpoint-backed AUX control events
  • resolve AUX range symbols using the existing ELF/runtime address path
  • support both run and attach
  • reject AUX ranges when stacktrace sampling is selected
  • add serialization and generated-perf-argument expect tests

Validation

  • dune build @fmt passes locally
  • git diff --check passes locally
  • full tests cannot run on macOS because the locked dependency graph includes Linux-only Jane Street dependencies

Opening as draft to validate the full Linux build/test suite before marking ready.

Signed-off-by: namtran1812 <158846154+namtran1812@users.noreply.github.com>
@namtran1812
namtran1812 force-pushed the feature/perf-aux-action branch from b268390 to 95bb6c6 Compare August 14, 2026 21:23
@namtran1812

Copy link
Copy Markdown
Author

Draft for validation: DCO is passing, but the Linux build workflow is currently blocked before any jobs are created, so I haven't received a compile/test result yet. I'll keep this in draft until CI and Intel PT validation are complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant