[RFC v2] perf: Dwarf cfi based user callchains
From: Frederic Weisbecker
Date: Fri Oct 22 2010 - 15:15:48 EST
Various things have changed in this set.
- copy_from_user_nmi() renamed into copy_from_user_gup()
- regs dumping uses a version now and the user can select
its own subset flavour of the regs proposed by the arch.
But look: there is an open question in the 3rd patch to handle
the compat stuff.
- new exclude_user_callchain attribute, instead of dropping fp based
user callchains if we dump regs and stack.
- etc...
Important things to be done:
- Still no dwarf cfi from vdso. But I've read somewhere that vdso has
dwarf cfi info. I need to handle that somewhow. Until then, it is
only usable if you profile only userspace (use the :u flag in your event,
as in the example below).
- Split generic/arch code in tools/perf/util/unwind.c
- Use .eh_frame_hdr for binary searching
- Make it much faster, it's too slow right now. Perhaps that needs some
cfi info caching.
- handle compat regs, look at the open question in 3rd patch.
How to test:
perf record -g dwarf -e cycles:u ./hackbench 10
perf report
You can increase the stack dump by playing with the size, it is about 4000 by
default, if you want 10000 bytes:
perf record -g dwarf,10000 -e cycles:u ./hackbench 10
You can pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
perf/unwind-v2
Thanks.
---
Frederic Weisbecker (11):
uaccess: New copy_from_user_gup() API
perf: Unified API to record selective sets of arch registers
perf: Add ability to dump user regs
perf: Add ability to dump part of the user stack
perf: New attribute to filter out user callchains
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 user regs and stack in sample parsing
perf: Support for dwarf cfi unwinding on post processing
arch/Kconfig | 7 +
arch/x86/Kconfig | 1 +
arch/x86/include/asm/perf_regs.h | 10 +
arch/x86/include/asm/perf_regs_32.h | 85 +++
arch/x86/include/asm/uaccess.h | 5 +
arch/x86/kernel/cpu/perf_event.c | 8 +-
arch/x86/kernel/cpu/perf_event_intel_ds.c | 2 +-
include/asm-generic/uaccess.h | 4 +
include/linux/perf_event.h | 40 +-
kernel/perf_event.c | 194 +++++-
tools/perf/Makefile | 30 +-
tools/perf/arch/x86/include/perf_regs.h | 11 +
tools/perf/builtin-kmem.c | 2 +-
tools/perf/builtin-lock.c | 2 +-
tools/perf/builtin-record.c | 78 ++-
tools/perf/builtin-report.c | 9 +-
tools/perf/builtin-sched.c | 2 +-
tools/perf/builtin-timechart.c | 2 +-
tools/perf/builtin-trace.c | 2 +-
tools/perf/feature-tests.mak | 14 +
tools/perf/util/callchain.c | 35 +-
tools/perf/util/callchain.h | 19 +-
tools/perf/util/event.c | 28 +-
tools/perf/util/event.h | 15 +-
tools/perf/util/header.c | 33 +-
tools/perf/util/header.h | 3 +-
tools/perf/util/include/linux/err.h | 24 +
tools/perf/util/perf_regs.h | 11 +
tools/perf/util/session.c | 4 +-
tools/perf/util/session.h | 6 +
tools/perf/util/unwind.c | 1112 +++++++++++++++++++++++++++++
31 files changed, 1739 insertions(+), 59 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/