From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031858AbdAJPzM (ORCPT ); Tue, 10 Jan 2017 10:55:12 -0500 Received: from mail.kernel.org ([198.145.29.136]:44254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932567AbdAJPzK (ORCPT ); Tue, 10 Jan 2017 10:55:10 -0500 Date: Wed, 11 Jan 2017 00:54:59 +0900 From: Masami Hiramatsu To: Masami Hiramatsu Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Jiri Olsa , Peter Zijlstra , Ingo Molnar , Namhyung Kim Subject: Re: [PATCH perf/core 4/4] perf-probe: Find probe events without target module Message-Id: <20170111005459.9e003bbe56ecc7213cc97e49@kernel.org> In-Reply-To: <148376691267.25966.1573791131700323631.stgit@devbox> References: <148376662676.25966.3739385839519573153.stgit@devbox> <148376691267.25966.1573791131700323631.stgit@devbox> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 7 Jan 2017 14:28:42 +0900 Masami Hiramatsu wrote: > Find probe events without -m "module" option. If perf-probe > failed to find given function in kernel image, it tries to > find same symbol and module in kallsyms, and retry search > in the found module. E.g. > > # perf probe -D i915_capabilities > p:probe/i915_capabilities i915:i915_capabilities+0 > > Note: without -m option, perf probe can not find inlined > function since there is no symbol information in kallsyms. > > Signed-off-by: Masami Hiramatsu > Suggested-by: Arnaldo Carvalho de Melo > --- > tools/perf/util/probe-event.c | 74 ++++++++++++++++++++++++++++++----------- > 1 file changed, 55 insertions(+), 19 deletions(-) > > diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c > index 6a6f44d..09bd093 100644 > --- a/tools/perf/util/probe-event.c > +++ b/tools/perf/util/probe-event.c > @@ -858,11 +858,7 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev, > > debuginfo__delete(dinfo); > > - if (ntevs == 0) { /* No error but failed to find probe point. */ > - pr_warning("Probe point '%s' not found.\n", > - synthesize_perf_probe_point(&pev->point)); > - return -ENOENT; > - } else if (ntevs < 0) { > + if (ntevs < 0) { > /* Error path : ntevs < 0 */ > pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs); > if (ntevs == -EBADF) > @@ -2073,8 +2069,10 @@ static int find_perf_probe_point_from_map(struct probe_trace_point *tp, > } else { > if (tp->symbol && !addr) { > if (kernel_get_symbol_address_by_name(tp->symbol, > - &addr, true, false) < 0) > + &addr, true, false) < 0) { > + ret = 0; > goto out; Oops, I've found that this is not needed and breaks --list result. I'll update it. Thanks. -- Masami Hiramatsu