Commit 2f0993e0fb663c49e4d1e02654f6203246be4817

Authored by Frederic Weisbecker
1 parent 9cef30815b

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>

Showing 3 changed files with 7 additions and 13 deletions Side-by-side Diff

arch/x86/kernel/ptrace.c
... ... @@ -618,7 +618,7 @@
618 618 attr.bp_type = gen_type;
619 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 @@
740 740  
741 741 attr = bp->attr;
742 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 746 * CHECKME: the previous code returned -EIO if the addr wasn't a
include/linux/hw_breakpoint.h
... ... @@ -57,10 +57,7 @@
57 57  
58 58 /* FIXME: only change from the attr, and don't unregister */
59 59 extern struct perf_event *
60   -modify_user_hw_breakpoint(struct perf_event *bp,
61   - struct perf_event_attr *attr,
62   - perf_callback_t triggered,
63   - struct task_struct *tsk);
  60 +modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr);
64 61  
65 62 /*
66 63 * Kernel breakpoints are not associated with any particular thread.
... ... @@ -97,9 +94,7 @@
97 94 struct task_struct *tsk) { return NULL; }
98 95 static inline struct perf_event *
99 96 modify_user_hw_breakpoint(struct perf_event *bp,
100   - struct perf_event_attr *attr,
101   - perf_callback_t triggered,
102   - struct task_struct *tsk) { return NULL; }
  97 + struct perf_event_attr *attr) { return NULL; }
103 98 static inline struct perf_event *
104 99 register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
105 100 perf_callback_t triggered,
kernel/hw_breakpoint.c
... ... @@ -312,9 +312,7 @@
312 312 * @tsk: pointer to 'task_struct' of the process to which the address belongs
313 313 */
314 314 struct perf_event *
315   -modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr,
316   - perf_callback_t triggered,
317   - struct task_struct *tsk)
  315 +modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr)
318 316 {
319 317 /*
320 318 * FIXME: do it without unregistering
... ... @@ -323,7 +321,8 @@
323 321 */
324 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 327 EXPORT_SYMBOL_GPL(modify_user_hw_breakpoint);
329 328