public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] fprobes: Add a comment why fprobe_kprobe_handler exits if kprobe is running
Date: Fri, 7 Jul 2023 12:55:51 -0400	[thread overview]
Message-ID: <20230707125551.641ca475@gandalf.local.home> (raw)
In-Reply-To: <168874788299.159442.2485957441413653858.stgit@devnote2>

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;


      reply	other threads:[~2023-07-07 16:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230707125551.641ca475@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox