aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hw_breakpoint.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-11-23 09:42:33 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-23 12:18:30 -0500
commitfdf6bc95229821e3d9405eba28925b76e92b74d0 (patch)
treebe414077495ac0ef3b71abd163dc35d0e96b1318 /kernel/hw_breakpoint.c
parente6db4876575f3fdd5b1df2cbff826df95ab9af6a (diff)
hw-breakpoints: Check the breakpoint params from perf tools
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>
Diffstat (limited to 'kernel/hw_breakpoint.c')
-rw-r--r--kernel/hw_breakpoint.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c
index c16662268d75..06d372fc026d 100644
--- a/kernel/hw_breakpoint.c
+++ b/kernel/hw_breakpoint.c
@@ -267,7 +267,16 @@ int __register_perf_hw_breakpoint(struct perf_event *bp)
267 if (ret) 267 if (ret)
268 return ret; 268 return ret;
269 269
270 if (!bp->attr.disabled) 270 /*
271 * Ptrace breakpoints can be temporary perf events only
272 * meant to reserve a slot. In this case, it is created disabled and
273 * we don't want to check the params right now (as we put a null addr)
274 * But perf tools create events as disabled and we want to check
275 * the params for them.
276 * This is a quick hack that will be removed soon, once we remove
277 * the tmp breakpoints from ptrace
278 */
279 if (!bp->attr.disabled || bp->callback == perf_bp_event)
271 ret = arch_validate_hwbkpt_settings(bp, bp->ctx->task); 280 ret = arch_validate_hwbkpt_settings(bp, bp->ctx->task);
272 281
273 return ret; 282 return ret;