diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-20 01:47:21 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-06-08 17:31:27 -0400 |
commit | b0f82b81fe6bbcf78d478071f33e44554726bc81 (patch) | |
tree | 6305c095b927f956a791b9dce687cb94a21718e6 /include/linux/perf_event.h | |
parent | c9cf4dbb4d9ca715d8fedf13301a53296429abc6 (diff) |
perf: Drop the skip argument from perf_arch_fetch_regs_caller
Drop this argument now that we always want to rewind only to the
state of the first caller.
It means frame pointers are not necessary anymore to reliably get
the source of an event. But this also means we need this helper
to be a macro now, as an inline function is not an option since
we need to know when to provide a default implentation.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: David Miller <davem@davemloft.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index fb6c91eac7e3..bea785cef493 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -905,8 +905,10 @@ extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; | |||
905 | 905 | ||
906 | extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); | 906 | extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); |
907 | 907 | ||
908 | extern void | 908 | #ifndef perf_arch_fetch_caller_regs |
909 | perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip); | 909 | static inline void |
910 | perf_arch_fetch_caller_regs(struct regs *regs, unsigned long ip) { } | ||
911 | #endif | ||
910 | 912 | ||
911 | /* | 913 | /* |
912 | * Take a snapshot of the regs. Skip ip and frame pointer to | 914 | * Take a snapshot of the regs. Skip ip and frame pointer to |
@@ -916,31 +918,11 @@ perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip); | |||
916 | * - bp for callchains | 918 | * - bp for callchains |
917 | * - eflags, for future purposes, just in case | 919 | * - eflags, for future purposes, just in case |
918 | */ | 920 | */ |
919 | static inline void perf_fetch_caller_regs(struct pt_regs *regs, int skip) | 921 | static inline void perf_fetch_caller_regs(struct pt_regs *regs) |
920 | { | 922 | { |
921 | unsigned long ip; | ||
922 | |||
923 | memset(regs, 0, sizeof(*regs)); | 923 | memset(regs, 0, sizeof(*regs)); |
924 | 924 | ||
925 | switch (skip) { | 925 | perf_arch_fetch_caller_regs(regs, CALLER_ADDR0); |
926 | case 1 : | ||
927 | ip = CALLER_ADDR0; | ||
928 | break; | ||
929 | case 2 : | ||
930 | ip = CALLER_ADDR1; | ||
931 | break; | ||
932 | case 3 : | ||
933 | ip = CALLER_ADDR2; | ||
934 | break; | ||
935 | case 4: | ||
936 | ip = CALLER_ADDR3; | ||
937 | break; | ||
938 | /* No need to support further for now */ | ||
939 | default: | ||
940 | ip = 0; | ||
941 | } | ||
942 | |||
943 | return perf_arch_fetch_caller_regs(regs, ip, skip); | ||
944 | } | 926 | } |
945 | 927 | ||
946 | static inline void | 928 | static inline void |
@@ -950,7 +932,7 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | |||
950 | struct pt_regs hot_regs; | 932 | struct pt_regs hot_regs; |
951 | 933 | ||
952 | if (!regs) { | 934 | if (!regs) { |
953 | perf_fetch_caller_regs(&hot_regs, 1); | 935 | perf_fetch_caller_regs(&hot_regs); |
954 | regs = &hot_regs; | 936 | regs = &hot_regs; |
955 | } | 937 | } |
956 | __perf_sw_event(event_id, nr, nmi, regs, addr); | 938 | __perf_sw_event(event_id, nr, nmi, regs, addr); |