FROMLIST: 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()`.
Change-Id: I9dd7f11919dcbbc06fd7a2dd7383daec5e5685fd
Signed-off-by:
Varad Gautam <varadgautam@google.com>
Fixes: 21003197 ("asm-generic/io: Add logging support for MMIO accessors")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/lkml/20250330164229.2174672-1-varadgautam@google.com/
Test: kprobe doesn't record log_{post_}{read,write}_mmio when disabled.
DISABLE_TOPIC_PROTECTOR: the topic was added after cherry-pick
and gerrit isn't able to pick this up.
Loading
Please sign in to comment