curr = check_current_action(curr);
ASSERT(curr);
- // model_print("poitner loc: %p, thread: %d, type: %d, order: %d, position: %s\n", curr, curr->get_tid(), curr->get_type(), curr->get_mo(), curr->get_position() );
- model->get_history()->add_func_atomic( curr, curr_thrd->get_id() );
+ /* Process this action in ModelHistory for records*/
+ model->get_history()->process_action( curr, curr_thrd->get_id() );
if (curr_thrd->is_blocked() || curr_thrd->is_complete())
scheduler->remove_thread(curr_thrd);
func_counter(1), /* function id starts with 1 */
func_map(),
func_map_rev(),
- func_atomics()
+ func_nodes()
{}
void ModelHistory::enter_function(const uint32_t func_id, thread_id_t tid)
//model_print("thread %d exiting func %d\n", tid, func_id);
}
-void ModelHistory::add_func_atomic(ModelAction *act, thread_id_t tid)
+void ModelHistory::process_action(ModelAction *act, thread_id_t tid)
{
/* return if thread i has not entered any function or has exited
from all functions */
uint32_t func_id = func_list->back();
- if ( func_atomics.size() <= func_id )
- func_atomics.resize( func_id + 1 );
+ if ( func_nodes.size() <= func_id )
+ func_nodes.resize( func_id + 1 );
- FuncNode * func_node = func_atomics[func_id];
+ FuncNode * func_node = func_nodes[func_id];
if (func_node == NULL) {
const char * func_name = func_map_rev[func_id];
func_node = new FuncNode();
func_node->set_func_id(func_id);
func_node->set_func_name(func_name);
- func_atomics[func_id] = func_node;
+ func_nodes[func_id] = func_node;
}
/* add corresponding FuncInst to func_node and curr_inst_list*/
void ModelHistory::print()
{
- for (uint32_t i = 0; i < func_atomics.size(); i++ ) {
- FuncNode * funcNode = func_atomics[i];
+ for (uint32_t i = 0; i < func_nodes.size(); i++ ) {
+ FuncNode * funcNode = func_nodes[i];
if (funcNode == NULL)
continue;
uint32_t get_func_counter() { return func_counter; }
void incr_func_counter() { func_counter++; }
- void add_func_atomic(ModelAction *act, thread_id_t tid);
+ void process_action(ModelAction *act, thread_id_t tid);
HashTable<const char *, uint32_t, uintptr_t, 4, model_malloc, model_calloc, model_free> * getFuncMap() { return &func_map; }
ModelVector<const char *> * getFuncMapRev() { return &func_map_rev; }
- ModelVector<FuncNode *> * getFuncAtomics() { return &func_atomics; }
+ ModelVector<FuncNode *> * getFuncNodes() { return &func_nodes; }
void link_insts(func_inst_list_t * inst_list);
void print();
/* map integer ids to function names */
ModelVector<const char *> func_map_rev;
- ModelVector<FuncNode *> func_atomics;
+ ModelVector<FuncNode *> func_nodes;
};