]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
asm-generic/io.h: Skip trace helpers if rwmmio events are disabled
authorVarad Gautam <varadgautam@google.com>
Sun, 30 Mar 2025 16:42:29 +0000 (16:42 +0000)
committerArnd Bergmann <arnd@arndb.de>
Wed, 24 Sep 2025 14:21:13 +0000 (16:21 +0200)
commit8327bd4fcb6c1dab01ce5c6ff00b42496836dcd2
tree6da95f8bac1469c60178636ddc3991a14a958861
parent8f5ae30d69d7543eee0d70083daf4de8fe15d585
asm-generic/io.h: Skip trace helpers if rwmmio events are disabled

With `CONFIG_TRACE_MMIO_ACCESS=y`, the `{read,write}{b,w,l,q}{_relaxed}()`
mmio accessors unconditionally call `log_{post_}{read,write}_mmio()`
helpers, which in turn call the ftrace ops for `rwmmio` trace events

This adds a performance penalty per mmio accessor call, even when
`rwmmio` events are disabled at runtime (~80% overhead on local
measurement).

Guard these with `tracepoint_enabled()`.

Signed-off-by: Varad Gautam <varadgautam@google.com>
Fixes: 210031971cdd ("asm-generic/io: Add logging support for MMIO accessors")
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
include/asm-generic/io.h