diff options
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); |