My configuration
authorBrian Demsky <bdemsky@uci.edu>
Tue, 7 Jan 2020 00:04:49 +0000 (16:04 -0800)
committerBrian Demsky <bdemsky@uci.edu>
Tue, 7 Jan 2020 00:04:49 +0000 (16:04 -0800)
cmodelint.cc
config.h
execution.cc

index ea34324b7a21a2742113268470c6b878b5f03b84..d3fcbb4656919157220ed5a4197ee3c58b723e75 100644 (file)
@@ -97,7 +97,7 @@ void model_rmwc_action_helper(void *obj, int atomic_index, const char *position)
 #define VOLATILELOAD(size) \
        uint ## size ## _t cds_volatile_load ## size(void * obj, const char * position) { \
                ensureModel();                                                      \
-               return (uint ## size ## _t)model->switch_to_master(new ModelAction(ATOMIC_READ, position, memory_order_relaxed, obj)); \
+               return (uint ## size ## _t)model->switch_to_master(new ModelAction(ATOMIC_READ, position, memory_order_volatile_load, obj)); \
        }
 
 VOLATILELOAD(8)
@@ -109,7 +109,7 @@ VOLATILELOAD(64)
 #define VOLATILESTORE(size) \
        void cds_volatile_store ## size (void * obj, uint ## size ## _t val, const char * position) { \
                ensureModel();                                                      \
-               model->switch_to_master(new ModelAction(ATOMIC_WRITE, position, memory_order_relaxed, obj, (uint64_t) val)); \
+               model->switch_to_master(new ModelAction(ATOMIC_WRITE, position, memory_order_volatile_store, obj, (uint64_t) val)); \
                *((volatile uint ## size ## _t *)obj) = val;            \
                thread_id_t tid = thread_current()->get_id();           \
                for(int i=0;i < size / 8;i++) {                         \
@@ -340,6 +340,7 @@ void cds_atomic_thread_fence(int atomic_index, const char * position) {
  */
 
 void cds_func_entry(const char * funcName) {
+#ifdef NEWFUZZER
        ensureModel();
        Thread * th = thread_current();
        uint32_t func_id;
@@ -362,9 +363,11 @@ void cds_func_entry(const char * funcName) {
        }
 
        history->enter_function(func_id, th->get_id());
+#endif
 }
 
 void cds_func_exit(const char * funcName) {
+#ifdef NEWFUZZER
        ensureModel();
 
        Thread * th = thread_current();
@@ -382,4 +385,5 @@ void cds_func_exit(const char * funcName) {
                return;
 
        history->exit_function(func_id, th->get_id());
+#endif
 }
index 7ed00f092478a56b13870f67ad0902faea9211a7..f86275a725a15344507dfbc46598e28fc95ba339 100644 (file)
--- a/config.h
+++ b/config.h
 /** Enable mitigations against fork handlers that call into locks...  */
 #define FORK_HANDLER_HACK
 
+/** Enable smart fuzzer */
+//#define NEWFUZZER
+
+/** Define semantics of volatile memory operations. */
+#define memory_order_volatile_load memory_order_acquire
+#define memory_order_volatile_store memory_order_release
+
+//#define memory_order_volatile_load memory_order_relaxed
+//#define memory_order_volatile_store memory_order_relaxed
+
 #endif
index a76a3e18ac5251605ff4a24db3ba43fb477c16df..8853bfeefee1a44a7a05e220999ceb057ecc385e 100644 (file)
@@ -63,7 +63,11 @@ ModelExecution::ModelExecution(ModelChecker *m, Scheduler *scheduler) :
        thrd_last_fence_release(),
        priv(new struct model_snapshot_members ()),
        mo_graph(new CycleGraph()),
+#ifdef NEWFUZZER
+       fuzzer(new NewFuzzer()),
+#else
        fuzzer(new Fuzzer()),
+#endif
        isfinished(false)
 {
        /* Initialize a model-checker thread, for special ModelActions */
@@ -275,7 +279,9 @@ ModelAction * ModelExecution::convertNonAtomicStore(void * location) {
        add_normal_write_to_lists(act);
        add_write_to_lists(act);
        w_modification_order(act);
+#ifdef NEWFUZZER
        model->get_history()->process_action(act, act->get_tid());
+#endif
        return act;
 }
 
@@ -1643,8 +1649,9 @@ Thread * ModelExecution::take_step(ModelAction *curr)
        ASSERT(curr);
 
        /* Process this action in ModelHistory for records */
+#ifdef NEWFUZZER
        model->get_history()->process_action( curr, curr->get_tid() );
-
+#endif
        if (curr_thrd->is_blocked() || curr_thrd->is_complete())
                scheduler->remove_thread(curr_thrd);