]> 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>
Thu, 16 Oct 2025 11:57:09 +0000 (07:57 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Oct 2025 14:23:22 +0000 (16:23 +0200)
commit93faabb55a377f577102dc37ed795a07aff201e2
tree97252f9aaf83a4f57f25f0cb6916ea5ee68d9f63
parent0beb2357a7d9e4005d95b90994d832d6883cdbca
asm-generic/io.h: Skip trace helpers if rwmmio events are disabled

[ Upstream commit 8327bd4fcb6c1dab01ce5c6ff00b42496836dcd2 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/asm-generic/io.h