summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>2023-07-08 01:38:03 +0900
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>2023-07-14 00:24:00 +0900
commitd5f28bb1ce04636b285726ee2a5afa3a514025f4 (patch)
treecbe77110f009629bd62376cb70545aee47e9ea04
parent195b9cb5b288fec1c871ef89f78cc9a7461aad3a (diff)
fprobes: Add a comment why fprobe_kprobe_handler exits if kprobe is running
Add a comment the reason why fprobe_kprobe_handler() exits if any other kprobe is running. Link: https://lore.kernel.org/all/168874788299.159442.2485957441413653858.stgit@devnote2/ 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>
-rw-r--r--kernel/trace/fprobe.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
index 2571f7f3d5f2..59321d22f43e 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++;
goto recursion_unlock;