mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
UPSTREAM: coresight: trbe: Add a helper to pad a given buffer area
Refactor the helper to pad a given AUX buffer area to allow
"filling" ignore packets, without moving any handle pointers.
This will be useful in working around errata, where we may
have to fill the buffer after a session.
Bug: 213931796
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Leo Yan <leo.yan@linaro.org>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20211019163153.3692640-7-suzuki.poulose@arm.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
(cherry picked from commit 4585481af3)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I1626ce2a9670feba9f921d2448b744b75222bf7b
This commit is contained in:
committed by
Todd Kjos
parent
fcb0f0502b
commit
ea480c0f70
@@ -199,12 +199,18 @@ static void trbe_stop_and_truncate_event(struct perf_output_handle *handle)
|
||||
* consumed from the user space. The enabled TRBE buffer area is a moving subset of
|
||||
* the allocated perf auxiliary buffer.
|
||||
*/
|
||||
|
||||
static void __trbe_pad_buf(struct trbe_buf *buf, u64 offset, int len)
|
||||
{
|
||||
memset((void *)buf->trbe_base + offset, ETE_IGNORE_PACKET, len);
|
||||
}
|
||||
|
||||
static void trbe_pad_buf(struct perf_output_handle *handle, int len)
|
||||
{
|
||||
struct trbe_buf *buf = etm_perf_sink_config(handle);
|
||||
u64 head = PERF_IDX2OFF(handle->head, buf);
|
||||
|
||||
memset((void *)buf->trbe_base + head, ETE_IGNORE_PACKET, len);
|
||||
__trbe_pad_buf(buf, head, len);
|
||||
if (!buf->snapshot)
|
||||
perf_aux_output_skip(handle, len);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user