mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
UPSTREAM: coresight: tmc-etr: Properly set AUX buffer head in snapshot mode
(Upstream commit 3ecb03022a).
Unify amongst sink drivers how the AUX ring buffer head is communicated
to user space. That way the same algorithm in user space 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>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Tested-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 140266694
Change-Id: I2a76f700070b5748493157c895989bddb14eb2ad
Signed-off-by: Yabin Cui <yabinc@google.com>
This commit is contained in:
committed by
Yabin Cui
parent
0fefe3cd1d
commit
77abd79a4a
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user