linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] perf: Dwarf cfi based user callchains
@ 2010-10-13  5:06 Frederic Weisbecker
  2010-10-13  5:06 ` [RFC PATCH 1/9] uaccess: Make copy_from_user_nmi() globally available Frederic Weisbecker
                   ` (9 more replies)
  0 siblings, 10 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2010-10-13  5:06 UTC (permalink / raw)
  To: LKML
  Cc: LKML, Frederic Weisbecker, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Paul Mackerras, Stephane Eranian,
	Cyrill Gorcunov, Tom Zanussi, Masami Hiramatsu, Steven Rostedt,
	Robert Richter

Hi,

This brings dwarf cfi based callchain for userspace apps that don't have
frame pointers.

To test it, you can try:

perf record -g dwarf,24000 -e cycles:u ./hackbench 2
perf report

It seems to work but there are of course many things to improve:

- do only userspace profiling with that mode for now (the :u flag as above).
  The reason is that if you profile also the kernel, the user callchains
  will often start from vdso if the user made a syscall, and vdso doesn't
  have cfi informations, so we get stuck there. I need to find a solution for
  that, like doing a single frame pointer deref on the first entry (vdso)
  and continue with dwarves, but I need to know if we came from a syscall for
  that. Not sure yet how I'll handle that.

- it only works with .eh_frame, I think there is an elf section that is made
  almost the same but with few differences. I don't remember the name at that
  time but that needs a look.

- it's slow. A first improvement to make it faster is to support binary
  search from .eh_frame_hdr. This will probably be one of the next things
  I'll focus in. And the whole needs perhaps more caching and so on.

- only support for x86-32. I need to split some arch specific code from
  generic and add at least x86-64 support.

- there are still some callchains that are not unwind. I need to investigate.

This can be found in:

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
	perf/unwind-v1

Thanks,
	Frederic
---

Frederic Weisbecker (9):
      uaccess: Make copy_from_user_nmi() globally available
      perf: Add ability to dump user regs
      perf: Add ability to dump part of the user stack
      perf: Don't record frame pointer based user stacktraces if we dump stack and regs
      perf: Support for dwarf mode callchain on perf record
      perf: Build with dwarf cfi
      perf: Support for error passed over pointers
      perf: Add libunwind dependency for dwarf cfi unwinding
      perf: Support for dwarf cfi unwinding on post processing


 arch/x86/include/asm/uaccess.h      |    5 +
 arch/x86/kernel/cpu/perf_event.c    |    4 +-
 include/asm-generic/uaccess.h       |    4 +
 include/linux/perf_event.h          |   15 +-
 kernel/perf_event.c                 |  182 +++++-
 tools/perf/Makefile                 |   23 +-
 tools/perf/builtin-record.c         |   76 +++-
 tools/perf/builtin-report.c         |    9 +-
 tools/perf/feature-tests.mak        |   14 +
 tools/perf/perf.h                   |    5 +
 tools/perf/util/callchain.c         |   35 +-
 tools/perf/util/callchain.h         |   19 +-
 tools/perf/util/event.c             |   29 +
 tools/perf/util/event.h             |    7 +
 tools/perf/util/include/linux/err.h |   24 +
 tools/perf/util/unwind.c            | 1077 +++++++++++++++++++++++++++++++++++
 16 files changed, 1485 insertions(+), 43 deletions(-)

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2010-10-20 16:19 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-13  5:06 [RFC] perf: Dwarf cfi based user callchains Frederic Weisbecker
2010-10-13  5:06 ` [RFC PATCH 1/9] uaccess: Make copy_from_user_nmi() globally available Frederic Weisbecker
2010-10-13  7:15   ` Peter Zijlstra
2010-10-13 14:47     ` Frederic Weisbecker
2010-10-13 20:43       ` Peter Zijlstra
2010-10-13  5:06 ` [RFC PATCH 2/9] perf: Add ability to dump user regs Frederic Weisbecker
2010-10-13  7:20   ` Peter Zijlstra
2010-10-13 14:56     ` Frederic Weisbecker
2010-10-13 14:58     ` Frederic Weisbecker
2010-10-14 11:06     ` Stephane Eranian
2010-10-14 11:20       ` Frederic Weisbecker
2010-10-15  8:39         ` Stephane Eranian
2010-10-15 22:58           ` Frederic Weisbecker
2010-10-17 10:07             ` Peter Zijlstra
2010-10-18 10:01               ` Stephane Eranian
2010-10-18 22:35                 ` Frederic Weisbecker
2010-10-20  9:24                   ` Stephane Eranian
2010-10-20 16:13                     ` Frederic Weisbecker
2010-10-20 16:19                     ` Peter Zijlstra
2010-10-13  5:06 ` [RFC PATCH 3/9] perf: Add ability to dump part of the user stack Frederic Weisbecker
2010-10-13  7:22   ` Peter Zijlstra
2010-10-13 15:01     ` Frederic Weisbecker
2010-10-13  5:06 ` [RFC PATCH 4/9] perf: Don't record frame pointer based user stacktraces if we dump stack and regs Frederic Weisbecker
2010-10-13  7:23   ` Peter Zijlstra
2010-10-13 15:02     ` Frederic Weisbecker
2010-10-16  0:19     ` Frederic Weisbecker
2010-10-13  5:06 ` [RFC PATCH 5/9] perf: Support for dwarf mode callchain on perf record Frederic Weisbecker
2010-10-13  5:06 ` [RFC PATCH 6/9] perf: Build with dwarf cfi Frederic Weisbecker
2010-10-13  5:06 ` [RFC PATCH 7/9] perf: Support for error passed over pointers Frederic Weisbecker
2010-10-13  5:07 ` [RFC PATCH 8/9] perf: Add libunwind dependency for dwarf cfi unwinding Frederic Weisbecker
2010-10-13  5:07 ` [RFC PATCH 9/9] perf: Support for dwarf cfi unwinding on post processing Frederic Weisbecker
2010-10-13 15:13 ` [RFC] perf: Dwarf cfi based user callchains Frank Ch. Eigler
2010-10-20 15:35   ` Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).