Commit c28e15d8 authored by Varad Gautam's avatar Varad Gautam Committed by Matthias Männich
Browse files

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: default avatarVarad 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.
parent 421c7da5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment