[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1866798.U7tsNezOxe@agathebauer>
Date: Fri, 12 May 2017 12:23:06 +0200
From: Milian Wolff <milian.wolff@...b.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...hat.com>,
David Ahern <dsahern@...il.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Yao Jin <yao.jin@...ux.intel.com>, kernel-team@....com
Subject: Re: [PATCH] perf report: don't crash on invalid maps in `-g srcline` mode
On Mittwoch, 10. Mai 2017 08:04:23 CEST Namhyung Kim wrote:
> On Tue, May 09, 2017 at 10:50:46PM +0200, Milian Wolff wrote:
<snip>
> > diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
> > index 9ab68682c6d0..295f0846fd84 100644
> > --- a/tools/perf/util/callchain.c
> > +++ b/tools/perf/util/callchain.c
> > @@ -642,13 +642,22 @@ static enum match_result match_chain_strings(const
> > char *left,>
> > static enum match_result match_chain_srcline(struct callchain_cursor_node
> > *node,>
> > struct callchain_list *cnode)
> >
> > {
> >
> > - char *left = get_srcline(cnode->ms.map->dso,
> > - map__rip_2objdump(cnode->ms.map, cnode->ip),
> > - cnode->ms.sym, true, false);
> > - char *right = get_srcline(node->map->dso,
> > - map__rip_2objdump(node->map, node->ip),
> > - node->sym, true, false);
> > - enum match_result ret = match_chain_strings(left, right);
> > + char *left = NULL;
> > + char *right = NULL;
> > + enum match_result ret = MATCH_ERROR;
> > +
> > + if (!node->map || !cnode->ms.map)
> > + return ret;
>
> This makes it fall back to function/address matching below if one of
> srcline is not available. But it'll just show many "??:0" entries
> IMHO. Maybe we can use same logic in util/sort.c:cmp_null instead..
Yes, that could be done but I think it's not directly related to the patch/fix
at hand. Would it be OK if I change this behavior in a separate patch?
Thanks
--
Milian Wolff | milian.wolff@...b.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts
Download attachment "smime.p7s" of type "application/pkcs7-signature" (5903 bytes)
Powered by blists - more mailing lists