Skip to content

Add an interface for using perf events to pause/resume aux tracing #330

@lnbrks

Description

@lnbrks

Recently, perf added support for starting and pausing aux-area tracing upon other perf events.

Some possible uses within magic-trace:

  • Starting/stopping the trace on breakpoint hit or on particular symbols using uprobe events (similar to (Filter events from after the stop indicator #81), (Filter trace to range #222)). Currently, this requires manually tuning the buffer size, creates excess PT data to post-process, and interacts poorly with multi-snapshot because of the extra PT data. Using this mechanism, "full execution" traces of long or repeated spans becomes viable out-of-the-box. AUX suspension/resumption occurs inside the uprobe call chain, so this is more precise than any alternative that would round-trip through magic-trace.
  • Capturing snapshots / ending traces upon kernel events, such as page faults. This isn't possible out-of-the-box today because we can't set breakpoints on kernel functions. This is more limited than using bpftrace with (Support magic-trace attach -p ... [cmd] syntax #230), less so if --filter does the magical thing we want. Also, this removes trace skid where skid is desirable in the absence of a perfect "return-to-userspace" kernel event.
  • Tracee-directed asynchronous trace start. Traces can be started upon timer expiration, IO completion, signal delivery, and so on, without PT overhead prior to the region of interest.

Ideally we would have nice, separate interfaces for these uses rather than just passing through flags (and maybe also a just-pass-through-my-flags interface).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions