Skip to content

Commit

Permalink
x86, bts: turn BUG_ON into WARN_ON_ONCE
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Metzger authored and Ingo Molnar committed Dec 12, 2008
1 parent f3134de commit b0884e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kernel/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ struct pebs_tracer *ds_request_pebs(struct task_struct *task,

static void ds_release(struct ds_tracer *tracer, enum ds_qualifier qual)
{
BUG_ON(tracer->context->owner[qual] != tracer);
WARN_ON_ONCE(tracer->context->owner[qual] != tracer);
tracer->context->owner[qual] = NULL;

put_tracer(tracer->context->task);
Expand Down Expand Up @@ -774,7 +774,7 @@ ds_configure(const struct ds_configuration *cfg)

printk(KERN_INFO "DS available\n");

BUG_ON(MAX_SIZEOF_DS < ds_cfg.sizeof_ds);
WARN_ON_ONCE(MAX_SIZEOF_DS < ds_cfg.sizeof_ds);
}

void __cpuinit ds_init_intel(struct cpuinfo_x86 *c)
Expand Down
5 changes: 3 additions & 2 deletions arch/x86/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,8 @@ static int ptrace_bts_write_record(struct task_struct *child,
{
unsigned char bts_record[BTS_MAX_RECORD_SIZE];

BUG_ON(BTS_MAX_RECORD_SIZE < bts_cfg.sizeof_bts);
if (BTS_MAX_RECORD_SIZE < bts_cfg.sizeof_bts)
return -EOVERFLOW;

memset(bts_record, 0, bts_cfg.sizeof_bts);
switch (in->qualifier) {
Expand Down Expand Up @@ -1133,7 +1134,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)

ret = ds_get_bts_index(child->bts, &size);
if (ret == 0) {
BUG_ON(size != (int) size);
WARN_ON_ONCE(size != (int) size);
ret = (int) size;
}
break;
Expand Down

0 comments on commit b0884e2

Please sign in to comment.