From: Frederic Weisbecker <fweisbec@gmail.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: acme@redhat.com, a.p.zijlstra@chello.nl, mingo@elte.hu,
paulus@samba.org, cjashfor@linux.vnet.ibm.com,
eranian@google.com, gorcunov@openvz.org, tzanussi@gmail.com,
mhiramat@redhat.com, robert.richter@amd.com, fche@redhat.com,
linux-kernel@vger.kernel.org, masami.hiramatsu.pt@hitachi.com,
drepper@gmail.com, asharma@fb.com,
benjamin.redelings@nescent.org
Subject: Re: [PATCH 14/17] perf, tool: Support for dwarf cfi unwinding on post processing
Date: Wed, 25 Jul 2012 19:05:33 +0200 [thread overview]
Message-ID: <20120725170530.GE1173@somewhere.redhat.com> (raw)
In-Reply-To: <1342959280-5361-15-git-send-email-jolsa@redhat.com>
On Sun, Jul 22, 2012 at 02:14:37PM +0200, Jiri Olsa wrote:
> This brings the support for dwarf cfi unwinding on perf post
> processing. Call frame informations are retrieved and then passed
> to libunwind that requests memory and register content from the
> applications.
>
> Adding unwind object to handle the user stack backtrace based
> on the user register values and user stack dump.
>
> The unwind object access the libunwind via remote interface
> and provides to it all the necessary data to unwind the stack.
>
> The unwind interface provides following function:
> unwind__get_entries
>
> And callback (specified in above function) to retrieve
> the backtrace entries:
> typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry,
> void *arg);
>
> Signed-off-by: Jiri Olsa <jolsa@redhat.com>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> ---
> tools/perf/Makefile | 2 +
> tools/perf/arch/x86/Makefile | 3 +
> tools/perf/arch/x86/util/unwind.c | 111 ++++
> tools/perf/builtin-report.c | 24 +-
> tools/perf/builtin-script.c | 16 +-
> tools/perf/builtin-top.c | 5 +-
> tools/perf/util/include/linux/compiler.h | 1 +
> tools/perf/util/map.h | 7 +-
> .../perf/util/scripting-engines/trace-event-perl.c | 3 +-
> .../util/scripting-engines/trace-event-python.c | 3 +-
> tools/perf/util/session.c | 61 ++-
> tools/perf/util/session.h | 3 +-
> tools/perf/util/trace-event-scripting.c | 3 +-
> tools/perf/util/trace-event.h | 5 +-
> tools/perf/util/unwind.c | 567 ++++++++++++++++++++
> tools/perf/util/unwind.h | 34 ++
> 16 files changed, 811 insertions(+), 37 deletions(-)
> create mode 100644 tools/perf/arch/x86/util/unwind.c
> create mode 100644 tools/perf/util/unwind.c
> create mode 100644 tools/perf/util/unwind.h
>
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index d0c3291..c18c790 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -328,6 +328,7 @@ LIB_H += util/cgroup.h
> LIB_H += $(TRACE_EVENT_DIR)event-parse.h
> LIB_H += util/target.h
> LIB_H += util/perf_regs.h
> +LIB_H += util/unwind.h
>
> LIB_OBJS += $(OUTPUT)util/abspath.o
> LIB_OBJS += $(OUTPUT)util/alias.o
> @@ -513,6 +514,7 @@ else
> EXTLIBS += $(LIBUNWIND_LIBS)
> BASIC_CFLAGS := $(LIBUNWIND_CFLAGS) $(BASIC_CFLAGS)
> BASIC_LDFLAGS := $(LIBUNWIND_LDFLAGS) $(BASIC_LDFLAGS)
> + LIB_OBJS += $(OUTPUT)util/unwind.o
> endif
>
> ifdef NO_NEWT
> diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
> index 744e629..815841c 100644
> --- a/tools/perf/arch/x86/Makefile
> +++ b/tools/perf/arch/x86/Makefile
> @@ -2,4 +2,7 @@ ifndef NO_DWARF
> PERF_HAVE_DWARF_REGS := 1
> LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
> endif
> +ifndef NO_LIBUNWIND
> +LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind.o
> +endif
> LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o
> diff --git a/tools/perf/arch/x86/util/unwind.c b/tools/perf/arch/x86/util/unwind.c
> new file mode 100644
> index 0000000..78d956e
> --- /dev/null
> +++ b/tools/perf/arch/x86/util/unwind.c
> @@ -0,0 +1,111 @@
> +
> +#include <errno.h>
> +#include <libunwind.h>
> +#include "perf_regs.h"
> +#include "../../util/unwind.h"
> +
> +#ifdef ARCH_X86_64
> +int unwind__arch_reg_id(int regnum)
Please try to avoid __ in function names. We used that convention
before but we gave up because that's actually more painful than
anything.
next prev parent reply other threads:[~2012-07-25 17:05 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-22 12:14 [PATCHv7 00/17] perf: Add backtrace post dwarf unwind Jiri Olsa
2012-07-22 12:14 ` [PATCH 01/17] perf: Unified API to record selective sets of arch registers Jiri Olsa
2012-07-25 16:12 ` Frederic Weisbecker
2012-07-26 17:51 ` Arnaldo Carvalho de Melo
2012-07-29 22:45 ` Paul Mackerras
2012-07-22 12:14 ` [PATCH 02/17] perf: Add ability to attach user level registers dump to sample Jiri Olsa
2012-07-25 16:13 ` Frederic Weisbecker
2012-07-25 17:00 ` Arnaldo Carvalho de Melo
2012-07-25 17:39 ` Stephane Eranian
2012-07-25 18:27 ` Jiri Olsa
2012-07-26 17:42 ` Stephane Eranian
2012-07-26 17:58 ` Jiri Olsa
2012-07-22 12:14 ` [PATCH 03/17] perf, x86: Add copy_from_user_nmi_nochk for best effort copy Jiri Olsa
2012-07-25 16:11 ` Frederic Weisbecker
2012-07-25 17:16 ` Jiri Olsa
2012-07-25 17:25 ` Frederic Weisbecker
2012-07-25 17:30 ` Jiri Olsa
2012-07-25 17:35 ` Frederic Weisbecker
2012-08-02 18:47 ` Andy Lutomirski
2012-08-03 11:12 ` Jiri Olsa
2012-07-22 12:14 ` [PATCH 04/17] perf: Factor __output_copy to be usable with specific copy function Jiri Olsa
2012-07-22 12:14 ` [PATCH 05/17] perf: Add perf_output_skip function to skip bytes in sample Jiri Olsa
2012-07-22 12:14 ` [PATCH 06/17] perf: Add ability to attach user stack dump to sample Jiri Olsa
2012-07-25 16:36 ` Frederic Weisbecker
2012-07-25 17:03 ` Jiri Olsa
2012-07-22 12:14 ` [PATCH 07/17] perf: Add attribute to filter out callchains Jiri Olsa
2012-07-22 12:14 ` [PATCH 08/17] perf, tool: Adding PERF_ATTR_SIZE_VER2 to the header swap check Jiri Olsa
2012-07-22 12:14 ` [PATCH 09/17] perf, tool: Factor DSO symtab types to generic binary types Jiri Olsa
2012-07-25 19:24 ` [tip:perf/core] perf symbols: " tip-bot for Jiri Olsa
2012-07-22 12:14 ` [PATCH 10/17] perf, tool: Add interface to read DSO image data Jiri Olsa
2012-07-25 19:25 ` [tip:perf/core] perf symbols: " tip-bot for Jiri Olsa
2012-07-22 12:14 ` [PATCH 11/17] perf, tool: Add interface to arch registers sets Jiri Olsa
2012-07-22 12:14 ` [PATCH 12/17] perf, tool: Add libunwind dependency for dwarf cfi unwinding Jiri Olsa
2012-07-22 12:14 ` [PATCH 13/17] perf, tool: Support user regs and stack in sample parsing Jiri Olsa
2012-07-22 12:14 ` [PATCH 14/17] perf, tool: Support for dwarf cfi unwinding on post processing Jiri Olsa
2012-07-25 17:05 ` Frederic Weisbecker [this message]
2012-07-25 17:16 ` Arnaldo Carvalho de Melo
2012-07-25 17:21 ` Frederic Weisbecker
2012-07-22 12:14 ` [PATCH 15/17] perf, tool: Support for dwarf mode callchain on perf record Jiri Olsa
2012-07-22 12:14 ` [PATCH 16/17] perf, tool: Add dso data caching Jiri Olsa
2012-07-25 17:11 ` Frederic Weisbecker
2012-07-25 19:26 ` [tip:perf/core] perf symbols: " tip-bot for Jiri Olsa
2012-07-22 12:14 ` [PATCH 17/17] perf, tool: Add dso data caching tests Jiri Olsa
2012-07-25 19:28 ` [tip:perf/core] perf test: " tip-bot for Jiri Olsa
2012-07-25 17:15 ` [PATCHv7 00/17] perf: Add backtrace post dwarf unwind Frederic Weisbecker
2012-07-25 17:19 ` Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2012-05-02 11:37 [RFCv3 " Jiri Olsa
2012-05-02 11:37 ` [PATCH 14/17] perf, tool: Support for dwarf cfi unwinding on post processing Jiri Olsa
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=20120725170530.GE1173@somewhere.redhat.com \
--to=fweisbec@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=asharma@fb.com \
--cc=benjamin.redelings@nescent.org \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=drepper@gmail.com \
--cc=eranian@google.com \
--cc=fche@redhat.com \
--cc=gorcunov@openvz.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mhiramat@redhat.com \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=robert.richter@amd.com \
--cc=tzanussi@gmail.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
Powered by JetHome