[PATCH v2 15/23] coresight: trbe: Report truncated trace on buffer update errors
Suzuki K Poulose
suzuki.poulose at arm.com
Fri Nov 27 01:27:34 PST 2026
On 11/11/2026 16:05, Leo Yan wrote:
> On Wed, Nov 11, 2026 at 10:47:10AM +0000, Suzuki K Poulose wrote:
>
>>> @@ -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.
>
> Here setting TRUNCATED flag is intentional for fatal faults. The following
> patch restricts this handling to TRBE_FAULT_ACT_FATAL only.
>
> We can consider this from two perspectives:
>
> 1. We distinguish TRUNCATED from PARTIAL (see patch 23). PARTIAL
> indicates a recoverable trace gap without disabling the perf event,
> requiring tools to reset the decoder explicitly.
>
> In contrast, TRUNCATED streams contain ASYNC packets for decoder
> synchronization, so reset decoder is not needed.
>
> 2. The AUX sampling calls update buffer callback [1], any fatal faults
> will set TRUNCATED to disable hardware and waiting for userspace to
> re-enable.
>
> Thanks,
> Leo
>
> [1] https://lore.kernel.org/linux-arm-kernel/20260915-arm_cs_support_aux_sample-v1-16-35cf6f297d20@arm.com/
Fair enough,
Reviewed-by: Suzuki K Poulose <suzuki.poulose at arm.com>
More information about the linux-arm-kernel
mailing list