Skip to content

Commit

Permalink
hw-breakpoints: Check the breakpoint params from perf tools
Browse files Browse the repository at this point in the history
Perf tools create perf events as disabled in the beginning.
Breakpoints are then considered like ptrace temporary
breakpoints, only meant to reserve a breakpoint slot until we
get all the necessary informations from the user.

In this case, we don't check the address that is breakpointed as
it is NULL in the ptrace case.

But perf tools don't have the same purpose, events are created
disabled to wait for all events to be created before enabling
all of them. We want to check the breakpoint parameters in this
case.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <1258987355-8751-2-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Nov 23, 2009
1 parent e6db487 commit fdf6bc9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion kernel/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,16 @@ int __register_perf_hw_breakpoint(struct perf_event *bp)
if (ret)
return ret;

if (!bp->attr.disabled)
/*
* Ptrace breakpoints can be temporary perf events only
* meant to reserve a slot. In this case, it is created disabled and
* we don't want to check the params right now (as we put a null addr)
* But perf tools create events as disabled and we want to check
* the params for them.
* This is a quick hack that will be removed soon, once we remove
* the tmp breakpoints from ptrace
*/
if (!bp->attr.disabled || bp->callback == perf_bp_event)
ret = arch_validate_hwbkpt_settings(bp, bp->ctx->task);

return ret;
Expand Down

0 comments on commit fdf6bc9

Please sign in to comment.