aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hw_breakpoint.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/hw_breakpoint.h')
-rw-r--r--include/linux/hw_breakpoint.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index d33096e0dbd4..4d14a384a01e 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -20,19 +20,16 @@ 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) \
25struct perf_event_attr name = { \
26 .type = PERF_TYPE_BREAKPOINT, \
27 .size = sizeof(name), \
28 .pinned = 1, \
29};
30
31static inline void hw_breakpoint_init(struct perf_event_attr *attr) 23static inline void hw_breakpoint_init(struct perf_event_attr *attr)
32{ 24{
33 attr->type = PERF_TYPE_BREAKPOINT; 25 attr->type = PERF_TYPE_BREAKPOINT;
34 attr->size = sizeof(*attr); 26 attr->size = sizeof(*attr);
27 /*
28 * As it's for in-kernel or ptrace use, we want it to be pinned
29 * and to call its callback every hits.
30 */
35 attr->pinned = 1; 31 attr->pinned = 1;
32 attr->sample_period = 1;
36} 33}
37 34
38static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) 35static inline unsigned long hw_breakpoint_addr(struct perf_event *bp)
@@ -52,7 +49,7 @@ static inline int hw_breakpoint_len(struct perf_event *bp)
52 49
53extern struct perf_event * 50extern struct perf_event *
54register_user_hw_breakpoint(struct perf_event_attr *attr, 51register_user_hw_breakpoint(struct perf_event_attr *attr,
55 perf_callback_t triggered, 52 perf_overflow_handler_t triggered,
56 struct task_struct *tsk); 53 struct task_struct *tsk);
57 54
58/* FIXME: only change from the attr, and don't unregister */ 55/* FIXME: only change from the attr, and don't unregister */
@@ -64,12 +61,12 @@ modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr);
64 */ 61 */
65extern struct perf_event * 62extern struct perf_event *
66register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, 63register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
67 perf_callback_t triggered, 64 perf_overflow_handler_t triggered,
68 int cpu); 65 int cpu);
69 66
70extern struct perf_event ** 67extern struct perf_event **
71register_wide_hw_breakpoint(struct perf_event_attr *attr, 68register_wide_hw_breakpoint(struct perf_event_attr *attr,
72 perf_callback_t triggered); 69 perf_overflow_handler_t triggered);
73 70
74extern int register_perf_hw_breakpoint(struct perf_event *bp); 71extern int register_perf_hw_breakpoint(struct perf_event *bp);
75extern int __register_perf_hw_breakpoint(struct perf_event *bp); 72extern int __register_perf_hw_breakpoint(struct perf_event *bp);
@@ -90,18 +87,18 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
90 87
91static inline struct perf_event * 88static inline struct perf_event *
92register_user_hw_breakpoint(struct perf_event_attr *attr, 89register_user_hw_breakpoint(struct perf_event_attr *attr,
93 perf_callback_t triggered, 90 perf_overflow_handler_t triggered,
94 struct task_struct *tsk) { return NULL; } 91 struct task_struct *tsk) { return NULL; }
95static inline struct perf_event * 92static inline struct perf_event *
96modify_user_hw_breakpoint(struct perf_event *bp, 93modify_user_hw_breakpoint(struct perf_event *bp,
97 struct perf_event_attr *attr) { return NULL; } 94 struct perf_event_attr *attr) { return NULL; }
98static inline struct perf_event * 95static inline struct perf_event *
99register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, 96register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
100 perf_callback_t triggered, 97 perf_overflow_handler_t triggered,
101 int cpu) { return NULL; } 98 int cpu) { return NULL; }
102static inline struct perf_event ** 99static inline struct perf_event **
103register_wide_hw_breakpoint(struct perf_event_attr *attr, 100register_wide_hw_breakpoint(struct perf_event_attr *attr,
104 perf_callback_t triggered) { return NULL; } 101 perf_overflow_handler_t triggered) { return NULL; }
105static inline int 102static inline int
106register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } 103register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }
107static inline int 104static inline int