From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752706AbcHKNV6 (ORCPT ); Thu, 11 Aug 2016 09:21:58 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:14706 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750780AbcHKNVz (ORCPT ); Thu, 11 Aug 2016 09:21:55 -0400 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: ravi.bangoria@linux.vnet.ibm.com Subject: Re: [PATCH 2/2] perf ppc64le: Fix probe location when using DWARF To: Arnaldo Carvalho de Melo References: <1470723805-5081-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> <1470723805-5081-2-git-send-email-ravi.bangoria@linux.vnet.ibm.com> <20160811095457.415aa94e@kryten> <57ABFF88.8030905@linux.vnet.ibm.com> <20160811115026.GA27651@kernel.org> Cc: Anton Blanchard , linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, bsingharora@gmail.com, naveen.n.rao@linux.vnet.ibm.com, ananth@in.ibm.com, mhiramat@kernel.org, wangnan0@huawei.com, namhyung@kernel.org, Ravi Bangoria , Hemant Kumar From: Ravi Bangoria Date: Thu, 11 Aug 2016 18:51:39 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160811115026.GA27651@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16081113-8235-0000-0000-000008F825D9 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005577; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000181; SDB=6.00743183; UDB=6.00349923; IPR=6.00515736; BA=6.00004656; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012312; XFM=3.00000011; UTC=2016-08-11 13:21:52 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16081113-8236-0000-0000-000033DFA48E Message-Id: <57AC7BE3.7060808@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-11_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608110180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 11 August 2016 05:20 PM, Arnaldo Carvalho de Melo wrote: > Em Thu, Aug 11, 2016 at 10:01:04AM +0530, Ravi Bangoria escreveu: >> >> On Thursday 11 August 2016 05:24 AM, Anton Blanchard wrote: >>> Hi, >>> >>>> Powerpc has Global Entry Point and Local Entry Point for functions. >>>> LEP catches call from both the GEP and the LEP. Symbol table of ELF >>>> contains GEP and Offset from which we can calculate LEP, but debuginfo >>>> does not have LEP info. >>>> >>>> Currently, perf prioritize symbol table over dwarf to probe on LEP >>>> for ppc64le. But when user tries to probe with function parameter, >>>> we fall back to using dwarf(i.e. GEP) and when function called via >>>> LEP, probe will never hit. >>> This patch causes a build failure for me on ppc64le: >>> >>> libperf.a(libperf-in.o): In function `arch__post_process_probe_trace_events': >>> >>> tools/perf/arch/powerpc/util/sym-handling.c:109: undefined reference to `get_target_map' >> Thanks Anton. Sorry, I should have caught that. >> >> @Arnaldo, Can you please pick this up. I've prepared this on top of >> acme/perf/core. >> >> >> From 89c977ae9c3ae35c78b16cddabcf2b01d3cf5cc8 Mon Sep 17 00:00:00 2001 >> From: Ravi Bangoria >> Date: Wed, 10 Aug 2016 23:13:45 -0500 >> Subject: [PATCH] perf ppc64le: Fix build failure when no dwarf support >> >> Fix perf build failure on ppc64le because of Commit 99e608b5954c ("perf >> probe ppc64le: Fix probe location when using DWARF") > Can you please provide a better explanation? I had to look at the patch > to understand what it was fixing, and then the patch adds LIBELF_SUPPORT > ifdefs while the patch description, talks about DWARF. Yes. Explanation could have been better. Apologies for that. arch__post_process_probe_trace_events() calls get_target_map() to prepare symbol table. get_target_map() is defined inside util/probe-event.c. probe-event.c will only get included in perf binary if CONFIG_LIBELF is set. Hence arch__post_process_probe_trace_events() needs to be defined inside #ifdef HAVE_LIBELF_SUPPORT to solve compilation error. Please let me know if any doubts. Thanks, Ravi > Anyway, Anton, does this fix the problem for you? > > - Arnaldo > >> Signed-off-by: Ravi Bangoria >> --- >> tools/perf/arch/powerpc/util/sym-handling.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/tools/perf/arch/powerpc/util/sym-handling.c >> b/tools/perf/arch/powerpc/util/sym-handling.c >> index 8d4dc97..c27a51a 100644 >> --- a/tools/perf/arch/powerpc/util/sym-handling.c >> +++ b/tools/perf/arch/powerpc/util/sym-handling.c >> @@ -97,6 +97,7 @@ void arch__fix_tev_from_maps(struct perf_probe_event *pev, >> } >> } >> >> +#ifdef HAVE_LIBELF_SUPPORT >> void arch__post_process_probe_trace_events(struct perf_probe_event *pev, >> int ntevs) >> { >> @@ -118,5 +119,6 @@ void arch__post_process_probe_trace_events(struct >> perf_probe_event *pev, >> } >> } >> } >> +#endif >> >> #endif >> -- >> 2.7.4