aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hw_breakpoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/hw_breakpoint.c')
-rw-r--r--kernel/hw_breakpoint.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c
index 2d10b012828f..b600fc27f161 100644
--- a/kernel/hw_breakpoint.c
+++ b/kernel/hw_breakpoint.c
@@ -259,7 +259,7 @@ void release_bp_slot(struct perf_event *bp)
259} 259}
260 260
261 261
262int __register_perf_hw_breakpoint(struct perf_event *bp) 262int register_perf_hw_breakpoint(struct perf_event *bp)
263{ 263{
264 int ret; 264 int ret;
265 265
@@ -276,19 +276,12 @@ int __register_perf_hw_breakpoint(struct perf_event *bp)
276 * This is a quick hack that will be removed soon, once we remove 276 * This is a quick hack that will be removed soon, once we remove
277 * the tmp breakpoints from ptrace 277 * the tmp breakpoints from ptrace
278 */ 278 */
279 if (!bp->attr.disabled || bp->callback == perf_bp_event) 279 if (!bp->attr.disabled || !bp->overflow_handler)
280 ret = arch_validate_hwbkpt_settings(bp, bp->ctx->task); 280 ret = arch_validate_hwbkpt_settings(bp, bp->ctx->task);
281 281
282 return ret; 282 return ret;
283} 283}
284 284
285int register_perf_hw_breakpoint(struct perf_event *bp)
286{
287 bp->callback = perf_bp_event;
288
289 return __register_perf_hw_breakpoint(bp);
290}
291
292/** 285/**
293 * register_user_hw_breakpoint - register a hardware breakpoint for user space 286 * register_user_hw_breakpoint - register a hardware breakpoint for user space
294 * @attr: breakpoint attributes 287 * @attr: breakpoint attributes
@@ -297,7 +290,7 @@ int register_perf_hw_breakpoint(struct perf_event *bp)
297 */ 290 */
298struct perf_event * 291struct perf_event *
299register_user_hw_breakpoint(struct perf_event_attr *attr, 292register_user_hw_breakpoint(struct perf_event_attr *attr,
300 perf_callback_t triggered, 293 perf_overflow_handler_t triggered,
301 struct task_struct *tsk) 294 struct task_struct *tsk)
302{ 295{
303 return perf_event_create_kernel_counter(attr, -1, tsk->pid, triggered); 296 return perf_event_create_kernel_counter(attr, -1, tsk->pid, triggered);
@@ -322,7 +315,7 @@ modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr)
322 unregister_hw_breakpoint(bp); 315 unregister_hw_breakpoint(bp);
323 316
324 return perf_event_create_kernel_counter(attr, -1, bp->ctx->task->pid, 317 return perf_event_create_kernel_counter(attr, -1, bp->ctx->task->pid,
325 bp->callback); 318 bp->overflow_handler);
326} 319}
327EXPORT_SYMBOL_GPL(modify_user_hw_breakpoint); 320EXPORT_SYMBOL_GPL(modify_user_hw_breakpoint);
328 321
@@ -347,7 +340,7 @@ EXPORT_SYMBOL_GPL(unregister_hw_breakpoint);
347 */ 340 */
348struct perf_event ** 341struct perf_event **
349register_wide_hw_breakpoint(struct perf_event_attr *attr, 342register_wide_hw_breakpoint(struct perf_event_attr *attr,
350 perf_callback_t triggered) 343 perf_overflow_handler_t triggered)
351{ 344{
352 struct perf_event **cpu_events, **pevent, *bp; 345 struct perf_event **cpu_events, **pevent, *bp;
353 long err; 346 long err;