linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Milian Wolff <milian.wolff@kdab.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	David Ahern <dsahern@gmail.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Yao Jin <yao.jin@linux.intel.com>,
	kernel-team@lge.com
Subject: Re: [PATCH] perf report: don't crash on invalid maps in `-g srcline` mode
Date: Fri, 12 May 2017 12:23:06 +0200	[thread overview]
Message-ID: <1866798.U7tsNezOxe@agathebauer> (raw)
In-Reply-To: <20170510060423.GB2667@sejong>

[-- Attachment #1: Type: text/plain, Size: 1613 bytes --]

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@kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5903 bytes --]

  reply	other threads:[~2017-05-12 10:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09 20:50 [PATCH] perf report: don't crash on invalid maps in `-g srcline` mode Milian Wolff
2017-05-10  6:04 ` Namhyung Kim
2017-05-12 10:23   ` Milian Wolff [this message]
2017-05-12 12:19     ` Namhyung Kim
2017-05-11 13:13 ` Paul Clarke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1866798.U7tsNezOxe@agathebauer \
    --to=milian.wolff@kdab.com \
    --cc=Linux-kernel@vger.kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=kernel-team@lge.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=yao.jin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).