* [PATCH] fprobes: Add a comment why fprobe_kprobe_handler exits if kprobe is running
@ 2023-07-07 16:38 Masami Hiramatsu (Google)
2023-07-07 16:55 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Masami Hiramatsu (Google) @ 2023-07-07 16:38 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Masami Hiramatsu, linux-kernel, linux-trace-kernel
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Add a comment the reason why fprobe_kprobe_handler() exits if any other
kprobe is running.
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Link: https://lore.kernel.org/all/20230706120916.3c6abf15@gandalf.local.home/
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
kernel/trace/fprobe.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
index 75517667b54f..133b31f44945 100644
--- a/kernel/trace/fprobe.c
+++ b/kernel/trace/fprobe.c
@@ -100,6 +100,12 @@ static void fprobe_kprobe_handler(unsigned long ip, unsigned long parent_ip,
return;
}
+ /*
+ * This user handler is shared with other kprobes and is not expected to be
+ * called recursively. So if any other kprobe handler is running, this will
+ * exit as kprobe does. See the section 'Share the callbacks with kprobes'
+ * in Documentation/trace/fprobe.rst for more information.
+ */
if (unlikely(kprobe_running())) {
fp->nmissed++;
return;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fprobes: Add a comment why fprobe_kprobe_handler exits if kprobe is running
2023-07-07 16:38 [PATCH] fprobes: Add a comment why fprobe_kprobe_handler exits if kprobe is running Masami Hiramatsu (Google)
@ 2023-07-07 16:55 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2023-07-07 16:55 UTC (permalink / raw)
To: Masami Hiramatsu (Google); +Cc: linux-kernel, linux-trace-kernel
On Sat, 8 Jul 2023 01:38:03 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>
> Add a comment the reason why fprobe_kprobe_handler() exits if any other
> kprobe is running.
>
> Suggested-by: Steven Rostedt <rostedt@goodmis.org>
> Link: https://lore.kernel.org/all/20230706120916.3c6abf15@gandalf.local.home/
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-- Steve
> ---
> kernel/trace/fprobe.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
> index 75517667b54f..133b31f44945 100644
> --- a/kernel/trace/fprobe.c
> +++ b/kernel/trace/fprobe.c
> @@ -100,6 +100,12 @@ static void fprobe_kprobe_handler(unsigned long ip, unsigned long parent_ip,
> return;
> }
>
> + /*
> + * This user handler is shared with other kprobes and is not expected to be
> + * called recursively. So if any other kprobe handler is running, this will
> + * exit as kprobe does. See the section 'Share the callbacks with kprobes'
> + * in Documentation/trace/fprobe.rst for more information.
> + */
> if (unlikely(kprobe_running())) {
> fp->nmissed++;
> return;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-07 16:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07 16:38 [PATCH] fprobes: Add a comment why fprobe_kprobe_handler exits if kprobe is running Masami Hiramatsu (Google)
2023-07-07 16:55 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox