aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-06-09 12:55:20 -0400
committerIngo Molnar <mingo@elte.hu>2010-06-09 12:55:57 -0400
commitc726b61c6a5acc54c55ed7a0e7638cc4c5a100a8 (patch)
tree3f44aa013d31d34951e9610e79ff14c1148ad6ac /include/linux/perf_event.h
parent7be7923633a142402266d642ccebf74f556a649b (diff)
parent018378c55b03f88ff513aba4e0e93b8d4a9cf241 (diff)
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into perf/core
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h32
1 files changed, 7 insertions, 25 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 1218d05728b9..63b5aa5dce69 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -932,8 +932,10 @@ extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX];
932 932
933extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); 933extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64);
934 934
935extern void 935#ifndef perf_arch_fetch_caller_regs
936perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip); 936static inline void
937perf_arch_fetch_caller_regs(struct regs *regs, unsigned long ip) { }
938#endif
937 939
938/* 940/*
939 * Take a snapshot of the regs. Skip ip and frame pointer to 941 * Take a snapshot of the regs. Skip ip and frame pointer to
@@ -943,31 +945,11 @@ perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip);
943 * - bp for callchains 945 * - bp for callchains
944 * - eflags, for future purposes, just in case 946 * - eflags, for future purposes, just in case
945 */ 947 */
946static inline void perf_fetch_caller_regs(struct pt_regs *regs, int skip) 948static inline void perf_fetch_caller_regs(struct pt_regs *regs)
947{ 949{
948 unsigned long ip;
949
950 memset(regs, 0, sizeof(*regs)); 950 memset(regs, 0, sizeof(*regs));
951 951
952 switch (skip) { 952 perf_arch_fetch_caller_regs(regs, CALLER_ADDR0);
953 case 1 :
954 ip = CALLER_ADDR0;
955 break;
956 case 2 :
957 ip = CALLER_ADDR1;
958 break;
959 case 3 :
960 ip = CALLER_ADDR2;
961 break;
962 case 4:
963 ip = CALLER_ADDR3;
964 break;
965 /* No need to support further for now */
966 default:
967 ip = 0;
968 }
969
970 return perf_arch_fetch_caller_regs(regs, ip, skip);
971} 953}
972 954
973static inline void 955static inline void
@@ -977,7 +959,7 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr)
977 struct pt_regs hot_regs; 959 struct pt_regs hot_regs;
978 960
979 if (!regs) { 961 if (!regs) {
980 perf_fetch_caller_regs(&hot_regs, 1); 962 perf_fetch_caller_regs(&hot_regs);
981 regs = &hot_regs; 963 regs = &hot_regs;
982 } 964 }
983 __perf_sw_event(event_id, nr, nmi, regs, addr); 965 __perf_sw_event(event_id, nr, nmi, regs, addr);