From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25209 invoked by alias); 21 Apr 2010 19:50:17 -0000 Received: (qmail 25159 invoked by uid 22791); 21 Apr 2010 19:50:13 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_JL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Apr 2010 19:50:00 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3LJnv1k027858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 21 Apr 2010 15:49:57 -0400 Received: from localhost6.localdomain6 (dhcp-100-3-156.bos.redhat.com [10.16.3.156]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3LJntHa007968; Wed, 21 Apr 2010 15:49:55 -0400 From: Masami Hiramatsu Subject: [PATCH -tip 2/4] perf probe: Fix to use symtab only if no debuginfo To: Ingo Molnar , Arnaldo Carvalho de Melo , lkml Cc: Paul Mackerras , Arnaldo Carvalho de Melo , Peter Zijlstra , Mike Galbraith , Frederic Weisbecker , systemtap, DLE Date: Thu, 22 Apr 2010 13:16:00 -0000 Message-ID: <20100421195624.24664.46214.stgit@localhost6.localdomain6> In-Reply-To: <20100421195616.24664.89980.stgit@localhost6.localdomain6> References: <20100421195616.24664.89980.stgit@localhost6.localdomain6> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2010-q2/txt/msg00195.txt.bz2 Fix perf probe to use symtab only if there is no debuginfo, because debuginfo has more precise information than symtab. If we can't find a function in debuginfo, we never find it in symtab. Signed-off-by: Masami Hiramatsu Reported-by: Arnaldo Carvalho de Melo Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Frederic Weisbecker Cc: Ingo Molnar --- tools/perf/util/probe-event.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 4fb4803..5d3baec 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -180,15 +180,16 @@ static int try_to_find_kprobe_trace_events(struct perf_probe_event *pev, return -ENOENT; } /* Error path : ntevs < 0 */ - if (need_dwarf) { - if (ntevs == -EBADF) - pr_warning("No dwarf info found in the vmlinux - " - "please rebuild with CONFIG_DEBUG_INFO=y.\n"); - return ntevs; + pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs); + if (ntevs == -EBADF) { + pr_warning("Warning: No dwarf info found in the vmlinux - " + "please rebuild kernel with CONFIG_DEBUG_INFO=y.\n"); + if (!need_dwarf) { + pr_debug("Trying to use symbols.\nn"); + return 0; + } } - pr_debug("An error occurred in debuginfo analysis." - " Try to use symbols.\n"); - return 0; + return ntevs; } #define LINEBUF_SIZE 256 -- Masami Hiramatsu e-mail: mhiramat@redhat.com