Function cs_etm__get_trace() picks up a single buffer from the current
queue. As such when multiple buffers are present in the queue several
iteration of the fetch-decode block need to be run in order to process
all the trace data.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
buff->len = sizeof(cstrace);
buff->buf = cstrace;
*/
buff->len = sizeof(cstrace);
buff->buf = cstrace;
*/
buff->ref_timestamp = aux_buffer->reference;
buff->ref_timestamp = aux_buffer->reference;
if (etmq->step_through_buffers)
etmq->stop = true;
if (etmq->step_through_buffers)
etmq->stop = true;
- if (buff->len == 0)
- return cs_etm__get_trace(buff,etmq);
-
- return 0;
}
static struct cs_etm_queue *cs_etm__alloc_queue(struct cs_etm_auxtrace *etm,
}
static struct cs_etm_queue *cs_etm__alloc_queue(struct cs_etm_auxtrace *etm,
static int cs_etm__run_decoder(struct cs_etm_queue *etmq, u64 *timestamp)
{
static int cs_etm__run_decoder(struct cs_etm_queue *etmq, u64 *timestamp)
{
- struct cs_etm_buffer buffer = {.buf = 0,};
- size_t buffer_used = 0;
+ struct cs_etm_buffer buffer;
+ size_t buffer_used;
+ /* Go through each buffer in the queue and decode them one by one */
+more:
+ buffer_used = 0;
+ memset(&buffer, 0, sizeof(buffer));
err = cs_etm__get_trace(&buffer,etmq);
err = cs_etm__get_trace(&buffer,etmq);
cs_etm__sample(etmq);
}
} while (!etmq->eot && (buffer.len > buffer_used));
cs_etm__sample(etmq);
}
} while (!etmq->eot && (buffer.len > buffer_used));