On Tue, Apr 16, 2019 at 04:55:16PM -0600, Mathieu Poirier wrote:
[...]
@@ -1649,6 +1720,11 @@ static int cs_etm__process_decoder_queue(struct cs_etm_queue *etmq) static int cs_etm__run_decoder(struct cs_etm_queue *etmq) { int err = 0;
- struct cs_etm_traceid_queue *tidq;
- tidq = cs_etm__etmq_get_traceid_queue(etmq, CS_ETM_PER_THREAD_TRACEID);
- if (!tidq)
return -EINVAL;
I am confused by this. For CPU wide trace case, since every CPU has its own trace id and the trace id is not the same with CS_ETM_PER_THREAD_TRACEID; if so we create the queue with trace id = CS_ETM_PER_THREAD_TRACEID, will this queue be redundant and cannot be used for any CPU in system?
Furthermore, we can see this 'tidq' will be always used by below decoding loop, should the 'tidq' be dynamically updated based on latest tracing data generated from different CPU?
Function cs_etm__run_decoder() is used only in cs_etm__process_timeless_queues(). For CPU-wide scenarios function cs_etm__process_queues() is called.
Ah, thanks for the explaination.
/* Go through each buffer in the queue and decode them one by one */ while (1) { @@ -1667,13 +1743,13 @@ static int cs_etm__run_decoder(struct cs_etm_queue *etmq) * an error occurs other than hoping the next one will * be better. */
err = cs_etm__process_decoder_queue(etmq);
err = cs_etm__process_traceid_queue(etmq, tidq);
} while (etmq->buf_len); if (err == 0) /* Flush any remaining branch stack entries */
err = cs_etm__end_block(etmq);
}err = cs_etm__end_block(etmq, tidq);
return err;