In the previous patch set for fixing CoreSight snapshot mode [1], the
patch for perf tool has been merged into the mainline kernel [2]; other
two patches for CoreSight driver have been left out.
This patch series resends these two missed out patches, alongside
patches 01 and 02 are updated with minor improvement commits.
This patch series has been tested on Arm64 Juno board.
Changes from v2:
- Minor improvement the commits for patches 01 and 02.
[1] https://lore.kernel.org/lkml/20210701093537.90759-1-leo.yan@linaro.org/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2f01c200d4405c4562e45e8bb4de44a5ce37b217
Leo Yan (2):
coresight: tmc-etr: Use perf_output_handle::head for AUX ring buffer
coresight: Update comments for removing cs_etm_find_snapshot()
drivers/hwtracing/coresight/coresight-etb10.c | 2 +-
drivers/hwtracing/coresight/coresight-tmc-etf.c | 2 +-
drivers/hwtracing/coresight/coresight-tmc-etr.c | 12 ++++--------
3 files changed, 6 insertions(+), 10 deletions(-)
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
When enable the Arm CoreSight PMU event, the context for AUX ring buffer
is prepared in the structure perf_output_handle, and its field "head"
points the head of the AUX ring buffer and it is updated after filling
AUX trace data into buffer.
Current code uses an extra field etr_perf_buffer::head to maintain the
header for the AUX ring buffer which is not necessary; alternatively,
it's better to directly use perf_output_handle::head.
This patch removes the field etr_perf_buffer::head and directly uses
perf_output_handle::head for the head of AUX ring buffer.
Signed-off-by: Leo Yan <redacted>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
drivers/hwtracing/coresight/coresight-tmc-etr.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
@@ -1571,7 +1569,7 @@ tmc_update_etr_buffer(struct coresight_device *csdev,/* Insert barrier packets at the beginning, if there was an overflow */if(lost)tmc_etr_buf_insert_barrier_packet(etr_buf,offset);-tmc_etr_sync_perf_buffer(etr_perf,offset,size);+tmc_etr_sync_perf_buffer(etr_perf,handle->head,offset,size);/**Insnapshotmodewesimplyincrementtheheadbythenumberofbyte
Commit 2f01c200d440 ("perf cs-etm: Remove callback cs_etm_find_snapshot()")
has removed the function cs_etm_find_snapshot() from the perf tool in the
user space, now CoreSight trace directly uses the perf common function
__auxtrace_mmap__read() to calcualte the head and size for AUX trace data
in snapshot mode.
Updates the comments in drivers to reflect the changes.
Signed-off-by: Leo Yan <redacted>
---
drivers/hwtracing/coresight/coresight-etb10.c | 2 +-
drivers/hwtracing/coresight/coresight-tmc-etf.c | 2 +-
drivers/hwtracing/coresight/coresight-tmc-etr.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
From: Suzuki K Poulose <suzuki.poulose@arm.com> Date: 2021-09-06 09:51:09
Hi Leo
On 05/09/2021 14:12, Leo Yan wrote:
Commit 2f01c200d440 ("perf cs-etm: Remove callback cs_etm_find_snapshot()")
has removed the function cs_etm_find_snapshot() from the perf tool in the
user space, now CoreSight trace directly uses the perf common function
__auxtrace_mmap__read() to calcualte the head and size for AUX trace data
in snapshot mode.
Updates the comments in drivers to reflect the changes.
As such I would avoid referencing "userspace" function names in the
kernel driver. Please could we remove it or make it generic ?
Also, remember, perf is not the only userspace tool driving the kernel
perf.
Cheers
Suzuki
Hi Suzuki,
On Mon, Sep 06, 2021 at 10:51:02AM +0100, Suzuki Kuruppassery Poulose wrote:
Hi Leo
On 05/09/2021 14:12, Leo Yan wrote:
quoted
Commit 2f01c200d440 ("perf cs-etm: Remove callback cs_etm_find_snapshot()")
has removed the function cs_etm_find_snapshot() from the perf tool in the
user space, now CoreSight trace directly uses the perf common function
__auxtrace_mmap__read() to calcualte the head and size for AUX trace data
in snapshot mode.
Updates the comments in drivers to reflect the changes.
As such I would avoid referencing "userspace" function names in the
kernel driver. Please could we remove it or make it generic ?
Okay, I'd like to remove the specific function name from the comment so
can make the comment generic as:
"User space will figure out how many bytes to get from the AUX buffer
based on the position of the head."
This info can remind us how the userspace and kernel co-work for
snapshot mode if later we read the code.
If no objection, I will respin with this way.
Also, remember, perf is not the only userspace tool driving the kernel
perf.
From: Suzuki K Poulose <suzuki.poulose@arm.com> Date: 2021-09-06 10:31:35
On 06/09/2021 11:28, Leo Yan wrote:
Hi Suzuki,
On Mon, Sep 06, 2021 at 10:51:02AM +0100, Suzuki Kuruppassery Poulose wrote:
quoted
Hi Leo
On 05/09/2021 14:12, Leo Yan wrote:
quoted
Commit 2f01c200d440 ("perf cs-etm: Remove callback cs_etm_find_snapshot()")
has removed the function cs_etm_find_snapshot() from the perf tool in the
user space, now CoreSight trace directly uses the perf common function
__auxtrace_mmap__read() to calcualte the head and size for AUX trace data
in snapshot mode.
Updates the comments in drivers to reflect the changes.
As such I would avoid referencing "userspace" function names in the
kernel driver. Please could we remove it or make it generic ?
Okay, I'd like to remove the specific function name from the comment so
can make the comment generic as:
"User space will figure out how many bytes to get from the AUX buffer
based on the position of the head."