[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160530085324.GG25607@krava>
Date: Mon, 30 May 2016 10:53:24 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: He Kuang <hekuang@...wei.com>
Cc: peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
alexander.shishkin@...ux.intel.com, wangnan0@...wei.com,
jpoimboe@...hat.com, ak@...ux.intel.com, eranian@...gle.com,
namhyung@...nel.org, adrian.hunter@...el.com,
sukadev@...ux.vnet.ibm.com, masami.hiramatsu.pt@...achi.com,
tumanova@...ux.vnet.ibm.com, kan.liang@...el.com,
penberg@...nel.org, dsahern@...il.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 03/11] perf tools: Introducing struct
unwind_libunwind_ops for local unwind
On Sat, May 28, 2016 at 11:59:52AM +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@...wei.com>
> ---
> tools/perf/util/thread.c | 2 ++
> tools/perf/util/thread.h | 14 +++++++++-
> tools/perf/util/unwind-libunwind.c | 55 ++++++++++++++++++++++++++++++++++----
> tools/perf/util/unwind.h | 5 ++++
> 4 files changed, 70 insertions(+), 6 deletions(-)
>
> diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
> index 45fcb71..6d3900c 100644
> --- a/tools/perf/util/thread.c
> +++ b/tools/perf/util/thread.c
> @@ -43,6 +43,8 @@ struct thread *thread__new(pid_t pid, pid_t tid)
> thread->cpu = -1;
> INIT_LIST_HEAD(&thread->comm_list);
>
> + register_local_unwind_libunwind_ops(thread);
> +
> if (unwind__prepare_access(thread) < 0)
> goto err_thread;
>
> diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
> index aa3a8ff..647b011 100644
> --- a/tools/perf/util/thread.h
> +++ b/tools/perf/util/thread.h
> @@ -12,6 +12,17 @@
>
> struct thread_stack;
>
> +struct unwind_entry;
> +typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry, void *arg);
> +struct unwind_libunwind_ops {
> + int (*prepare_access)(struct thread *thread);
> + void (*flush_access)(struct thread *thread);
> + void (*finish_access)(struct thread *thread);
> + int (*get_entries)(unwind_entry_cb_t cb, void *arg,
> + struct thread *thread,
> + struct perf_sample *data, int max_stack);
> +};
> +
this should rather go to util/unwind.h
thanks,
jirka
Powered by blists - more mailing lists