From 8e495e50d0a239f43fd000164e21da7964e51e54 Mon Sep 17 00:00:00 2001 From: weiyu Date: Thu, 18 Jul 2019 11:57:17 -0700 Subject: [PATCH] name variables --- execution.cc | 4 ++-- history.cc | 16 ++++++++-------- history.h | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/execution.cc b/execution.cc index e0d49808..1bc648d4 100644 --- a/execution.cc +++ b/execution.cc @@ -1569,8 +1569,8 @@ Thread * ModelExecution::take_step(ModelAction *curr) 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); diff --git a/history.cc b/history.cc index 23e0d85a..fc71b9f2 100644 --- a/history.cc +++ b/history.cc @@ -13,7 +13,7 @@ ModelHistory::ModelHistory() : 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) @@ -73,7 +73,7 @@ void ModelHistory::exit_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 */ @@ -93,17 +93,17 @@ void ModelHistory::add_func_atomic(ModelAction *act, thread_id_t tid) 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*/ @@ -150,8 +150,8 @@ void ModelHistory::link_insts(func_inst_list_t * 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; diff --git a/history.h b/history.h index b6707f9f..0289a6d6 100644 --- a/history.h +++ b/history.h @@ -14,12 +14,12 @@ public: 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 * getFuncMap() { return &func_map; } ModelVector * getFuncMapRev() { return &func_map_rev; } - ModelVector * getFuncAtomics() { return &func_atomics; } + ModelVector * getFuncNodes() { return &func_nodes; } void link_insts(func_inst_list_t * inst_list); void print(); @@ -33,5 +33,5 @@ private: /* map integer ids to function names */ ModelVector func_map_rev; - ModelVector func_atomics; + ModelVector func_nodes; }; -- 2.34.1