diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hw_breakpoint.h | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index c9f7f7c7b0e0..5da472e434b7 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
@@ -20,6 +20,14 @@ enum { | |||
20 | 20 | ||
21 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 21 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
22 | 22 | ||
23 | /* As it's for in-kernel or ptrace use, we want it to be pinned */ | ||
24 | #define DEFINE_BREAKPOINT_ATTR(name) \ | ||
25 | struct perf_event_attr name = { \ | ||
26 | .type = PERF_TYPE_BREAKPOINT, \ | ||
27 | .size = sizeof(name), \ | ||
28 | .pinned = 1, \ | ||
29 | }; | ||
30 | |||
23 | static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) | 31 | static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) |
24 | { | 32 | { |
25 | return bp->attr.bp_addr; | 33 | return bp->attr.bp_addr; |
@@ -36,22 +44,16 @@ static inline int hw_breakpoint_len(struct perf_event *bp) | |||
36 | } | 44 | } |
37 | 45 | ||
38 | extern struct perf_event * | 46 | extern struct perf_event * |
39 | register_user_hw_breakpoint(unsigned long addr, | 47 | register_user_hw_breakpoint(struct perf_event_attr *attr, |
40 | int len, | ||
41 | int type, | ||
42 | perf_callback_t triggered, | 48 | perf_callback_t triggered, |
43 | struct task_struct *tsk, | 49 | struct task_struct *tsk); |
44 | bool active); | ||
45 | 50 | ||
46 | /* FIXME: only change from the attr, and don't unregister */ | 51 | /* FIXME: only change from the attr, and don't unregister */ |
47 | extern struct perf_event * | 52 | extern struct perf_event * |
48 | modify_user_hw_breakpoint(struct perf_event *bp, | 53 | modify_user_hw_breakpoint(struct perf_event *bp, |
49 | unsigned long addr, | 54 | struct perf_event_attr *attr, |
50 | int len, | ||
51 | int type, | ||
52 | perf_callback_t triggered, | 55 | perf_callback_t triggered, |
53 | struct task_struct *tsk, | 56 | struct task_struct *tsk); |
54 | bool active); | ||
55 | 57 | ||
56 | /* | 58 | /* |
57 | * Kernel breakpoints are not associated with any particular thread. | 59 | * Kernel breakpoints are not associated with any particular thread. |
@@ -89,20 +91,14 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp) | |||
89 | #else /* !CONFIG_HAVE_HW_BREAKPOINT */ | 91 | #else /* !CONFIG_HAVE_HW_BREAKPOINT */ |
90 | 92 | ||
91 | static inline struct perf_event * | 93 | static inline struct perf_event * |
92 | register_user_hw_breakpoint(unsigned long addr, | 94 | register_user_hw_breakpoint(struct perf_event_attr *attr, |
93 | int len, | ||
94 | int type, | ||
95 | perf_callback_t triggered, | 95 | perf_callback_t triggered, |
96 | struct task_struct *tsk, | 96 | struct task_struct *tsk) { return NULL; } |
97 | bool active) { return NULL; } | ||
98 | static inline struct perf_event * | 97 | static inline struct perf_event * |
99 | modify_user_hw_breakpoint(struct perf_event *bp, | 98 | modify_user_hw_breakpoint(struct perf_event *bp, |
100 | unsigned long addr, | 99 | struct perf_event_attr *attr, |
101 | int len, | ||
102 | int type, | ||
103 | perf_callback_t triggered, | 100 | perf_callback_t triggered, |
104 | struct task_struct *tsk, | 101 | struct task_struct *tsk) { return NULL; } |
105 | bool active) { return NULL; } | ||
106 | static inline struct perf_event * | 102 | static inline struct perf_event * |
107 | register_wide_hw_breakpoint_cpu(unsigned long addr, | 103 | register_wide_hw_breakpoint_cpu(unsigned long addr, |
108 | int len, | 104 | int len, |