[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220105141556.12fb2ceb@gandalf.local.home>
Date: Wed, 5 Jan 2022 14:15:56 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Xiangyang Zhang <xyz.sun.ok@...il.com>
Cc: mingo@...hat.com, masami.hiramatsu.pt@...achi.com, oleg@...hat.com,
namhyung.kim@....com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tracing/kprobes: 'nmissed' not showed correctly for
kretprobe
On Sat, 11 Dec 2021 23:00:32 +0800
Xiangyang Zhang <xyz.sun.ok@...il.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@...il.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;
> }
Powered by blists - more mailing lists