[PATCH v2 15/23] coresight: trbe: Report truncated trace on buffer update errors

Suzuki K Poulose suzuki.poulose at arm.com
Wed Nov 11 02:47:10 PST 2026


On 16/10/2026 17:55, Leo Yan wrote:
> When arm_trbe_update_buffer() handles a pending interrupt that is
> not a wrap event, it discards the buffer by returning zero. The AUX
> output is not marked as truncated, so userspace is not informed of
> the lost trace.
> 
> Set PERF_AUX_FLAG_TRUNCATED before returning zero so perf reports
> the trace loss when closing the AUX output.
> 
> Signed-off-by: Leo Yan <leo.yan at arm.com>
> ---
>   drivers/hwtracing/coresight/coresight-trbe.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c
> index 1c585b6123df2f20d08747678d836742ce9564cc..ac49098aa08412a23a20d32f84c2e1977ee4a223 100644
> --- a/drivers/hwtracing/coresight/coresight-trbe.c
> +++ b/drivers/hwtracing/coresight/coresight-trbe.c
> @@ -903,6 +903,7 @@ static unsigned long arm_trbe_update_buffer(struct coresight_device *csdev,
>   		 * errors and as such buffer is empty.
>   		 */
>   		if (act != TRBE_FAULT_ACT_WRAP) {
> +			perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED);

Do we need this though ? If the buffer has space left, we shouldn't use
TRUNCATED. TRUNCATED causes the event to be stopped and the userspace
needs to re-enable the event.

Cheers
Suzuki

>   			size = 0;
>   			goto done;
>   		}
> 







More information about the linux-arm-kernel mailing list