[PATCH v2 20/23] coresight: trbe: Add fault action argument to trbe_handle_overflow()

James Clark james.clark at linaro.org
Tue Nov 10 07:34:53 PST 2026



On 16/10/2026 17:55, Leo Yan wrote:
> Add a new argument to trbe_handle_overflow() for the fault action, which
> is used to compare the wrap event for trace size calculation.
> 
> No functional change intended; this is preparation for a later update.
> 
> Signed-off-by: Leo Yan <leo.yan at arm.com>
> ---
>   drivers/hwtracing/coresight/coresight-trbe.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c
> index f1f102df6c387f53feaa12b89d3df89f734afcdb..c83c440d4ac13c346bc2a7f9093951c186c90157 100644
> --- a/drivers/hwtracing/coresight/coresight-trbe.c
> +++ b/drivers/hwtracing/coresight/coresight-trbe.c
> @@ -1132,7 +1132,8 @@ static void trbe_handle_spurious(struct trbe_cpudata *cpudata)
>   	set_trbe_enabled(cpudata, trblimitr);
>   }
>   
> -static int trbe_handle_overflow(struct trbe_cpudata *cpudata)
> +static int trbe_handle_overflow(struct trbe_cpudata *cpudata,
> +				enum trbe_fault_action act)
>   {
>   	struct perf_output_handle *handle = cpudata->handle;
>   	struct perf_event *event = handle->event;
> @@ -1147,7 +1148,7 @@ static int trbe_handle_overflow(struct trbe_cpudata *cpudata)
>   	 */
>   	clr_trbe_status();
>   
> -	size = trbe_get_trace_size(handle, buf, true);
> +	size = trbe_get_trace_size(handle, buf, act == TRBE_FAULT_ACT_WRAP);
>   	if (buf->snapshot)
>   		handle->head += size;
>   
> @@ -1253,7 +1254,7 @@ static irqreturn_t arm_trbe_irq_handler(int irq, void *dev)
>   	act = trbe_get_fault_act(handle, status);
>   	switch (act) {
>   	case TRBE_FAULT_ACT_WRAP:
> -		truncated = !!trbe_handle_overflow(cpudata);
> +		truncated = !!trbe_handle_overflow(cpudata, act);
>   		break;
>   	case TRBE_FAULT_ACT_SPURIOUS:
>   		trbe_handle_spurious(cpudata);
> 
Reviewed-by: James Clark <james.clark at linaro.org>



More information about the linux-arm-kernel mailing list