X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d47e21d93998034c0f8fa4a9a6c750002f7642fa..6f9d5bdabcf16a0b36012f3d7cf32a2d736bb6f0:/src/mc/mc_checkpoint.c diff --git a/src/mc/mc_checkpoint.c b/src/mc/mc_checkpoint.c index 17cc3d5d92..abb2dee35a 100644 --- a/src/mc/mc_checkpoint.c +++ b/src/mc/mc_checkpoint.c @@ -166,9 +166,10 @@ static void MC_get_memory_regions(mc_snapshot_t snapshot) snapshot->privatization_regions = xbt_new(mc_mem_region_t, SIMIX_process_count()); for (i = 0; i < SIMIX_process_count(); i++) { - // TODO, add support for sparse snapshot + mc_mem_region_t ref_reg = + mc_model_checker->parent_snapshot ? mc_model_checker->parent_snapshot->privatization_regions[i] : NULL; snapshot->privatization_regions[i] = - MC_region_new(-1, mappings[i], size_data_exe, NULL); + MC_region_new(-1, mappings[i], size_data_exe, ref_reg); } snapshot->privatization_index = loaded_page; } @@ -462,7 +463,7 @@ static xbt_dynar_t MC_unwind_stack_frames(void *stack_context) return result; }; -static xbt_dynar_t MC_take_snapshot_stacks(mc_snapshot_t * snapshot, void *heap) +static xbt_dynar_t MC_take_snapshot_stacks(mc_snapshot_t * snapshot) { xbt_dynar_t res = @@ -585,7 +586,7 @@ mc_snapshot_t MC_take_snapshot(int num_state) /* Save the std heap and the writable mapped pages of libsimgrid and binary */ MC_get_memory_regions(snapshot); - if (_sg_mc_sparse_checkpoint) { + if (_sg_mc_sparse_checkpoint && _sg_mc_soft_dirty) { mc_softdirty_reset(); } @@ -593,7 +594,7 @@ mc_snapshot_t MC_take_snapshot(int num_state) if (_sg_mc_visited > 0 || strcmp(_sg_mc_property_file, "")) { snapshot->stacks = - MC_take_snapshot_stacks(&snapshot, snapshot->regions[0]->data); + MC_take_snapshot_stacks(&snapshot); if (_sg_mc_hash && snapshot->stacks != NULL) { snapshot->hash = mc_hash_processes_state(num_state, snapshot->stacks); } else { @@ -630,10 +631,11 @@ void MC_restore_snapshot(mc_snapshot_t snapshot) switch_data_segment(snapshot->privatization_index); } - MC_snapshot_ignore_restore(snapshot); - if (_sg_mc_sparse_checkpoint) { + if (_sg_mc_sparse_checkpoint && _sg_mc_soft_dirty) { mc_softdirty_reset(); } + + MC_snapshot_ignore_restore(snapshot); mc_model_checker->parent_snapshot = snapshot; }