Skip to content

Commit d5f28bb

Browse files
committed
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>
1 parent 195b9cb commit d5f28bb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

kernel/trace/fprobe.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ static void fprobe_kprobe_handler(unsigned long ip, unsigned long parent_ip,
100100
return;
101101
}
102102

103+
/*
104+
* This user handler is shared with other kprobes and is not expected to be
105+
* called recursively. So if any other kprobe handler is running, this will
106+
* exit as kprobe does. See the section 'Share the callbacks with kprobes'
107+
* in Documentation/trace/fprobe.rst for more information.
108+
*/
103109
if (unlikely(kprobe_running())) {
104110
fp->nmissed++;
105111
goto recursion_unlock;

0 commit comments

Comments
 (0)