[PATCH v2 15/23] coresight: trbe: Report truncated trace on buffer update errors
From: Leo Yan
Date: Fri Oct 16 2026 - 13:28:34 EST
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@xxxxxxx>
---
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);
size = 0;
goto done;
}
--
2.34.1