kernel-ark/arch
Paul Mackerras 9eff26ea48 powerpc/perf_events: Fix call-graph recording, add perf_arch_fetch_caller_regs
This implements a powerpc version of perf_arch_fetch_caller_regs
to get correct call-graphs.

It's implemented in assembly because that way we can be sure there isn't
a stack frame for perf_arch_fetch_caller_regs.  If it was in C, gcc might
or might not create a stack frame for it, which would affect the number
of levels we have to skip.

With this, we see results from perf record -e lock:lock_acquire like
this:

 # Samples: 24878
 #
 # Overhead         Command      Shared Object  Symbol
 # ........  ..............  .................  ......
 #
    14.99%            perf  [kernel.kallsyms]  [k] ._raw_spin_lock
                      |
                      --- ._raw_spin_lock
                         |
                         |--25.00%-- .alloc_fd
                         |          (nil)
                         |          |
                         |          |--50.00%-- .anon_inode_getfd
                         |          |          .sys_perf_event_open
                         |          |          syscall_exit
                         |          |          syscall
                         |          |          create_counter
                         |          |          __cmd_record
                         |          |          run_builtin
                         |          |          main
                         |          |          0xfd2e704
                         |          |          0xfd2e8c0
                         |          |          (nil)

... etc.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: anton@samba.org
Cc: linuxppc-dev@ozlabs.org
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20100318050513.GA6575@drongo>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-03-18 06:48:29 +01:00
..
alpha alpha: PTR_ERR overwrites -EINVAL in syscall osf_mount 2010-03-06 11:26:27 -08:00
arm perf: Provide generic perf_sample_data initialization 2010-03-10 13:22:23 +01:00
avr32 USB: atmel uaba: Adding invert vbus_pin 2010-03-02 14:54:57 -08:00
blackfin
cris cris v32: typo in crisv32_arbiter_unwatch()? 2010-03-06 11:26:28 -08:00
frv frv: remove pci_dma_sync_single() and pci_dma_sync_sg() 2010-03-06 11:26:27 -08:00
h8300 m68k{,nommu}/h8300: Remove obsolete comment about map_chunk 2010-02-27 18:27:14 +01:00
ia64 Driver core: Constify struct sysfs_ops in struct kobj_type 2010-03-07 17:04:49 -08:00
m32r Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2010-03-03 07:34:18 -08:00
m68k Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-03-01 09:15:15 -08:00
m68knommu m68knommu: NPTL support for uClinux 2010-02-27 18:35:22 +01:00
microblaze Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2010-03-03 07:34:18 -08:00
mips sysdev: Pass attribute in sysdev_class attributes show/store 2010-03-07 17:04:47 -08:00
mn10300 Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-03-01 09:15:15 -08:00
parisc parisc: use __ratelimit in unaligned.c 2010-03-06 22:54:59 +00:00
powerpc powerpc/perf_events: Fix call-graph recording, add perf_arch_fetch_caller_regs 2010-03-18 06:48:29 +01:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2010-03-08 10:17:20 -08:00
score Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-03-01 09:15:15 -08:00
sh perf: Rework and fix the arch CPU-hotplug hooks 2010-03-10 13:22:24 +01:00
sparc perf: Provide generic perf_sample_data initialization 2010-03-10 13:22:23 +01:00
um elf coredump: add extended numbering support 2010-03-06 11:26:46 -08:00
x86 perf: export perf_trace_regs and perf_arch_fetch_caller_regs 2010-03-11 15:21:29 +01:00
xtensa Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2010-03-02 07:55:08 -08:00
.gitignore
Kconfig Merge branch 'perf-probes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-03-05 10:50:22 -08:00