static double_trans_t * new_trans(trans_splitter_t *ts) { double_trans_t *ret; if (ts->pool[ts->pool_current].used) { int id; for (id = 0; id < TABLE_SPLITTER_SIZE; id++) { if (&ts->pool[ts->pool_current] == ts->table[id]) break; } #ifdef TRANS_POOL_DEBUG SIM_log_error(&ts->log, 0, "transaction pool overflowed, caused by mem_op with ID: %d arrived: %lld", id, ts->pool[ts->pool_current].arrived); #else SIM_log_error(&ts->log, 0, "transaction pool overflowed, caused by mem_op with ID: %d.", id); #endif SIM_break_simulation(""); } ret = &ts->pool[ts->pool_current]; ret->used = 1; ts->pool_current = (ts->pool_current + 1) & (TRANS_POOL_TOTAL - 1); #ifdef TRANS_POOL_DEBUG ret->arrived = SIM_cycle_count((conf_object_t *)ts); #endif return ret; }
void found_a_bug(struct ls_state *ls) { if (DECISION_INFO_ONLY == 0) { lsprintf(BUG, COLOUR_BOLD COLOUR_RED "**** A bug was found! ****\n"); lsprintf(BUG, COLOUR_BOLD COLOUR_RED "**** Decision trace follows. ****\n"); } else { lsprintf(ALWAYS, COLOUR_BOLD COLOUR_GREEN "(No bug was found.)\n"); } print_tree_from(ls->save.current, ls->save.next_tid); char *stack = stack_trace(ls->cpu0, ls->eip, ls->sched.cur_agent->tid); lsprintf(BUG, "Stack: %s\n", stack); MM_FREE(stack); PRINT_TREE_INFO(BUG, ls); if (BREAK_ON_BUG) { lsprintf(ALWAYS, COLOUR_BOLD COLOUR_YELLOW "Now giving you the debug prompt. Good luck!\n"); SIM_break_simulation(NULL); } else { SIM_quit(LS_BUG_FOUND); } }