8 #include "threads-model.h"
15 void enter_function(const uint32_t func_id, thread_id_t tid);
16 void exit_function(const uint32_t func_id, thread_id_t tid);
18 uint32_t get_func_counter() { return func_counter; }
19 void incr_func_counter() { func_counter++; }
21 void resize_func_nodes(uint32_t max_func_id);
22 void process_action(ModelAction *act, thread_id_t tid);
24 HashTable<const char *, uint32_t, uintptr_t, 4, model_malloc, model_calloc, model_free> * getFuncMap() { return &func_map; }
25 ModelVector<const char *> * getFuncMapRev() { return &func_map_rev; }
27 ModelVector<FuncNode *> * getFuncNodes() { return &func_nodes; }
28 FuncNode * get_func_node(uint32_t func_id);
30 void update_write_history(void * location, uint64_t write_val);
31 HashTable<void *, value_set_t *, uintptr_t, 4> * getWriteHistory() { return &write_history; }
32 void update_loc_func_nodes_map(void * location, FuncNode * node);
33 void update_loc_wr_func_nodes_map(void * location, FuncNode * node);
35 void set_new_exec_flag();
36 void dump_func_node_graph();
37 void print_func_node();
41 uint32_t func_counter;
43 /* Map function names to integer ids */
44 HashTable<const char *, uint32_t, uintptr_t, 4, model_malloc, model_calloc, model_free> func_map;
46 /* Map integer ids to function names */
47 ModelVector<const char *> func_map_rev;
49 ModelVector<FuncNode *> func_nodes;
51 /* Map a location to a set of values that have been written to it */
52 HashTable<void *, value_set_t *, uintptr_t, 4> write_history;
54 /* Map a location to FuncNodes that may read from it */
55 HashTable<void *, SnapList<FuncNode *> *, uintptr_t, 4> loc_func_nodes_map;
57 /* Map a location to FuncNodes that may write to it */
58 HashTable<void *, SnapList<FuncNode *> *, uintptr_t, 4> loc_wr_func_nodes_map;
60 /* Keeps track of the last function entered by each thread */
61 SnapVector<uint32_t> thrd_last_entered_func;
64 #endif /* __HISTORY_H__ */