Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753247AbbHGAO1 (ORCPT ); Thu, 6 Aug 2015 20:14:27 -0400 Received: from mga02.intel.com ([134.134.136.20]:35874 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750968AbbHGAO0 (ORCPT ); Thu, 6 Aug 2015 20:14:26 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,626,1432623600"; d="scan'208";a="778488587" Date: Thu, 6 Aug 2015 17:14:24 -0700 From: Andi Kleen To: Yannick Brosseau Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf tools: use map->map_ip to get srcline when listing symbol Message-ID: <20150807001424.GA23205@tassilo.jf.intel.com> References: <1438882241-15175-1-git-send-email-scientist@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438882241-15175-1-git-send-email-scientist@fb.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3320 Lines: 99 On Thu, Aug 06, 2015 at 10:30:41AM -0700, Yannick Brosseau wrote: > Revert 5550171b2a9f8df26ff483051d060db06376b26d and do the address > mapping using map->map_ip instead of map__rip_2objdump when > calling get_srcline With that change the source line is not correctly reported anymore: with your patch: # Children Self Source:Line Symbol Shared Object # ........ ........ ........... ............................... ................ # 98.27% 0.00% f1+4194306 [.] f1 tcall | Without: # Children Self Source:Line Symbol Shared Object # ........ ........ ........... ............................... ................ # 98.27% 0.00% f1+2 [.] f1 tcall and also the other way round when debug info is available the lines in --branch-history output are not correctly resolved anymore. before: 99.35% 0.00% f1+19 [.] f1 tcall | ---f1 tcall.c:12 f1 tcall.c:12 f2 tcall.c:7 after 99.35% 5.87% /home/ak/hl [.] f2 tcall | |--94.09%-- f2 +27 | f2 +0 | | | |--69.26%-- f1 +19 | | f1 +14 | | f2 +27 So the source:line improved, but the callgraph entries regressed. Probably these two cases need to be handled differently. BTW the commit description is not very clear. -Andi > > Signed-off-by: Yannick Brosseau > --- > tools/perf/util/callchain.c | 4 ++-- > tools/perf/util/machine.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c > index 9f643ee..359fb6b 100644 > --- a/tools/perf/util/callchain.c > +++ b/tools/perf/util/callchain.c > @@ -830,8 +830,8 @@ char *callchain_list__sym_name(struct callchain_list *cl, > if (callchain_param.key == CCKEY_ADDRESS && > cl->ms.map && !cl->srcline) > cl->srcline = get_srcline(cl->ms.map->dso, > - map__rip_2objdump(cl->ms.map, > - cl->ip), > + cl->ms.map->map_ip(cl->ms.map, > + cl->ip), > cl->ms.sym, false); > if (cl->srcline) > printed = scnprintf(bf, bfsize, "%s %s", > diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c > index 7ff6827..80a5eda 100644 > --- a/tools/perf/util/machine.c > +++ b/tools/perf/util/machine.c > @@ -1580,7 +1580,7 @@ static int add_callchain_ip(struct thread *thread, > } > } > > - return callchain_cursor_append(&callchain_cursor, al.addr, al.map, al.sym); > + return callchain_cursor_append(&callchain_cursor, ip, al.map, al.sym); > } > > struct branch_info *sample__resolve_bstack(struct perf_sample *sample, > -- > 2.1.4 > -- ak@linux.intel.com -- Speaking for myself only -- 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/