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>
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);
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)
{
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) {
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;