From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2584 invoked by alias); 22 Feb 2010 22:49:49 -0000 Received: (qmail 2553 invoked by uid 22791); 22 Feb 2010 22:49:48 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS 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; Mon, 22 Feb 2010 22:49:43 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1MMngD4006676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 22 Feb 2010 17:49:42 -0500 Received: from localhost6.localdomain6 (dhcp-100-3-156.bos.redhat.com [10.16.3.156]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1MMneWA025915; Mon, 22 Feb 2010 17:49:40 -0500 From: Masami Hiramatsu Subject: [PATCH -tip v2 3/9] perf probe: Fix bugs in line range finder To: Ingo Molnar , lkml Cc: systemtap, DLE, Masami Hiramatsu , Ingo Molnar , Frederic Weisbecker , Arnaldo Carvalho de Melo , Peter Zijlstra , Paul Mackerras , Mike Galbraith , "K.Prasad" Date: Mon, 22 Feb 2010 22:49:00 -0000 Message-ID: <20100222225340.20686.66886.stgit@localhost6.localdomain6> In-Reply-To: <20100222225320.20686.17645.stgit@localhost6.localdomain6> References: <20100222225320.20686.17645.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-q1/txt/msg00440.txt.bz2 Fix find_line_range_by_line() to init line_list and remove misconseptional found marking which should be done when real lines are found (if there is no lines probe-able, find_line_range() should return 0). Signed-off-by: Masami Hiramatsu Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Arnaldo Carvalho de Melo Cc: Peter Zijlstra Cc: Paul Mackerras Cc: Mike Galbraith Cc: K.Prasad --- tools/perf/util/probe-finder.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 1b2124d..3e10dbe 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -788,6 +788,7 @@ static void find_line_range_by_line(struct line_finder *lf) Dwarf_Addr addr; int ret; + INIT_LIST_HEAD(&lf->lr->line_list); ret = dwarf_srclines(lf->cu_die, &lines, &cnt, &__dw_error); DIE_IF(ret != DW_DLV_OK); @@ -848,8 +849,6 @@ static int linefunc_callback(struct die_link *dlink, void *data) lr->start = lf->lno_s; lr->end = lf->lno_e; find_line_range_by_line(lf); - /* If we find a target function, this should be end. */ - lf->found = 1; return 1; } return 0; -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: mhiramat@redhat.com