diff options
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 2bccb7b9da2..6e96cc8225d 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -860,13 +860,6 @@ extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; | |||
860 | 860 | ||
861 | extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); | 861 | extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); |
862 | 862 | ||
863 | static inline void | ||
864 | perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | ||
865 | { | ||
866 | if (atomic_read(&perf_swevent_enabled[event_id])) | ||
867 | __perf_sw_event(event_id, nr, nmi, regs, addr); | ||
868 | } | ||
869 | |||
870 | extern void | 863 | extern void |
871 | perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip); | 864 | perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip); |
872 | 865 | ||
@@ -905,6 +898,20 @@ static inline void perf_fetch_caller_regs(struct pt_regs *regs, int skip) | |||
905 | return perf_arch_fetch_caller_regs(regs, ip, skip); | 898 | return perf_arch_fetch_caller_regs(regs, ip, skip); |
906 | } | 899 | } |
907 | 900 | ||
901 | static inline void | ||
902 | perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | ||
903 | { | ||
904 | if (atomic_read(&perf_swevent_enabled[event_id])) { | ||
905 | struct pt_regs hot_regs; | ||
906 | |||
907 | if (!regs) { | ||
908 | perf_fetch_caller_regs(&hot_regs, 1); | ||
909 | regs = &hot_regs; | ||
910 | } | ||
911 | __perf_sw_event(event_id, nr, nmi, regs, addr); | ||
912 | } | ||
913 | } | ||
914 | |||
908 | extern void __perf_event_mmap(struct vm_area_struct *vma); | 915 | extern void __perf_event_mmap(struct vm_area_struct *vma); |
909 | 916 | ||
910 | static inline void perf_event_mmap(struct vm_area_struct *vma) | 917 | static inline void perf_event_mmap(struct vm_area_struct *vma) |