[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1280739734.1923.20.camel@laptop>
Date: Mon, 02 Aug 2010 11:02:14 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Arnaldo Carvalho de Melo <acme@...radead.org>
Cc: Gleb Natapov <gleb@...hat.com>, linux-kernel@...r.kernel.org,
mingo@...e.hu, paulus@...ba.org
Subject: Re: [PATCH v2] Re: perf annotate segfaults when source code has
goto label that looks like hex number
On Thu, 2010-07-22 at 16:11 -0300, Arnaldo Carvalho de Melo wrote:
> > > diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
> > > @@ -976,13 +976,15 @@ static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file,
> > > if (line_ip != -1) {
> > > u64 start = map__rip_2objdump(self->ms.map, sym->start);
> > > offset = line_ip - start;
> > > + if (offset < 0 || (u64)line_ip > sym->end)
> > > + offset = -1;
>
> > This part is good idea anyway. Even if label will be interpreted as ip
> > perf at least will not crash. It may miss-report something if check will
> > accidentally succeed though.
>
> Yeah, we can possibly find a label which is a valid hex number and that
> falls inside the address range, but with what we have in objdump this
> seems to be the best we can have, I'll commit this.
Wouldn't it be better to re-write perf-annotate to not have wild monkey
sex with objdump and instead 'borrow' some of the objdump code to
generate the output ourselves? That way we don't rely on the output
syntax at all..
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists