diff options
| author | Mathieu Poirier <mathieu.poirier@linaro.org> | 2016-05-18 12:58:26 -0600 |
|---|---|---|
| committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2016-06-20 11:16:08 -0600 |
| commit | 7b4fe2ff5a850c70174381adbcf4fd32e41a969c (patch) | |
| tree | 9da386c15f4c9e8b498c8e27c65b434d8fde2ed3 | |
| parent | c14318faac87ba59c2ec8279e6328c774af3b723 (diff) | |
cs-etm: account for each trace buffer in the queue
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>
| -rw-r--r-- | tools/perf/util/cs-etm.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 1c7208840823..a28170eac18a 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -326,7 +326,6 @@ static int cs_etm__get_trace(struct cs_etm_buffer *buff, struct cs_etm_queue *et buff->len = sizeof(cstrace); buff->buf = cstrace; */ - etmq->stop = true; buff->ref_timestamp = aux_buffer->reference; @@ -339,10 +338,7 @@ static int cs_etm__get_trace(struct cs_etm_buffer *buff, struct cs_etm_queue *et if (etmq->step_through_buffers) etmq->stop = true; - if (buff->len == 0) - return cs_etm__get_trace(buff,etmq); - - return 0; + return buff->len; } static struct cs_etm_queue *cs_etm__alloc_queue(struct cs_etm_auxtrace *etm, @@ -819,12 +815,16 @@ static int cs_etm__sample(struct cs_etm_queue *etmq) 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; int err = 0; + /* 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); - if (err) + if (err <= 0) return err; do { @@ -842,6 +842,7 @@ static int cs_etm__run_decoder(struct cs_etm_queue *etmq, u64 *timestamp) cs_etm__sample(etmq); } } while (!etmq->eot && (buffer.len > buffer_used)); +goto more; (void) timestamp; |
