Re: [PATCH 3/6] perf cs-etm: Synthesize missing HW_ID mappings for raw trace

From: Leo Yan

Date: Fri Sep 04 2026 - 14:26:47 EST


On Fri, Aug 21, 2026 at 10:50:31AM +0100, James Clark wrote:

[...]

> +static int cs_etm__synth_unformatted_trace_ids(struct cs_etm_auxtrace *etm)
> +{
> + struct auxtrace_queues *queues = &etm->queues;
> +
> + for (unsigned int i = 0; i < queues->nr_queues; i++) {
> + struct auxtrace_queue *queue = &queues->queue_array[i];
> + struct cs_etm_queue *etmq = queue->priv;
> + u64 *cpu_data;
> + u8 trace_id;
> + int ret;
> +
> + if (list_empty(&queue->head) || !etmq || etmq->format != UNFORMATTED)
> + continue;
> +
> + if (!intlist__empty(etmq->traceid_list))
> + continue;
> +
> + cpu_data = get_cpu_data(etm, queue->cpu);
> + if (!cpu_data)
> + return -EINVAL;
> +
> + ret = cs_etm__metadata_get_trace_id(&trace_id, cpu_data);
> + if (ret)
> + return ret;

Since this is an unformatted queue, can we simply ignore the trace ID?
Instead of fetching it from the metadata, we could insert 0 to create
the trace ID list.

This would also align with future refactoring to remove trace ID
handling for unformatted queues.