aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/hw_breakpoint.h8
-rw-r--r--kernel/hw_breakpoint.c10
-rw-r--r--samples/hw_breakpoint/data_breakpoint.c6
3 files changed, 12 insertions, 12 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
69extern struct perf_event ** 69extern struct perf_event * __percpu *
70register_wide_hw_breakpoint(struct perf_event_attr *attr, 70register_wide_hw_breakpoint(struct perf_event_attr *attr,
71 perf_overflow_handler_t triggered); 71 perf_overflow_handler_t triggered);
72 72
73extern int register_perf_hw_breakpoint(struct perf_event *bp); 73extern int register_perf_hw_breakpoint(struct perf_event *bp);
74extern int __register_perf_hw_breakpoint(struct perf_event *bp); 74extern int __register_perf_hw_breakpoint(struct perf_event *bp);
75extern void unregister_hw_breakpoint(struct perf_event *bp); 75extern void unregister_hw_breakpoint(struct perf_event *bp);
76extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); 76extern void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events);
77 77
78extern int dbg_reserve_bp_slot(struct perf_event *bp); 78extern int dbg_reserve_bp_slot(struct perf_event *bp);
79extern int dbg_release_bp_slot(struct perf_event *bp); 79extern int dbg_release_bp_slot(struct perf_event *bp);
@@ -100,7 +100,7 @@ static inline struct perf_event *
100register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, 100register_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; }
103static inline struct perf_event ** 103static inline struct perf_event * __percpu *
104register_wide_hw_breakpoint(struct perf_event_attr *attr, 104register_wide_hw_breakpoint(struct perf_event_attr *attr,
105 perf_overflow_handler_t triggered) { return NULL; } 105 perf_overflow_handler_t triggered) { return NULL; }
106static inline int 106static 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; }
110static inline void unregister_hw_breakpoint(struct perf_event *bp) { } 110static inline void unregister_hw_breakpoint(struct perf_event *bp) { }
111static inline void 111static inline void
112unregister_wide_hw_breakpoint(struct perf_event **cpu_events) { } 112unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events) { }
113static inline int 113static inline int
114reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; } 114reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; }
115static inline void release_bp_slot(struct perf_event *bp) { } 115static inline void release_bp_slot(struct perf_event *bp) { }
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c
index 967e66143e11..6542eacb3fa5 100644
--- a/kernel/hw_breakpoint.c
+++ b/kernel/hw_breakpoint.c
@@ -413,17 +413,17 @@ EXPORT_SYMBOL_GPL(unregister_hw_breakpoint);
413 * 413 *
414 * @return a set of per_cpu pointers to perf events 414 * @return a set of per_cpu pointers to perf events
415 */ 415 */
416struct perf_event ** 416struct perf_event * __percpu *
417register_wide_hw_breakpoint(struct perf_event_attr *attr, 417register_wide_hw_breakpoint(struct perf_event_attr *attr,
418 perf_overflow_handler_t triggered) 418 perf_overflow_handler_t triggered)
419{ 419{
420 struct perf_event **cpu_events, **pevent, *bp; 420 struct perf_event * __percpu *cpu_events, **pevent, *bp;
421 long err; 421 long err;
422 int cpu; 422 int cpu;
423 423
424 cpu_events = alloc_percpu(typeof(*cpu_events)); 424 cpu_events = alloc_percpu(typeof(*cpu_events));
425 if (!cpu_events) 425 if (!cpu_events)
426 return ERR_PTR(-ENOMEM); 426 return (void __percpu __force *)ERR_PTR(-ENOMEM);
427 427
428 get_online_cpus(); 428 get_online_cpus();
429 for_each_online_cpu(cpu) { 429 for_each_online_cpu(cpu) {
@@ -451,7 +451,7 @@ fail:
451 put_online_cpus(); 451 put_online_cpus();
452 452
453 free_percpu(cpu_events); 453 free_percpu(cpu_events);
454 return ERR_PTR(err); 454 return (void __percpu __force *)ERR_PTR(err);
455} 455}
456EXPORT_SYMBOL_GPL(register_wide_hw_breakpoint); 456EXPORT_SYMBOL_GPL(register_wide_hw_breakpoint);
457 457
@@ -459,7 +459,7 @@ EXPORT_SYMBOL_GPL(register_wide_hw_breakpoint);
459 * unregister_wide_hw_breakpoint - unregister a wide breakpoint in the kernel 459 * unregister_wide_hw_breakpoint - unregister a wide breakpoint in the kernel
460 * @cpu_events: the per cpu set of events to unregister 460 * @cpu_events: the per cpu set of events to unregister
461 */ 461 */
462void unregister_wide_hw_breakpoint(struct perf_event **cpu_events) 462void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events)
463{ 463{
464 int cpu; 464 int cpu;
465 struct perf_event **pevent; 465 struct perf_event **pevent;
diff --git a/samples/hw_breakpoint/data_breakpoint.c b/samples/hw_breakpoint/data_breakpoint.c
index c69cbe9b2426..bd0f337afcab 100644
--- a/samples/hw_breakpoint/data_breakpoint.c
+++ b/samples/hw_breakpoint/data_breakpoint.c
@@ -34,7 +34,7 @@
34#include <linux/perf_event.h> 34#include <linux/perf_event.h>
35#include <linux/hw_breakpoint.h> 35#include <linux/hw_breakpoint.h>
36 36
37struct perf_event **sample_hbp; 37struct perf_event * __percpu *sample_hbp;
38 38
39static char ksym_name[KSYM_NAME_LEN] = "pid_max"; 39static char ksym_name[KSYM_NAME_LEN] = "pid_max";
40module_param_string(ksym, ksym_name, KSYM_NAME_LEN, S_IRUGO); 40module_param_string(ksym, ksym_name, KSYM_NAME_LEN, S_IRUGO);
@@ -61,8 +61,8 @@ static int __init hw_break_module_init(void)
61 attr.bp_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R; 61 attr.bp_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R;
62 62
63 sample_hbp = register_wide_hw_breakpoint(&attr, sample_hbp_handler); 63 sample_hbp = register_wide_hw_breakpoint(&attr, sample_hbp_handler);
64 if (IS_ERR(sample_hbp)) { 64 if (IS_ERR((void __force *)sample_hbp)) {
65 ret = PTR_ERR(sample_hbp); 65 ret = PTR_ERR((void __force *)sample_hbp);
66 goto fail; 66 goto fail;
67 } 67 }
68 68