Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759181AbZLOPba (ORCPT ); Tue, 15 Dec 2009 10:31:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758533AbZLOPbW (ORCPT ); Tue, 15 Dec 2009 10:31:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16530 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932119AbZLOP1v (ORCPT ); Tue, 15 Dec 2009 10:27:51 -0500 From: Masami Hiramatsu Subject: [PATCH -tip 04/14] perf probe: Show need-dwarf message only if it is really needed To: Ingo Molnar , Frederic Weisbecker , lkml Cc: Paul Mackerras , Arnaldo Carvalho de Melo , Steven Rostedt , Jim Keniston , Ananth N Mavinakayanahalli , Christoph Hellwig , "Frank Ch. Eigler" , Jason Baron , "K.Prasad" , Peter Zijlstra , Srikar Dronamraju , systemtap , DLE Date: Tue, 15 Dec 2009 10:31:35 -0500 Message-ID: <20091215153135.17436.99052.stgit@dhcp-100-2-132.bos.redhat.com> In-Reply-To: <20091215153106.17436.66584.stgit@dhcp-100-2-132.bos.redhat.com> References: <20091215153106.17436.66584.stgit@dhcp-100-2-132.bos.redhat.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2864 Lines: 88 Show need-dwarf message only if the probe is really requires debuginfo analysis. This also use pr_debug for debugging message instead of pr_warning. Signed-off-by: Masami Hiramatsu Cc: Ingo Molnar Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo Cc: Steven Rostedt Cc: Jim Keniston Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Frank Ch. Eigler Cc: Frederic Weisbecker Cc: Jason Baron Cc: K.Prasad Cc: Peter Zijlstra Cc: Srikar Dronamraju --- tools/perf/builtin-probe.c | 20 +++++++++++++------- tools/perf/util/probe-finder.c | 4 +--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 919037b..7f35709 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c @@ -261,15 +261,21 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) lseek(fd, SEEK_SET, 0); ret = find_probepoint(fd, pp); - if (ret < 0) { - if (session.need_dwarf) - die("Could not analyze debuginfo."); - - pr_warning("An error occurred in debuginfo analysis. Try to use symbols.\n"); - break; - } + if (ret > 0) + continue; if (ret == 0) /* No error but failed to find probe point. */ die("No probe point found."); + /* Error path */ + if (session.need_dwarf) { + if (ret == -ENOENT) + pr_warning("No dwarf info found in the vmlinux" + " - please rebuild with " + "CONFIG_DEBUG_INFO.\n"); + die("Could not analyze debuginfo."); + } + pr_debug("An error occurred in debuginfo analysis." + " Try to use symbols.\n"); + break; } close(fd); diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 4585f1d..4b852c0 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -687,10 +687,8 @@ int find_probepoint(int fd, struct probe_point *pp) struct probe_finder pf = {.pp = pp}; ret = dwarf_init(fd, DW_DLC_READ, 0, 0, &__dw_debug, &__dw_error); - if (ret != DW_DLV_OK) { - pr_warning("No dwarf info found in the vmlinux - please rebuild with CONFIG_DEBUG_INFO.\n"); + if (ret != DW_DLV_OK) return -ENOENT; - } pp->found = 0; while (++cu_number) { -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: mhiramat@redhat.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/