1 #ifndef __NEWFUZZER_H__
2 #define __NEWFUZZER_H__
9 class NewFuzzer : public Fuzzer {
12 int selectWrite(ModelAction *read, SnapVector<ModelAction *>* rf_set);
13 bool has_paused_threads();
14 void notify_paused_thread(Thread * thread);
16 Thread * selectThread(int * threadlist, int numthreads);
17 Thread * selectNotify(action_list_t * waiters);
18 bool shouldSleep(const ModelAction * sleep);
19 bool shouldWake(const ModelAction * sleep);
20 bool shouldWait(const ModelAction * wait);
22 void register_engine(ModelHistory * history, ModelExecution * execution);
26 ModelHistory * history;
27 ModelExecution * execution;
29 SnapVector<ModelAction *> thrd_last_read_act;
30 SnapVector<FuncInst *> thrd_last_func_inst;
32 SnapVector<Predicate *> thrd_selected_child_branch;
33 SnapVector< SnapVector<ModelAction *> *> thrd_pruned_writes;
35 Predicate * get_selected_child_branch(thread_id_t tid);
36 bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector<ModelAction *> * rf_set, inst_act_map_t * inst_act_map);
37 Predicate * selectBranch(thread_id_t tid, Predicate * curr_pred, FuncInst * read_inst);
38 int choose_index(SnapVector<Predicate *> * branches, uint32_t numerator);
40 /* The set of Threads put to sleep by NewFuzzer because no writes in rf_set satisfies the selected predicate. Only used by selectWrite.
42 SnapVector<Thread *> paused_thread_list;
43 HashTable<Thread *, int, uintptr_t, 0> paused_thread_table;
44 HashTable<Predicate *, bool, uintptr_t, 0> failed_predicates;
46 void conditional_sleep(Thread * thread);
47 void wake_up_paused_threads(int * threadlist, int * numthreads);
49 bool find_threads(ModelAction * pending_read);
50 void update_predicate_score(Predicate * predicate, int type);
53 #endif /* end of __NEWFUZZER_H__ */