Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1410964

Re: [PATCH v7 03/14] perf tools: Introducing struct unwind_libunwind_ops for local unwind

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v7 03/14] perf tools: Introducing struct unwind_libunwind_ops for local unwind
Date Wed, 01 Jun 2016 10:50:01 +0200
Message-ID <rFa0F-67A-9@gated-at.bofh.it> (permalink)
References <rEPSh-20r-5@gated-at.bofh.it> <rEQ1Z-24b-61@gated-at.bofh.it>
X-Original-To He Kuang <hekuang@huawei.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.6.1 (2016-04-27)
X-Scanned-By MIMEDefang 2.68 on 10.5.11.26
X-Greylist Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 01 Jun 2016 08:39:53 +0000 (UTC)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, wangnan0@huawei.com, jpoimboe@redhat.com, ak@linux.intel.com, eranian@google.com, namhyung@kernel.org, adrian.hunter@intel.com, sukadev@linux.vnet.ibm.com, masami.hiramatsu.pt@hitachi.com, tumanova@linux.vnet.ibm.com, kan.liang@intel.com, penberg@kernel.org, dsahern@gmail.com, linux-kernel@vger.kernel.org
X-Original-Date Wed, 1 Jun 2016 10:39:49 +0200
X-Original-Message-ID <20160601083949.GD13738@krava>
X-Original-References <1464693552-104294-1-git-send-email-hekuang@huawei.com> <1464693552-104294-4-git-send-email-hekuang@huawei.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1410964

Show key headers only | View raw


On Tue, May 31, 2016 at 11:19:01AM +0000, He Kuang wrote:
> Currently, libunwind operations are fixed, and they are chosen
> according to the host architecture. This will lead a problem that if a
> thread is run as x86_32 on x86_64 machine, perf will use libunwind
> methods for x86_64 to parse the callchain and get wrong result.
> 
> This patch changes the fixed methods of libunwind operations to
> thread/map related, and each thread can have indivadual libunwind
> operations. Local libunwind methods are registered as default value.
> 
> Signed-off-by: He Kuang <hekuang@huawei.com>
> ---
>  tools/perf/util/thread.c           |  6 ++++
>  tools/perf/util/thread.h           |  4 ++-
>  tools/perf/util/unwind-libunwind.c | 58 +++++++++++++++++++++++++++++++++++---
>  tools/perf/util/unwind.h           | 19 +++++++++++++
>  4 files changed, 82 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
> index 45fcb71..95ff1b8 100644
> --- a/tools/perf/util/thread.c
> +++ b/tools/perf/util/thread.c
> @@ -43,6 +43,12 @@ struct thread *thread__new(pid_t pid, pid_t tid)
>  		thread->cpu = -1;
>  		INIT_LIST_HEAD(&thread->comm_list);
>  
> +#ifdef HAVE_LIBUNWIND_SUPPORT
> +		unwind__register_ops(thread, local_unwind_libunwind_ops);
> +#else
> +		unwind__register_ops(thread, NULL);
> +#endif
> +

I think we should put unwind__register_ops call into unwind__prepare_access
in this patch (like you do in patch 4) and without the #else clause

this way you can keep unwind__register_ops local

thanks,
jirka

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v7 00/14] Add support for remote unwind He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
  [PATCH v7 11/14] perf tools: Change fixed name of libunwind__arch_reg_id to macro He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
  [PATCH v7 06/14] perf tools: Separate local/remote libunwind config He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
    Re: [PATCH v7 06/14] perf tools: Separate local/remote libunwind  config Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:40 +0200
  [PATCH v7 07/14] perf tools: Rename unwind-libunwind.c to unwind-libunwind-local.c He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
  [PATCH v7 13/14] perf callchain: Support x86 target platform He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
    Re: [PATCH v7 13/14] perf callchain: Support x86 target platform Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:50 +0200
      Re: [PATCH v7 13/14] perf callchain: Support x86 target platform Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-01 14:50 +0200
        Re: [PATCH v7 13/14] perf callchain: Support x86 target platform Jiri Olsa <jolsa@redhat.com> - 2016-06-01 15:20 +0200
    Re: [PATCH v7 13/14] perf callchain: Support x86 target platform Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:50 +0200
      Re: [PATCH v7 13/14] perf callchain: Support x86 target platform Hekuang <hekuang@huawei.com> - 2016-06-01 12:00 +0200
    Re: [PATCH v7 13/14] perf callchain: Support x86 target platform Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:50 +0200
  [PATCH v7 09/14] perf tools: Export normalize_arch() function He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
  [PATCH v7 03/14] perf tools: Introducing struct unwind_libunwind_ops for local unwind He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
    Re: [PATCH v7 03/14] perf tools: Introducing struct  unwind_libunwind_ops for local unwind Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:40 +0200
    Re: [PATCH v7 03/14] perf tools: Introducing struct  unwind_libunwind_ops for local unwind Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:50 +0200
  [PATCH v7 14/14] perf callchain: Support aarch64 cross-platform He Kuang <hekuang@huawei.com> - 2016-05-31 13:30 +0200
    Re: [PATCH v7 14/14] perf callchain: Support aarch64 cross-platform Jiri Olsa <jolsa@redhat.com> - 2016-06-01 10:50 +0200
      Re: [PATCH v7 14/14] perf callchain: Support aarch64 cross-platform Hekuang <hekuang@huawei.com> - 2016-06-01 12:10 +0200

csiph-web