Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : new function MC_diff to display all informations about a system state
authorMarion Guthmuller <marion.guthmuller@loria.fr>
Fri, 13 Jan 2012 15:33:04 +0000 (16:33 +0100)
committerMarion Guthmuller <marion.guthmuller@loria.fr>
Fri, 13 Jan 2012 15:33:04 +0000 (16:33 +0100)
include/mc/modelchecker.h
include/xbt/mmalloc.h
src/include/mc/mc.h
src/mc/mc_global.c
src/xbt/mmalloc/mm_legacy.c
src/xbt/mmalloc/mmprivate.h

index 43870f0..087692b 100644 (file)
@@ -3,3 +3,4 @@
 XBT_PUBLIC(void) MC_assert(int);
 XBT_PUBLIC(void) MC_assert_stateful(int);
 XBT_PUBLIC(int) MC_random(int min, int max);
 XBT_PUBLIC(void) MC_assert(int);
 XBT_PUBLIC(void) MC_assert_stateful(int);
 XBT_PUBLIC(int) MC_random(int min, int max);
+XBT_PUBLIC(void) MC_diff();
index ca4d89d..f167e24 100644 (file)
@@ -66,6 +66,8 @@ extern void *mmalloc_findbase(int size);
 
 extern int mmalloc_compare_heap(void *h1, void *h2);
 
 
 extern int mmalloc_compare_heap(void *h1, void *h2);
 
+extern void mmalloc_display_info_heap(void *h);
+
 /* To change the heap used when using the legacy version malloc/free/realloc and such */
 void mmalloc_set_current_heap(void *new_heap);
 void *mmalloc_get_current_heap(void);
 /* To change the heap used when using the legacy version malloc/free/realloc and such */
 void mmalloc_set_current_heap(void *new_heap);
 void *mmalloc_get_current_heap(void);
index 2e9fc0f..59301fe 100644 (file)
@@ -38,6 +38,7 @@ XBT_PUBLIC(void) MC_modelcheck_liveness(xbt_automaton_t a, char *prgm);
 XBT_PUBLIC(int) MC_random(int, int);
 XBT_PUBLIC(void) MC_process_clock_add(smx_process_t, double);
 XBT_PUBLIC(double) MC_process_clock_get(smx_process_t);
 XBT_PUBLIC(int) MC_random(int, int);
 XBT_PUBLIC(void) MC_process_clock_add(smx_process_t, double);
 XBT_PUBLIC(double) MC_process_clock_get(smx_process_t);
+XBT_PUBLIC(void) MC_diff(void);
 
 /********************************* Memory *************************************/
 XBT_PUBLIC(void) MC_memory_init(void);  /* Initialize the memory subsystem */
 
 /********************************* Memory *************************************/
 XBT_PUBLIC(void) MC_memory_init(void);  /* Initialize the memory subsystem */
index a1953a4..d124b0e 100644 (file)
@@ -572,3 +572,35 @@ double MC_process_clock_get(smx_process_t process)
   else
     return 0;
 }
   else
     return 0;
 }
+
+void MC_diff(void){
+
+  mc_snapshot_t sn = xbt_new0(s_mc_snapshot_t, 1);
+  MC_take_snapshot_liveness(sn);
+
+  int i;
+
+  XBT_INFO("Number of regions : %d", sn->num_reg);
+
+  for(i=0; i<sn->num_reg; i++){
+    
+    switch(sn->regions[i]->type){
+    case 0: /* heap */
+      XBT_INFO("Size of heap : %zu", sn->regions[i]->size);
+      mmalloc_display_info_heap(sn->regions[i]->data);
+      break;
+    case 1 : /* libsimgrid */
+      XBT_INFO("Size of libsimgrid : %zu", sn->regions[i]->size);
+      break;
+    case 2 : /* data program */
+      XBT_INFO("Size of data program : %zu", sn->regions[i]->size);
+      break;
+    case 3 : /* stack */
+      XBT_INFO("Size of stack : %zu", sn->regions[i]->size);
+      XBT_INFO("Start addr of stack : %p", sn->regions[i]->start_addr);
+      break;
+    }
+
+  }
+
+}
index 7a83f26..2f9a247 100644 (file)
@@ -415,6 +415,8 @@ int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2){
 }
 
  
 }
 
  
-  
+void mmalloc_display_info_heap(void *h){
+
+}  
   
 
   
 
index 28dea9d..fa9b62a 100644 (file)
@@ -271,6 +271,8 @@ int mmalloc_compare_heap(void *h1, void *h2);
 
 int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2);
 
 
 int mmalloc_compare_mdesc(struct mdesc *mdp1, struct mdesc *mdp2);
 
+void mmalloc_display_info(void *h);
+
 /* Bits to look at in the malloc descriptor flags word */
 
 #define MMALLOC_DEVZERO                (1 << 0)        /* Have mapped to /dev/zero */
 /* Bits to look at in the malloc descriptor flags word */
 
 #define MMALLOC_DEVZERO                (1 << 0)        /* Have mapped to /dev/zero */