4 #include "threads-model.h"
6 /* forward declaration */
9 typedef ModelList<const ModelAction *> action_mlist_t;
10 typedef SnapList<uint32_t> func_id_list_t;
14 HistoryNode(ModelAction *act);
17 ModelAction * get_action() const { return action; }
18 const char * get_position() const { return position; }
20 ModelAction * const action;
21 const char * position;
29 void enter_function(const uint32_t func_id, thread_id_t tid);
30 void exit_function(const uint32_t func_id, thread_id_t tid);
32 uint32_t get_func_counter() { return func_counter; }
33 void incr_func_counter() { func_counter++; }
35 void add_func_atomic(ModelAction *act, thread_id_t tid);
37 HashTable<const char *, uint32_t, uintptr_t, 4> * getFuncMap() { return &func_map; }
38 ModelVector< action_mlist_t * > * getFuncAtomics() { return &func_atomics; }
42 uint32_t func_counter;
44 /* map function names to integer ids */
45 HashTable<const char *, uint32_t, uintptr_t, 4> func_map;
47 ModelVector< action_mlist_t * > func_atomics;
49 /* Work_list stores a list of function ids for each thread.
50 * Each element in work_list is intended to be used as a stack storing
51 * the functions that thread i has entered and yet to exit from
53 SnapVector< func_id_list_t * > work_list;