5 ModelHistory::ModelHistory() :
6 func_id(1), /* function id starts with 1 */
12 void ModelHistory::enter_function(const uint32_t func_id, thread_id_t tid)
14 if ( !work_list.contains(tid) ) {
15 // This thread has not been pushed to work_list
16 SnapList<uint32_t> * func_list = new SnapList<uint32_t>();
17 func_list->push_back(func_id);
18 work_list.put(tid, func_list);
20 SnapList<uint32_t> * func_list = work_list.get(tid);
21 func_list->push_back(func_id);
25 void ModelHistory::exit_function(const uint32_t func_id, thread_id_t tid)
27 SnapList<uint32_t> * func_list = work_list.get(tid);
28 uint32_t last_func_id = func_list->back();
30 if (last_func_id == func_id) {
31 func_list->pop_back();
33 model_print("trying to exit with a wrong function id\n");
34 model_print("--- last_func: %d, func_id: %d\n", last_func_id, func_id);