diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-12-05 01:06:10 -0500 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-12-06 02:27:17 -0500 |
commit | 2f0993e0fb663c49e4d1e02654f6203246be4817 (patch) | |
tree | 90d34048d453c25364b8ea41e6c2028a8621bd39 | |
parent | 9cef30815b0f5b76e94a58d7674fcbf824d95579 (diff) |
hw-breakpoints: Drop callback and task parameters from modify helper
Drop the callback and task parameters from modify_user_hw_breakpoint().
For now we have no user that need to modify a breakpoint to the point
of changing its handler or its task context.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: "K. Prasad" <prasad@linux.vnet.ibm.com>
-rw-r--r-- | arch/x86/kernel/ptrace.c | 4 | ||||
-rw-r--r-- | include/linux/hw_breakpoint.h | 9 | ||||
-rw-r--r-- | kernel/hw_breakpoint.c | 7 |
3 files changed, 7 insertions, 13 deletions
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 04d182a7cfdb..dbb395572ae2 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -618,7 +618,7 @@ ptrace_modify_breakpoint(struct perf_event *bp, int len, int type, | |||
618 | attr.bp_type = gen_type; | 618 | attr.bp_type = gen_type; |
619 | attr.disabled = disabled; | 619 | attr.disabled = disabled; |
620 | 620 | ||
621 | return modify_user_hw_breakpoint(bp, &attr, bp->callback, tsk); | 621 | return modify_user_hw_breakpoint(bp, &attr); |
622 | } | 622 | } |
623 | 623 | ||
624 | /* | 624 | /* |
@@ -740,7 +740,7 @@ static int ptrace_set_breakpoint_addr(struct task_struct *tsk, int nr, | |||
740 | 740 | ||
741 | attr = bp->attr; | 741 | attr = bp->attr; |
742 | attr.bp_addr = addr; | 742 | attr.bp_addr = addr; |
743 | bp = modify_user_hw_breakpoint(bp, &attr, bp->callback, tsk); | 743 | bp = modify_user_hw_breakpoint(bp, &attr); |
744 | } | 744 | } |
745 | /* | 745 | /* |
746 | * CHECKME: the previous code returned -EIO if the addr wasn't a | 746 | * CHECKME: the previous code returned -EIO if the addr wasn't a |
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index a03daed08c59..d33096e0dbd4 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
@@ -57,10 +57,7 @@ register_user_hw_breakpoint(struct perf_event_attr *attr, | |||
57 | 57 | ||
58 | /* FIXME: only change from the attr, and don't unregister */ | 58 | /* FIXME: only change from the attr, and don't unregister */ |
59 | extern struct perf_event * | 59 | extern struct perf_event * |
60 | modify_user_hw_breakpoint(struct perf_event *bp, | 60 | modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr); |
61 | struct perf_event_attr *attr, | ||
62 | perf_callback_t triggered, | ||
63 | struct task_struct *tsk); | ||
64 | 61 | ||
65 | /* | 62 | /* |
66 | * Kernel breakpoints are not associated with any particular thread. | 63 | * Kernel breakpoints are not associated with any particular thread. |
@@ -97,9 +94,7 @@ register_user_hw_breakpoint(struct perf_event_attr *attr, | |||
97 | struct task_struct *tsk) { return NULL; } | 94 | struct task_struct *tsk) { return NULL; } |
98 | static inline struct perf_event * | 95 | static inline struct perf_event * |
99 | modify_user_hw_breakpoint(struct perf_event *bp, | 96 | modify_user_hw_breakpoint(struct perf_event *bp, |
100 | struct perf_event_attr *attr, | 97 | struct perf_event_attr *attr) { return NULL; } |
101 | perf_callback_t triggered, | ||
102 | struct task_struct *tsk) { return NULL; } | ||
103 | static inline struct perf_event * | 98 | static inline struct perf_event * |
104 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | 99 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, |
105 | perf_callback_t triggered, | 100 | perf_callback_t triggered, |
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c index cf5ee1628411..2d10b012828f 100644 --- a/kernel/hw_breakpoint.c +++ b/kernel/hw_breakpoint.c | |||
@@ -312,9 +312,7 @@ EXPORT_SYMBOL_GPL(register_user_hw_breakpoint); | |||
312 | * @tsk: pointer to 'task_struct' of the process to which the address belongs | 312 | * @tsk: pointer to 'task_struct' of the process to which the address belongs |
313 | */ | 313 | */ |
314 | struct perf_event * | 314 | struct perf_event * |
315 | modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr, | 315 | modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr) |
316 | perf_callback_t triggered, | ||
317 | struct task_struct *tsk) | ||
318 | { | 316 | { |
319 | /* | 317 | /* |
320 | * FIXME: do it without unregistering | 318 | * FIXME: do it without unregistering |
@@ -323,7 +321,8 @@ modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr, | |||
323 | */ | 321 | */ |
324 | unregister_hw_breakpoint(bp); | 322 | unregister_hw_breakpoint(bp); |
325 | 323 | ||
326 | return perf_event_create_kernel_counter(attr, -1, tsk->pid, triggered); | 324 | return perf_event_create_kernel_counter(attr, -1, bp->ctx->task->pid, |
325 | bp->callback); | ||
327 | } | 326 | } |
328 | EXPORT_SYMBOL_GPL(modify_user_hw_breakpoint); | 327 | EXPORT_SYMBOL_GPL(modify_user_hw_breakpoint); |
329 | 328 | ||