Re: [RFC] perf: SW strobing for AUX trace windows

From: Leo Yan

Date: Mon Nov 23 2026 - 12:56:19 EST


On Thu, Nov 12, 2026 at 11:41:18PM -0800, Amir Ayupov wrote:

[...]

> pmu_pulse (coresight-only)
> ----------------------------------------------
>
> The first attempt was to try to avoid perf/core entirely, and extend
> a coresight config with pulsing ETE external output on every cycle
> while tracing is enabled [1]. This way, pause event on TRCEXTOUTn
> ends the window after exacly N traced cycles. The use of ETE external
> output is pure coincidence, just a way to count cycles only while
> tracing is enabled.
>
> However, the review has raised that the config is not self-contained
> and requires a lot of checks to only enable it on capable HW:
> - needs a helper in the arm64 PMUv3 header and a move of PMU
> definitions - needs arm64 maintainer's approval;
> - only works on ETE whose PMU counts TRCEXTOUTn,
> - the window is always measured in traced cycles;
> - is restricted to ETM, doesn't help Intel PT,
> - the further it is from a pure config change, the less understanding
> I have to support the patch series further.
>
> I decided to abandon that approach and ask for a better/more general
> solution, hence this RFC.

I saw you have sent CoreSight and PMU pulse v6, I will review it.
It is a good improvement for me.

> Option 3: cross-event "arming" (attr.aux_pause_armed)
> ---------------------------------------------------------------------
>
> This extends aux-action with a new bit (aux_pause_armed):
> - aux pause event period is set in an overflow of aux resume in group,
> - restarts from the full period,
> - on overflow, pauses aux tracing:
>
> This is the most flexible and general solution:
> ```
> # resume every 10M cycles, trace 5000 cycles
> -e '{cs_etm/aux-action=start-paused/,
> cycles/aux-action=resume,period=10000000/,
> cycles/aux-action=pause-armed,period=5000,call-graph=fp/}'
>
> # resume on page faults, trace 100k instructions
> -e '{intel_pt/aux-action=start-paused/,
> page-faults/aux-action=resume/,
> instructions/aux-action=pause-armed,period=100000/}'
> ```

I am just wandering if we can extend a bit "aux-action" syntax to
support delta value, something like:

-e '{cs_etm/aux-action=start-paused/,
cycles/aux-action=resume,period=10000000/,
cycles/aux-action=pause,period=+5000,call-graph=fp/}'

The + symbol indicates that the pause event occurs 5,000 cycles after
the resume event.

> Cons:
> 1. the core has to keep a disarmed event stopped across group
> scheduling, throttling, ioc_period, power mgmt.
> 2. rearming happens in the overflow handler (in NMI/IRQ).
> 3. Software pause events are not supported.

Why here software pause event cannot be supported?

> Question
> ---------
>
> Does it sound reasonable for perf to support this, or it's better
> to pursue pt/coresight-specific solutions? In the end, my use case
> is about tracing.

I think you are asking perf core maintainers to explore a proper way to
move forward. If no feedback, it is good to send RFC series to
demonstrate idea if you have a preference.

> If yes, which option is preferable?
> - Option 1 with restoring first period behavior that was already there,
> - option 2 as cleaner fix,
> - option 3 as completely general but with more core state to track,
> - something else?

Seems to me, if we extend a bit with "+" syntax, this can be general
enough to benefit all AUX trace. And we don't need to introduce extra
new interface.

Thanks,
Leo