Skip to content

Commit 4585481

Browse files
Suzuki K Poulosemathieupoirier
authored andcommitted
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. Cc: Mathieu Poirier <[email protected]> Cc: Mike Leach <[email protected]> Cc: Leo Yan <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]> Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
1 parent 41c0e5b commit 4585481

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/hwtracing/coresight/coresight-trbe.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,18 @@ static void trbe_stop_and_truncate_event(struct perf_output_handle *handle)
199199
* consumed from the user space. The enabled TRBE buffer area is a moving subset of
200200
* the allocated perf auxiliary buffer.
201201
*/
202+
203+
static void __trbe_pad_buf(struct trbe_buf *buf, u64 offset, int len)
204+
{
205+
memset((void *)buf->trbe_base + offset, ETE_IGNORE_PACKET, len);
206+
}
207+
202208
static void trbe_pad_buf(struct perf_output_handle *handle, int len)
203209
{
204210
struct trbe_buf *buf = etm_perf_sink_config(handle);
205211
u64 head = PERF_IDX2OFF(handle->head, buf);
206212

207-
memset((void *)buf->trbe_base + head, ETE_IGNORE_PACKET, len);
213+
__trbe_pad_buf(buf, head, len);
208214
if (!buf->snapshot)
209215
perf_aux_output_skip(handle, len);
210216
}

0 commit comments

Comments
 (0)