diff options
author | Mathieu Poirier <mathieu.poirier@linaro.org> | 2019-05-09 15:52:58 -0600 |
---|---|---|
committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2019-05-09 15:53:50 -0600 |
commit | 9b384b88148d3e489d2779bf165b4b3e05e6df8c (patch) | |
tree | f0812a86c17c0c6dc68e692ab9d1e3f5b28774ae | |
parent | 4c8d90e39bb9b60102b5c26e3e1dec6a84e9f6b2 (diff) |
coresight: tmc-etr: Properly set AUX buffer head in snapshot mode
Unify amongst sink drivers how the AUX ring buffer head is communicated
to user space. That way the same algorithm in cs_etm_find_snapshot()
can be used to determine where the latest data is and how much of it
to access.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
-rw-r--r-- | drivers/hwtracing/coresight/coresight-tmc-etr.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index df6e4b0b84e9..cc8401c76c39 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -1501,14 +1501,13 @@ tmc_update_etr_buffer(struct coresight_device *csdev, tmc_etr_sync_perf_buffer(etr_perf); /* - * Update handle->head in snapshot mode. Also update the size to the - * hardware buffer size if there was an overflow. + * In snapshot mode we simply increment the head by the number of byte + * that were written. User space function cs_etm_find_snapshot() will + * figure out how many bytes to get from the AUX buffer based on the + * position of the head. */ - if (etr_perf->snapshot) { + if (etr_perf->snapshot) handle->head += size; - if (etr_buf->full) - size = etr_buf->size; - } lost |= etr_buf->full; out: |