lkml.org 
[lkml]   [2015]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] perf: fix dwarf unwind using libunwind.
Em Wed, Jan 14, 2015 at 12:57:49PM +0100, Jiri Olsa escreveu:
> On Wed, Jan 14, 2015 at 10:36:47AM +0800, Wang Nan wrote:
> > Perf tool fails to unwind user stack if the event raises in a shared
>
> SNIP
>
> > +
> > __attribute__ ((noinline))
> > static int krava_3(struct thread *thread)
> > {
> > - return unwind_thread(thread);
> > + struct thread *array[2] = {thread, thread};
> > + void *fp = &bsearch;
> > + /*
> > + * make _bsearch a volatile function pointer to
> > + * prevent potential optimization, which may expand
> > + * bsearch and call compare directly from this function,
> > + * instead of libc shared object.
> > + */
> > + void *(*volatile _bsearch)(void *, void *, size_t,
> > + size_t, int (*)(void *, void *));
> > +
> > + _bsearch = fp;
> > + _bsearch(array, &thread, 2, sizeof(struct thread **), compare);
> > + return global_unwind_retval;
> > }
>
> ah, I've got confused with the NO_LIBUNWIND_DEBUG_FRAME name
> and got the impression that we could use it in the tests/make
> as another compile option test..
>
> but your change is even better ;-) thanks for updating this test
>
>
> Acked-by: Jiri Olsa <jolsa@kernel.org>

Thanks, applied to perf/urgent.

- Arnaldo


\
 
 \ /
  Last update: 2015-01-14 14:01    [W:0.229 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site