diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-06-29 13:34:05 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-08-18 19:30:11 -0400 |
commit | 70791ce9ba68a5921c9905ef05d23f62a90bc10c (patch) | |
tree | 9711ff02cb910e1d8709c09512dbe7e94224bdd8 /include/linux/perf_event.h | |
parent | c1a65932fd7216fdc9a0db8bbffe1d47842f862c (diff) |
perf: Generalize callchain_store()
callchain_store() is the same on every archs, inline it in
perf_event.h and rename it to perf_callchain_store() to avoid
any collision.
This removes repetitive code.
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/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 937495c25073..358880404b42 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -978,6 +978,13 @@ extern void perf_event_fork(struct task_struct *tsk); | |||
978 | 978 | ||
979 | extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); | 979 | extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); |
980 | 980 | ||
981 | static inline void | ||
982 | perf_callchain_store(struct perf_callchain_entry *entry, u64 ip) | ||
983 | { | ||
984 | if (entry->nr < PERF_MAX_STACK_DEPTH) | ||
985 | entry->ip[entry->nr++] = ip; | ||
986 | } | ||
987 | |||
981 | extern int sysctl_perf_event_paranoid; | 988 | extern int sysctl_perf_event_paranoid; |
982 | extern int sysctl_perf_event_mlock; | 989 | extern int sysctl_perf_event_mlock; |
983 | extern int sysctl_perf_event_sample_rate; | 990 | extern int sysctl_perf_event_sample_rate; |