On Wed, Apr 03, 2019 at 06:13:17PM +0800, Leo Yan wrote:
On Wed, Mar 06, 2019 at 03:59:33PM -0700, Mathieu Poirier wrote:
[...]
+static struct cs_etm_traceid_queue +*cs_etm__etmq_get_traceid_queue(struct cs_etm_queue *etmq, u8 trace_chan_id) +{
- struct cs_etm_traceid_queue *tidq;
- struct cs_etm_auxtrace *etm = etmq->etm;
- if (!etm->timeless_decoding)
return NULL;
Should be as below:
if (etm->timeless_decoding) return NULL;
You are a shrewd reviewer :o)
At that stage in the patchset only per-thread mode (i.e.timeless decoding) is supported, hence returning an error is something else if found. This is to make sure per-thead scenarios work if a bisect is performed.
Later in 14/18 the code is fixed to accomodate both per-thread and CPU-wide scenarios.
Thanks for taking a look at this, Mathieu
- tidq = etmq->traceid_queues;
- if (tidq)
return tidq;
- tidq = calloc(CS_ETM_PACKET_QUEUE_NR, sizeof(*tidq));
- if (!tidq)
return NULL;
- if (cs_etm__init_traceid_queue(etmq, tidq, trace_chan_id))
goto out_free;
- etmq->traceid_queues = tidq;
- return etmq->traceid_queues;
+out_free:
- free(tidq);
- return NULL;
+}
[...]