diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2008-12-11 07:45:23 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-12 02:08:10 -0500 |
commit | b0884e25fe361f2ca228808fb5fd1b74cb04e711 (patch) | |
tree | 3501b08e29545f89733d592b8f7252253b399be6 | |
parent | f3134de60624829a57741c1f3796847d4de165f6 (diff) |
x86, bts: turn BUG_ON into WARN_ON_ONCE
Impact: make the ds code more debuggable
Turn BUG_ON's into WARN_ON_ONCE.
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/ds.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/ptrace.c | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c index 19a8c2c0389f..095306988667 100644 --- a/arch/x86/kernel/ds.c +++ b/arch/x86/kernel/ds.c | |||
@@ -452,7 +452,7 @@ struct pebs_tracer *ds_request_pebs(struct task_struct *task, | |||
452 | 452 | ||
453 | static void ds_release(struct ds_tracer *tracer, enum ds_qualifier qual) | 453 | static void ds_release(struct ds_tracer *tracer, enum ds_qualifier qual) |
454 | { | 454 | { |
455 | BUG_ON(tracer->context->owner[qual] != tracer); | 455 | WARN_ON_ONCE(tracer->context->owner[qual] != tracer); |
456 | tracer->context->owner[qual] = NULL; | 456 | tracer->context->owner[qual] = NULL; |
457 | 457 | ||
458 | put_tracer(tracer->context->task); | 458 | put_tracer(tracer->context->task); |
@@ -774,7 +774,7 @@ ds_configure(const struct ds_configuration *cfg) | |||
774 | 774 | ||
775 | printk(KERN_INFO "DS available\n"); | 775 | printk(KERN_INFO "DS available\n"); |
776 | 776 | ||
777 | BUG_ON(MAX_SIZEOF_DS < ds_cfg.sizeof_ds); | 777 | WARN_ON_ONCE(MAX_SIZEOF_DS < ds_cfg.sizeof_ds); |
778 | } | 778 | } |
779 | 779 | ||
780 | void __cpuinit ds_init_intel(struct cpuinfo_x86 *c) | 780 | void __cpuinit ds_init_intel(struct cpuinfo_x86 *c) |
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 2c8ec1ba75e6..b2998fe1166b 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -878,7 +878,8 @@ static int ptrace_bts_write_record(struct task_struct *child, | |||
878 | { | 878 | { |
879 | unsigned char bts_record[BTS_MAX_RECORD_SIZE]; | 879 | unsigned char bts_record[BTS_MAX_RECORD_SIZE]; |
880 | 880 | ||
881 | BUG_ON(BTS_MAX_RECORD_SIZE < bts_cfg.sizeof_bts); | 881 | if (BTS_MAX_RECORD_SIZE < bts_cfg.sizeof_bts) |
882 | return -EOVERFLOW; | ||
882 | 883 | ||
883 | memset(bts_record, 0, bts_cfg.sizeof_bts); | 884 | memset(bts_record, 0, bts_cfg.sizeof_bts); |
884 | switch (in->qualifier) { | 885 | switch (in->qualifier) { |
@@ -1133,7 +1134,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
1133 | 1134 | ||
1134 | ret = ds_get_bts_index(child->bts, &size); | 1135 | ret = ds_get_bts_index(child->bts, &size); |
1135 | if (ret == 0) { | 1136 | if (ret == 0) { |
1136 | BUG_ON(size != (int) size); | 1137 | WARN_ON_ONCE(size != (int) size); |
1137 | ret = (int) size; | 1138 | ret = (int) size; |
1138 | } | 1139 | } |
1139 | break; | 1140 | break; |