diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-06-30 17:03:51 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-08-18 19:30:59 -0400 |
commit | 56962b4449af34070bb1994621ef4f0265eed4d8 (patch) | |
tree | b4c5dfee35d272c71cba80e75a51cb3e7070e430 /include | |
parent | 70791ce9ba68a5921c9905ef05d23f62a90bc10c (diff) |
perf: Generalize some arch callchain code
- Most archs use one callchain buffer per cpu, except x86 that needs
to deal with NMIs. Provide a default perf_callchain_buffer()
implementation that x86 overrides.
- Centralize all the kernel/user regs handling and invoke new arch
handlers from there: perf_callchain_user() / perf_callchain_kernel()
That avoid all the user_mode(), current->mm checks and so...
- Invert some parameters in perf_callchain_*() helpers: entry to the
left, regs to the right, following the traditional (dst, src).
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Tested-by: Will Deacon <will.deacon@arm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: David Miller <davem@davemloft.net>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Borislav Petkov <bp@amd64.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/perf_event.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 358880404b42..4db61dded388 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -976,7 +976,15 @@ extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks | |||
976 | extern void perf_event_comm(struct task_struct *tsk); | 976 | extern void perf_event_comm(struct task_struct *tsk); |
977 | extern void perf_event_fork(struct task_struct *tsk); | 977 | extern void perf_event_fork(struct task_struct *tsk); |
978 | 978 | ||
979 | extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); | 979 | /* Callchains */ |
980 | DECLARE_PER_CPU(struct perf_callchain_entry, perf_callchain_entry); | ||
981 | |||
982 | extern void perf_callchain_user(struct perf_callchain_entry *entry, | ||
983 | struct pt_regs *regs); | ||
984 | extern void perf_callchain_kernel(struct perf_callchain_entry *entry, | ||
985 | struct pt_regs *regs); | ||
986 | extern struct perf_callchain_entry *perf_callchain_buffer(void); | ||
987 | |||
980 | 988 | ||
981 | static inline void | 989 | static inline void |
982 | perf_callchain_store(struct perf_callchain_entry *entry, u64 ip) | 990 | perf_callchain_store(struct perf_callchain_entry *entry, u64 ip) |