The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Xiangyang Zhang <xyz.sun.ok@gmail.com>
Cc: mingo@redhat.com, Masami Hiramatsu <mhiramat@kernel.org>,
	oleg@redhat.com, namhyung.kim@lge.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing/kprobes: 'nmissed' not showed correctly for kretprobe
Date: Wed, 5 Jan 2022 14:22:08 -0500	[thread overview]
Message-ID: <20220105142208.1dbc20cc@gandalf.local.home> (raw)
In-Reply-To: <20220105141556.12fb2ceb@gandalf.local.home>

Resending again, this time with Masami's working email address.

On Wed, 5 Jan 2022 14:15:56 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Sat, 11 Dec 2021 23:00:32 +0800
> Xiangyang Zhang <xyz.sun.ok@gmail.com> wrote:
> 
> > The 'nmissed' column of the 'kprobe_profile' file for kretprobe is
> > always zero, because 'nmissed' for kretprobe is maintained in
> > 'tk->rp.nmissed' but not in 'tk->rp.kp.nmissed'
> > 
> > Fixes: c31ffb3ff633 ("tracing/kprobes: Factor out struct trace_probe")
> > Signed-off-by: Xiangyang Zhang <xyz.sun.ok@gmail.com>
> > ---
> >  kernel/trace/trace_kprobe.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> > index d10c01948e68..2b9de6826e94 100644
> > --- a/kernel/trace/trace_kprobe.c
> > +++ b/kernel/trace/trace_kprobe.c
> > @@ -1175,15 +1175,17 @@ static int probes_profile_seq_show(struct seq_file *m, void *v)
> >  {
> >  	struct dyn_event *ev = v;
> >  	struct trace_kprobe *tk;
> > +	unsigned long nmissed = 0;  
> 
> No need to initialize this to zero, the first use is an assignment.
> 
> >  
> >  	if (!is_trace_kprobe(ev))
> >  		return 0;
> >  
> >  	tk = to_trace_kprobe(ev);
> > +	nmissed = tk->rp.handler ? tk->rp.nmissed : tk->rp.kp.nmissed;
> >  	seq_printf(m, "  %-44s %15lu %15lu\n",
> >  		   trace_probe_name(&tk->tp),
> >  		   trace_kprobe_nhit(tk),
> > -		   tk->rp.kp.nmissed);
> > +		   nmissed);  
> 
> Masami, what's your thoughts on this patch?
> 
> -- Steve
> 
> >  
> >  	return 0;
> >  }  
> 


  reply	other threads:[~2022-01-05 19:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-11 15:00 [PATCH] tracing/kprobes: 'nmissed' not showed correctly for kretprobe Xiangyang Zhang
2022-01-05 19:15 ` Steven Rostedt
2022-01-05 19:22   ` Steven Rostedt [this message]
2022-01-05 22:32     ` Masami Hiramatsu
2022-01-05 23:10       ` Steven Rostedt
2022-01-06  2:14         ` xy zhang

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=20220105142208.1dbc20cc@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung.kim@lge.com \
    --cc=oleg@redhat.com \
    --cc=xyz.sun.ok@gmail.com \
    /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