X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/56048e3bbbccaeb0c3f1ec9d0105048d7e122af1..b9ee03b0a7b123fad1f8f0837edfb2a827a4ac9b:/src/mc/mc_checkpoint.c diff --git a/src/mc/mc_checkpoint.c b/src/mc/mc_checkpoint.c index 1ab97ea4c2..5910aeb74e 100644 --- a/src/mc/mc_checkpoint.c +++ b/src/mc/mc_checkpoint.c @@ -5,6 +5,7 @@ #include #include "mc_private.h" +#include "xbt/module.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_checkpoint, mc, @@ -37,7 +38,7 @@ static void MC_region_restore(mc_mem_region_t reg) memory_map_t maps = get_memory_map(); MC_UNSET_RAW_MEM; unsigned int i=0; - s_map_region r; + s_map_region_t r; while(i < maps->mapsize){ r = maps->regions[i]; if (maps->regions[i].pathname != NULL){ @@ -90,7 +91,7 @@ static void MC_snapshot_add_region(mc_snapshot_t snapshot, int type, void *start void MC_take_snapshot(mc_snapshot_t snapshot) { unsigned int i = 0; - s_map_region reg; + s_map_region_t reg; memory_map_t maps = get_memory_map(); /* Save the std heap and the writable mapped pages of libsimgrid */ @@ -113,45 +114,10 @@ void MC_take_snapshot(mc_snapshot_t snapshot) /* FIXME: free the memory map */ } - void MC_take_snapshot_liveness(mc_snapshot_t snapshot) { unsigned int i = 0; - s_map_region reg; - memory_map_t maps = get_memory_map(); - - for(i=0; i< snapshot->num_reg; i++){ - MC_region_destroy(snapshot->regions[i]); - } - - snapshot->num_reg = 0; - - i = 0; - - /* Save the std heap and the writable mapped pages of libsimgrid */ - while (i < maps->mapsize) { - reg = maps->regions[i]; - if ((reg.prot & PROT_WRITE)){ - if (maps->regions[i].pathname == NULL){ - if (reg.start_addr == std_heap){ // only save the std heap (and not the raw one) - MC_snapshot_add_region(snapshot, 0, reg.start_addr, (char*)reg.end_addr - (char*)reg.start_addr); - } - }else { - if (!memcmp(basename(maps->regions[i].pathname), "libsimgrid", 10)){ - MC_snapshot_add_region(snapshot, 1, reg.start_addr, (char*)reg.end_addr - (char*)reg.start_addr); - } - } - } - i++; - } - - /* FIXME: free the memory map */ -} - -void MC_take_snapshot_to_restore_liveness(mc_snapshot_t snapshot) -{ - unsigned int i = 0; - s_map_region reg; + s_map_region_t reg; memory_map_t maps = get_memory_map(); for(i=0; i< snapshot->num_reg; i++){ @@ -174,7 +140,7 @@ void MC_take_snapshot_to_restore_liveness(mc_snapshot_t snapshot) if (!memcmp(basename(maps->regions[i].pathname), "libsimgrid", 10)){ MC_snapshot_add_region(snapshot, 1, reg.start_addr, (char*)reg.end_addr - (char*)reg.start_addr); } else { - if (!memcmp(basename(maps->regions[i].pathname), basename(prog_name), strlen(basename(prog_name)))){ + if (!memcmp(basename(maps->regions[i].pathname), basename(xbt_binary_name), strlen(basename(xbt_binary_name)))){ MC_snapshot_add_region(snapshot, 2, reg.start_addr, (char*)reg.end_addr - (char*)reg.start_addr); } }