diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hw_breakpoint.h | 8 | ||||
-rw-r--r-- | include/linux/perf_event.h | 27 |
2 files changed, 28 insertions, 7 deletions
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index 5977b724f7c6..c70d27af03f9 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
@@ -66,14 +66,14 @@ register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | |||
66 | perf_overflow_handler_t triggered, | 66 | perf_overflow_handler_t triggered, |
67 | int cpu); | 67 | int cpu); |
68 | 68 | ||
69 | extern struct perf_event ** | 69 | extern struct perf_event * __percpu * |
70 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | 70 | register_wide_hw_breakpoint(struct perf_event_attr *attr, |
71 | perf_overflow_handler_t triggered); | 71 | perf_overflow_handler_t triggered); |
72 | 72 | ||
73 | extern int register_perf_hw_breakpoint(struct perf_event *bp); | 73 | extern int register_perf_hw_breakpoint(struct perf_event *bp); |
74 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); | 74 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); |
75 | extern void unregister_hw_breakpoint(struct perf_event *bp); | 75 | extern void unregister_hw_breakpoint(struct perf_event *bp); |
76 | extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); | 76 | extern void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events); |
77 | 77 | ||
78 | extern int dbg_reserve_bp_slot(struct perf_event *bp); | 78 | extern int dbg_reserve_bp_slot(struct perf_event *bp); |
79 | extern int dbg_release_bp_slot(struct perf_event *bp); | 79 | extern int dbg_release_bp_slot(struct perf_event *bp); |
@@ -100,7 +100,7 @@ static inline struct perf_event * | |||
100 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | 100 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, |
101 | perf_overflow_handler_t triggered, | 101 | perf_overflow_handler_t triggered, |
102 | int cpu) { return NULL; } | 102 | int cpu) { return NULL; } |
103 | static inline struct perf_event ** | 103 | static inline struct perf_event * __percpu * |
104 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | 104 | register_wide_hw_breakpoint(struct perf_event_attr *attr, |
105 | perf_overflow_handler_t triggered) { return NULL; } | 105 | perf_overflow_handler_t triggered) { return NULL; } |
106 | static inline int | 106 | static inline int |
@@ -109,7 +109,7 @@ static inline int | |||
109 | __register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } | 109 | __register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } |
110 | static inline void unregister_hw_breakpoint(struct perf_event *bp) { } | 110 | static inline void unregister_hw_breakpoint(struct perf_event *bp) { } |
111 | static inline void | 111 | static inline void |
112 | unregister_wide_hw_breakpoint(struct perf_event **cpu_events) { } | 112 | unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events) { } |
113 | static inline int | 113 | static inline int |
114 | reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; } | 114 | reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; } |
115 | static inline void release_bp_slot(struct perf_event *bp) { } | 115 | static inline void release_bp_slot(struct perf_event *bp) { } |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 7b18b4fd5df7..6f8cd7da1a01 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -487,9 +487,8 @@ struct hw_perf_event { | |||
487 | struct hrtimer hrtimer; | 487 | struct hrtimer hrtimer; |
488 | }; | 488 | }; |
489 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 489 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
490 | union { /* breakpoint */ | 490 | /* breakpoint */ |
491 | struct arch_hw_breakpoint info; | 491 | struct arch_hw_breakpoint info; |
492 | }; | ||
493 | #endif | 492 | #endif |
494 | }; | 493 | }; |
495 | atomic64_t prev_count; | 494 | atomic64_t prev_count; |
@@ -802,6 +801,13 @@ struct perf_sample_data { | |||
802 | struct perf_raw_record *raw; | 801 | struct perf_raw_record *raw; |
803 | }; | 802 | }; |
804 | 803 | ||
804 | static inline | ||
805 | void perf_sample_data_init(struct perf_sample_data *data, u64 addr) | ||
806 | { | ||
807 | data->addr = addr; | ||
808 | data->raw = NULL; | ||
809 | } | ||
810 | |||
805 | extern void perf_output_sample(struct perf_output_handle *handle, | 811 | extern void perf_output_sample(struct perf_output_handle *handle, |
806 | struct perf_event_header *header, | 812 | struct perf_event_header *header, |
807 | struct perf_sample_data *data, | 813 | struct perf_sample_data *data, |
@@ -858,6 +864,21 @@ extern int sysctl_perf_event_paranoid; | |||
858 | extern int sysctl_perf_event_mlock; | 864 | extern int sysctl_perf_event_mlock; |
859 | extern int sysctl_perf_event_sample_rate; | 865 | extern int sysctl_perf_event_sample_rate; |
860 | 866 | ||
867 | static inline bool perf_paranoid_tracepoint_raw(void) | ||
868 | { | ||
869 | return sysctl_perf_event_paranoid > -1; | ||
870 | } | ||
871 | |||
872 | static inline bool perf_paranoid_cpu(void) | ||
873 | { | ||
874 | return sysctl_perf_event_paranoid > 0; | ||
875 | } | ||
876 | |||
877 | static inline bool perf_paranoid_kernel(void) | ||
878 | { | ||
879 | return sysctl_perf_event_paranoid > 1; | ||
880 | } | ||
881 | |||
861 | extern void perf_event_init(void); | 882 | extern void perf_event_init(void); |
862 | extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, int entry_size); | 883 | extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, int entry_size); |
863 | extern void perf_bp_event(struct perf_event *event, void *data); | 884 | extern void perf_bp_event(struct perf_event *event, void *data); |