Thread (25 messages) 25 messages, 3 authors, 2021-12-07

Re: [PATCHv5 3/4] tracing: Add register read/write tracing support

From: Arnd Bergmann <arnd@arndb.de>
Date: 2021-12-06 08:59:45
Also in: linux-arm-msm, lkml

On Mon, Dec 6, 2021 at 9:28 AM Sai Prakash Ranjan
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 420ff4bc67fd..9f55bcc51de1 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -95,6 +95,13 @@ config RING_BUFFER_ALLOW_SWAP
         Allow the use of ring_buffer_swap_cpu.
         Adds a very slight overhead to tracing when enabled.

+config TRACE_MMIO_ACCESS
+       bool "Register read/write tracing"
+       depends on TRACING
+       help
+         Create tracepoints for MMIO read/write operations. These trace events
+         can be used for logging all MMIO read/write operations.
I think this needs a 'depends on ARCH_HAVE_TRACE_MMIO_ACCESS'
or similar.
quoted hunk ↗ jump to hunk
+void log_read_mmio(u8 width, const volatile void __iomem *addr)
+{
+       trace_rwmmio_read(CALLER_ADDR0, CALLER_ADDR1, width, addr);
+}
Here, it may be better to pass the caller address as an argument, I think
CALLER_ADDR1 is not always reliable, though it's possible that it is
in the configurations when this file gets enabled.

       Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help