Re: [RFC/PATCH] perf tools: Introduce perf_thread for backtrace

From: Namhyung Kim
Date: Tue Nov 24 2015 - 02:34:54 EST


On Mon, Nov 23, 2015 at 06:39:36PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Fri, Nov 20, 2015 at 03:03:03PM +0900, Namhyung Kim escreveu:
> > 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.
> >
> > The backtrace output from TUI is changed like below. (I made a key
> > action to generate a segfault for testing):
>
> This is a really nice use of what we have, I guess we could simplify
> things further, not having to create a struct machine, as we have just
> one thread, and we're not interested in kernel addresses, so no need for
> kmaps, etc.

Yes, I thought about it. But as adding the perf thread to an existing
machine can affect other thread(s), I didn't do it. Maybe we can set
the perf threads' machine pointer in a hacky way without adding the
thread into the machine, but I'd rather not doing that too because
it's fragile and current code is simple enough IMHO.


>
> But as-is it already looks better than what we were using :-)
>
> I'll try testing it further and will probably switch to using it if
> nobody voices any problem we haven't realised with such approach.

Thank you!
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/