[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250123104842.92336327f898e546c5b67536@kernel.org>
Date: Thu, 23 Jan 2025 10:48:42 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Nam Cao <namcao@...utronix.de>, naveen@...nel.org,
anil.s.keshavamurthy@...el.com, davem@...emloft.net, mhiramat@...nel.org,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
john.ogness@...utronix.de
Subject: Re: kprobe on local function
On Wed, 22 Jan 2025 17:29:36 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:
> On Wed, 22 Jan 2025 08:59:39 +0100
> Nam Cao <namcao@...utronix.de> wrote:
>
> > Hi,
> >
> > I installed a kretprobe on the function "rt_mutex_slowunlock". Although the
> > function is called, the probe is never hit.
> >
>
> How did you install the kretprobe?
>
If you specify one original 'symbol' name to tracefs/kprobe_events, it
only sets the kretprobe event on that symbol.
> > The reason is because there are 3 copies of rt_mutex_slowunlock() in
> > vmlinux (at least for x86 defconfig + CONFIG_PREEMPT_RT). But probe point
> > is only installed in 1 copy.
You can add those copies manually on the same event but,...
> >
> > Is this considered a bug? Or is kprobe not intended to be used for local
> > function? Should we modify kprobe to support such cases?
>
> It's not a bug, but just the way the compiler works.
>
> Have you tried "perf probe" to install the probes? That uses dwarf info to
> find all the functions.
Yes, I recommend you to use `perf probe` (under tools/perf) to put kretprobes
on those copies. See tools/perf/Documentation/perf-probe.txt for details.
Thank you,
>
> -- Steve
--
Masami Hiramatsu (Google) <mhiramat@...nel.org>
Powered by blists - more mailing lists