diff options
Diffstat (limited to 'include/linux/hw_breakpoint.h')
-rw-r--r-- | include/linux/hw_breakpoint.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index c70d27af03f..a2d6ea49ec5 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
@@ -9,9 +9,22 @@ enum { | |||
9 | }; | 9 | }; |
10 | 10 | ||
11 | enum { | 11 | enum { |
12 | HW_BREAKPOINT_R = 1, | 12 | HW_BREAKPOINT_EMPTY = 0, |
13 | HW_BREAKPOINT_W = 2, | 13 | HW_BREAKPOINT_R = 1, |
14 | HW_BREAKPOINT_X = 4, | 14 | HW_BREAKPOINT_W = 2, |
15 | HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W, | ||
16 | HW_BREAKPOINT_X = 4, | ||
17 | HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, | ||
18 | }; | ||
19 | |||
20 | enum bp_type_idx { | ||
21 | TYPE_INST = 0, | ||
22 | #ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS | ||
23 | TYPE_DATA = 0, | ||
24 | #else | ||
25 | TYPE_DATA = 1, | ||
26 | #endif | ||
27 | TYPE_MAX | ||
15 | }; | 28 | }; |
16 | 29 | ||
17 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
@@ -34,6 +47,12 @@ static inline void hw_breakpoint_init(struct perf_event_attr *attr) | |||
34 | attr->sample_period = 1; | 47 | attr->sample_period = 1; |
35 | } | 48 | } |
36 | 49 | ||
50 | static inline void ptrace_breakpoint_init(struct perf_event_attr *attr) | ||
51 | { | ||
52 | hw_breakpoint_init(attr); | ||
53 | attr->exclude_kernel = 1; | ||
54 | } | ||
55 | |||
37 | static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) | 56 | static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) |
38 | { | 57 | { |
39 | return bp->attr.bp_addr; | 58 | return bp->attr.bp_addr; |