[PATCH 15/25] coresight: perf: Serialize AUX pause and resume with event stops

James Clark james.clark at linaro.org
Mon Oct 19 06:02:23 PDT 2026



On 15/09/2026 16:49, Leo Yan wrote:
> A PMU NMI can throttle a group during an AUX pause or resume, stopping
> its CoreSight event before the callback finishes. The callback can then
> restart tracing or reopen an AUX output handle after teardown.
> 
> Use per-CPU atomic STOP and AUX bits to serialize these callbacks. Reject
> AUX operations while a stop is pending and defer stops until an active
> AUX operation finishes. Complete deferred stops through etm_event_stop()
> and set PERF_HES_STOPPED only after disabling the source and path.
> 
> Assisted-by: Codex:gpt-6
> Signed-off-by: Leo Yan <leo.yan at arm.com>
> ---
>   drivers/hwtracing/coresight/coresight-etm-perf.c | 104 ++++++++++++++++++-----
>   1 file changed, 84 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c
> index 8f803914e9abfb18e080ff68371ad8b32042f180..8020a4d8af18bb669441824cfdb687f4fa299eb4 100644
> --- a/drivers/hwtracing/coresight/coresight-etm-perf.c
> +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c
> @@ -4,6 +4,7 @@
>    * Author: Mathieu Poirier <mathieu.poirier at linaro.org>
>    */
>   
> +#include <linux/atomic.h>
>   #include <linux/bitfield.h>
>   #include <linux/coresight.h>
>   #include <linux/coresight-pmu.h>
> @@ -26,6 +27,9 @@
>   #include "coresight-syscfg.h"
>   #include "coresight-trace-id.h"
>   
> +#define ETM_PERF_ACT_STOP		BIT(0)
> +#define ETM_PERF_ACT_AUX		BIT(1)

No comments other than naming. But would PAUSE_RESUME be better than 
AUX, or at least add a comment? It's a bit ambiguous what AUX means, and 
etm_event_aux_begin() is very close to perf_aux_output_begin(). Or maybe 
ACTION?

Reviewed-by: James Clark <james.clark at linaro.org>




More information about the linux-arm-kernel mailing list