Re: [RFC/PATCH] perf tools: Introduce perf_thread for backtrace
From: Namhyung Kim
Date: Tue Nov 24 2015 - 02:25:37 EST
Hi Arnaldo and Masami,
On Fri, Nov 20, 2015 at 09:10:44AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Fri, Nov 20, 2015 at 09:05:23AM +0000, åæéå / HIRAMATUïMASAMI escreveu:
> > >From: Namhyung Kim [mailto:namhyung@xxxxxxxxxx]
> > >
> > >Backtrace is a crucial info for debugging. And upcoming refcnt
> > >tracking facility also wants to use it.
> > >
> > >So instead of relying on glibc's backtrace_symbols[_fd] which misses
> > >some (static) functions , use our own symbol searching mechanism. To
> > >do that, add perf_thread global variable to keep its maps and symbols.
> >
> > Hmm, I doubt that this can work for debugging situation, because
> > sometimes backtrace facilities has to debug itself by itself.
>
> That is a valid point, possibly we can have both and when we think that
> the code we rely on for resolving symbols has issues, activate the
> other, more expensive, binutils/elfutils spawned command line utilities
> to do compare the results?
Yeah, that's a possible solution. We can start by using our own, and
if there's a certain amount of failure in symbol resolving, then
fallback to glibc's backtrace_symbols + addr2line.
>
> > For the some (static) functions, I'd rather like to use glibc's
> > backtrace_symbols and addr2line or even with raw address for
> > reliability...
I also printed the raw addresses in case of doubts, so you could
verify its correctness. :) And IMHO, if something is severely broken,
we might not rely on glibc too.
Having said that, I agree with your concern and it needs the fallback
method for possible malfunction. But I guess it'd work quite well for
most cases so it's worth trying to convert using it. I'll work on the
fallback method then..
Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/