mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Wang Nan <wangnan0@huawei.com>
Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org,
	lizefan@huawei.com, namhyung@kernel.org, a.p.zijlstra@chello.nl,
	paulus@samba.org, mingo@redhat.com, acme@kernel.org,
	masami.hiramatsu.pt@hitachi.com
Subject: Re: [PATCH v2] perf: fix dwarf unwind using libunwind.
Date: Wed, 14 Jan 2015 12:57:49 +0100	[thread overview]
Message-ID: <20150114115749.GB6369@krava.redhat.com> (raw)
In-Reply-To: <1421203007-75799-1-git-send-email-wangnan0@huawei.com>

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,
jirka

  reply	other threads:[~2015-01-14 11:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13  2:54 [PATCH] " Wang Nan
2015-01-13  7:10 ` Jiri Olsa
2015-01-13  8:36   ` Wang Nan
2015-01-13  9:19     ` Jiri Olsa
2015-01-14  2:36       ` [PATCH v2] " Wang Nan
2015-01-14 11:57         ` Jiri Olsa [this message]
2015-01-14 12:50           ` Arnaldo Carvalho de Melo
2015-01-17 10:12         ` [tip:perf/urgent] perf test: Fix " tip-bot for Wang Nan

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=20150114115749.GB6369@krava.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=wangnan0@huawei.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

all inboxes | Powered by JetHome®