name variables
authorweiyu <weiyuluo1232@gmail.com>
Thu, 18 Jul 2019 18:57:17 +0000 (11:57 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Thu, 18 Jul 2019 18:57:17 +0000 (11:57 -0700)
execution.cc
history.cc
history.h

index e0d49808f2bd14844a5cd9d72f916b1af55c13c7..1bc648d464e52ae860c81103d7ed76f464209113 100644 (file)
@@ -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);
index 23e0d85ac5f685c2e79ae0a8385e364a337d8597..fc71b9f2136d5815e2a2fdedfeec721ba31143bf 100644 (file)
@@ -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;
 
index b6707f9fe6d2cd9f2343ae820080fe53f63eda79..0289a6d680b3c6a5dbb076ba4b48425d8b840935 100644 (file)
--- 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<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();
@@ -33,5 +33,5 @@ private:
        /* map integer ids to function names */ 
        ModelVector<const char *> func_map_rev;
 
-       ModelVector<FuncNode *> func_atomics;
+       ModelVector<FuncNode *> func_nodes;
 };