mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: rostedt@goodmis.org
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Arnaldo Carvalho de Melo <acme@infradead.org>,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
	2nddept-manager@sdl.hitachi.co.jp
Subject: Re: [PATCH][GIT PULL][v2.6.35] perf/tracing: Fix regression of perf losing kprobe events
Date: Fri, 11 Jun 2010 17:02:55 +0900	[thread overview]
Message-ID: <4C11EDAF.4010600@hitachi.com> (raw)
In-Reply-To: <1276217919.28329.6.camel@gandalf.stny.rr.com>

Steven Rostedt wrote:
> Ingo,
> 
> Please pull the latest tip/perf/urgent tree, which can be found at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> tip/perf/urgent
> 
> 
> Steven Rostedt (1):
>       perf/tracing: Fix regression of perf losing kprobe events
> 
> ----
>  kernel/trace/trace_event_perf.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> ---------------------------
> commit a8fb2608053547bc3152ea61a5ec7cdfce5d942c
> Author: Steven Rostedt <srostedt@redhat.com>
> Date:   Thu Jun 10 14:53:16 2010 -0400
> 
>     perf/tracing: Fix regression of perf losing kprobe events
>     
>     With the addition of the code to shrink the kernel tracepoint
>     infrastructure, we lost kprobes being traced by perf. The reason
>     is that I tested if the "tp_event->class->perf_probe" existed before
>     enabling it. This prevents "ftrace only" events (like the function
>     trace events) from being enabled by perf.
>     
>     Unfortunately, kprobe events do not use perf_probe. This causes
>     kprobes to be missed by perf. To fix this, we add the test to
>     see if "tp_event->class->reg" exists as well as perf_probe.
>     
>     Normal trace events have only "perf_probe" but no "reg" function,
>     and kprobes and syscalls have the "reg" but no "perf_probe".
>     The ftrace unique events do not have either, so this is a valid
>     test. If a kprobe or syscall is not to be probed by perf, the
>     "reg" function is called anyway, and will return a failure and
>     prevent perf from probing it.
>     
>     Reported-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
>     Tested-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
>     Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
>     Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Thank you for fixing,

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>


> 
> diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
> index e6f6588..8a2b73f 100644
> --- a/kernel/trace/trace_event_perf.c
> +++ b/kernel/trace/trace_event_perf.c
> @@ -96,7 +96,9 @@ int perf_trace_init(struct perf_event *p_event)
>  	mutex_lock(&event_mutex);
>  	list_for_each_entry(tp_event, &ftrace_events, list) {
>  		if (tp_event->event.type == event_id &&
> -		    tp_event->class && tp_event->class->perf_probe &&
> +		    tp_event->class &&
> +		    (tp_event->class->perf_probe ||
> +		     tp_event->class->reg) &&
>  		    try_module_get(tp_event->mod)) {
>  			ret = perf_trace_event_init(tp_event, p_event);
>  			break;
> 
> 
> 
> 



  reply	other threads:[~2010-06-11  8:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-11  0:58 Steven Rostedt
2010-06-11  8:02 ` Masami Hiramatsu [this message]
2010-06-11  8:17 ` Ingo Molnar

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=4C11EDAF.4010600@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=2nddept-manager@sdl.hitachi.co.jp \
    --cc=acme@infradead.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=srikar@linux.vnet.ibm.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

Powered by JetHome