Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : cosmetics in log message
[simgrid.git] / src / mc / mc_compare.c
1 /* Copyright (c) 2012-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <inttypes.h>
8
9 #include "mc_private.h"
10
11 #include "xbt/mmalloc.h"
12 #include "xbt/mmalloc/mmprivate.h"
13
14 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_compare, mc,
15                                 "Logging specific to mc_compare");
16
17 typedef struct s_pointers_pair{
18   void *p1;
19   void *p2;
20 }s_pointers_pair_t, *pointers_pair_t;
21
22 __thread xbt_dynar_t compared_pointers;
23
24 /************************** Free functions ****************************/
25 /********************************************************************/
26
27 static void stack_region_free(stack_region_t s){
28   if(s){
29     xbt_free(s->process_name);
30     xbt_free(s);
31   }
32 }
33
34 static void stack_region_free_voidp(void *s){
35   stack_region_free((stack_region_t) * (void **) s);
36 }
37
38 static void pointers_pair_free(pointers_pair_t p){
39   xbt_free(p);
40 }
41
42 static void pointers_pair_free_voidp(void *p){
43   pointers_pair_free((pointers_pair_t) * (void **)p);
44 }
45
46 /************************** Snapshot comparison *******************************/
47 /******************************************************************************/
48
49 /** \brief Try to add a pair a compared pointers to the set of compared pointers
50  *
51  *  \result !=0 if the pointers were added (they were not in the set),
52  *      0 otherwise (they were already in the set)
53  */
54 static int add_compared_pointers(void *p1, void *p2){
55
56   pointers_pair_t new_pair = xbt_new0(s_pointers_pair_t, 1);
57   new_pair->p1 = p1;
58   new_pair->p2 = p2;
59   
60   if(xbt_dynar_is_empty(compared_pointers)){
61     xbt_dynar_push(compared_pointers, &new_pair);
62     return 1;
63   }
64
65   unsigned int cursor = 0;
66   int start = 0;
67   int end = xbt_dynar_length(compared_pointers) - 1;
68   pointers_pair_t pair = NULL;
69
70   pointers_pair_t* p = (pointers_pair_t*) xbt_dynar_get_ptr(compared_pointers, 0);
71
72   while(start <= end){
73     cursor = (start + end) / 2;
74     pair = p[cursor];
75     if(pair->p1 < p1){
76       start = cursor + 1;
77     } else if(pair->p1 > p1) {
78       end = cursor - 1 ;
79     } else if(pair->p2 < p2){
80       start = cursor + 1;
81     } else if(pair->p2 > p2) {
82       end = cursor - 1 ;
83     } else {
84       pointers_pair_free(new_pair);
85       return 0;
86     }
87   }
88
89   if(pair->p1 < p1)
90     xbt_dynar_insert_at(compared_pointers, cursor + 1, &new_pair);
91   else if(pair->p1 > p1)
92     xbt_dynar_insert_at(compared_pointers, cursor, &new_pair);
93   else if(pair->p2 < p2)
94     xbt_dynar_insert_at(compared_pointers, cursor + 1, &new_pair);
95   else if(pair->p2 > p2)
96     xbt_dynar_insert_at(compared_pointers, cursor, &new_pair);
97   else
98     xbt_die("Unrecheable");
99
100   return 1;
101 }
102
103 static int compare_areas_with_type(void *area1, void *area2, mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, dw_type_t type, int region_size, int region_type, void *start_data, int pointer_level){
104
105   unsigned int cursor = 0;
106   dw_type_t member, subtype, subsubtype;
107   int elm_size, i, res;
108   void *addr_pointed1, *addr_pointed2;
109
110   switch(type->type){
111   case DW_TAG_unspecified_type:
112     return 1;
113
114   case DW_TAG_base_type:
115   case DW_TAG_enumeration_type:
116   case DW_TAG_union_type:
117     return (memcmp(area1, area2, type->byte_size) != 0);
118     break;
119   case DW_TAG_typedef:
120   case DW_TAG_volatile_type:
121   case DW_TAG_const_type:
122     return compare_areas_with_type(area1, area2, snapshot1, snapshot2, type->subtype, region_size, region_type, start_data, pointer_level);
123     break;
124   case DW_TAG_array_type:
125     subtype = type->subtype;
126     switch(subtype->type){
127     case DW_TAG_unspecified_type:
128       return 1;
129
130     case DW_TAG_base_type:
131     case DW_TAG_enumeration_type:
132     case DW_TAG_pointer_type:
133     case DW_TAG_reference_type:
134     case DW_TAG_rvalue_reference_type:
135     case DW_TAG_structure_type:
136     case DW_TAG_class_type:
137     case DW_TAG_union_type:
138       if(subtype->full_type)
139         subtype = subtype->full_type;
140       elm_size = subtype->byte_size;
141       break;
142     case DW_TAG_const_type:
143     case DW_TAG_typedef:
144     case DW_TAG_volatile_type:
145       subsubtype = subtype->subtype;
146       if(subsubtype->full_type)
147           subsubtype = subsubtype->full_type;
148       elm_size = subsubtype->byte_size;
149       break;
150     default : 
151       return 0;
152       break;
153     }
154     for(i=0; i<type->element_count; i++){
155       res = compare_areas_with_type((char *)area1 + (i*elm_size), (char *)area2 + (i*elm_size), snapshot1, snapshot2, type->subtype, region_size, region_type, start_data, pointer_level);
156       if(res == 1)
157         return res;
158     }
159     break;
160   case DW_TAG_pointer_type:
161   case DW_TAG_reference_type:
162   case DW_TAG_rvalue_reference_type:
163
164     addr_pointed1 = *((void **)(area1));
165     addr_pointed2 = *((void **)(area2));
166
167     if(type->subtype && type->subtype->type == DW_TAG_subroutine_type){
168       return (addr_pointed1 != addr_pointed2);
169     }else{
170       
171       if(addr_pointed1 == NULL && addr_pointed2 == NULL)
172         return 0;
173       if(!add_compared_pointers(addr_pointed1, addr_pointed2))
174         return 0;
175
176       pointer_level++;
177       
178       // Some cases are not handled here:
179       // * the pointers lead to different areas (one to the heap, the other to the RW segment ...);
180       // * a pointer leads to the read-only segment of the current object;
181       // * a pointer lead to a different ELF object.
182
183       if(addr_pointed1 > std_heap && addr_pointed1 < mc_snapshot_get_heap_end(snapshot1)){
184         if(!(addr_pointed2 > std_heap && addr_pointed2 < mc_snapshot_get_heap_end(snapshot2)))
185           return 1;
186         // The pointers are both in the heap:
187         return compare_heap_area(addr_pointed1, addr_pointed2, snapshot1, snapshot2, NULL, type->subtype, pointer_level);
188       }
189
190       // The pointers are both in the current object R/W segment:
191       else if(addr_pointed1 > start_data && (char*)addr_pointed1 <= (char *)start_data + region_size){
192         if(!(addr_pointed2 > start_data && (char*)addr_pointed2 <= (char *)start_data + region_size))
193           return 1;
194         if(type->dw_type_id == NULL)
195           return  (addr_pointed1 != addr_pointed2);
196         else {
197           void* translated_addr_pointer1 = mc_translate_address((uintptr_t)addr_pointed1, snapshot1);
198           void* translated_addr_pointer2 = mc_translate_address((uintptr_t)addr_pointed2, snapshot2);
199           return  compare_areas_with_type(
200             translated_addr_pointer1, translated_addr_pointer2, snapshot1, snapshot2, type->subtype, region_size, region_type, start_data, pointer_level);
201         }
202       }
203
204       else{
205         return (addr_pointed1 != addr_pointed2);
206       }
207     }
208     break;
209   case DW_TAG_structure_type:
210   case DW_TAG_class_type:
211     xbt_dynar_foreach(type->members, cursor, member){
212       XBT_DEBUG("Compare member %s", member->name);
213       void* member1 = mc_member_snapshot_resolve(area1, type, member, snapshot1);
214       void* member2 = mc_member_snapshot_resolve(area2, type, member, snapshot2);
215       res = compare_areas_with_type(member1, member2, snapshot1, snapshot2, member->subtype, region_size, region_type, start_data, pointer_level);
216       if(res == 1)
217         return res;
218     }
219     break;
220   case DW_TAG_subroutine_type:
221     return -1;
222     break;
223   default:
224     XBT_VERB("Unknown case : %d", type->type);
225     break;
226   }
227   
228   return 0;
229 }
230
231 static int compare_global_variables(int region_type, mc_mem_region_t r1, mc_mem_region_t r2, mc_snapshot_t snapshot1, mc_snapshot_t snapshot2){
232
233   if(!compared_pointers){
234     compared_pointers = xbt_dynar_new(sizeof(pointers_pair_t), pointers_pair_free_voidp);
235   }else{
236     xbt_dynar_reset(compared_pointers);
237   }
238
239   xbt_dynar_t variables;
240   int res;
241   unsigned int cursor = 0;
242   dw_variable_t current_var;
243   size_t offset;
244   void *start_data;
245   void* start_data_binary = mc_binary_info->start_rw;
246   void* start_data_libsimgrid = mc_libsimgrid_info->start_rw;
247
248   mc_object_info_t object_info = NULL;
249   if(region_type == 2){
250     object_info = mc_binary_info;
251     start_data = start_data_binary;
252   }else{
253     object_info = mc_libsimgrid_info;
254     start_data = start_data_libsimgrid;
255   }
256   variables = object_info->global_variables;
257
258   xbt_dynar_foreach(variables, cursor, current_var){
259
260     // If the variable is not in this object, skip it:
261     // We do not expect to find a pointer to something which is not reachable
262     // by the global variables.
263     if((char*) current_var->address < (char*) object_info->start_rw
264       || (char*) current_var->address > (char*) object_info->end_rw)
265        continue;
266
267     offset = (char *)current_var->address - (char *)object_info->start_rw;
268
269     dw_type_t bvariable_type = current_var->type;
270     res = compare_areas_with_type((char *)r1->data + offset, (char *)r2->data + offset, snapshot1, snapshot2, bvariable_type, r1->size, region_type, start_data, 0);
271     if(res == 1){
272       XBT_VERB("Global variable %s (%p - %p) is different between snapshots", current_var->name, (char *)r1->data + offset, (char *)r2->data + offset);
273       xbt_dynar_free(&compared_pointers);
274       compared_pointers = NULL;
275       return 1;
276     }
277
278   }
279
280   xbt_dynar_free(&compared_pointers);
281   compared_pointers = NULL;
282
283   return 0;
284
285 }
286
287 static int compare_local_variables(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, mc_snapshot_stack_t stack1, mc_snapshot_stack_t stack2, void *heap1, void *heap2){
288   void* start_data_binary = mc_binary_info->start_rw;
289   void* start_data_libsimgrid = mc_libsimgrid_info->start_rw;
290
291   if(!compared_pointers){
292     compared_pointers = xbt_dynar_new(sizeof(pointers_pair_t), pointers_pair_free_voidp);
293   }else{
294     xbt_dynar_reset(compared_pointers);
295   }
296
297   if(xbt_dynar_length(stack1->local_variables) != xbt_dynar_length(stack2->local_variables)){
298     XBT_VERB("Different number of local variables");
299     xbt_dynar_free(&compared_pointers);
300     compared_pointers = NULL;
301     return 1;
302   }else{
303     unsigned int cursor = 0;
304     local_variable_t current_var1, current_var2;
305     int offset1, offset2, res;
306     while(cursor < xbt_dynar_length(stack1->local_variables)){
307       current_var1 = (local_variable_t)xbt_dynar_get_as(stack1->local_variables, cursor, local_variable_t);
308       current_var2 = (local_variable_t)xbt_dynar_get_as(stack2->local_variables, cursor, local_variable_t);
309       if(strcmp(current_var1->name, current_var2->name) != 0 || current_var1->subprogram != current_var1->subprogram || current_var1->ip != current_var2->ip){
310         xbt_dynar_free(&compared_pointers);
311         // TODO, fix current_varX->subprogram->name to include name if DW_TAG_inlined_subprogram
312         XBT_VERB("Different name of variable (%s - %s) or frame (%s - %s) or ip (%lu - %lu)", current_var1->name, current_var2->name, current_var1->subprogram->name, current_var2->subprogram->name, current_var1->ip, current_var2->ip);
313         return 1;
314       }
315       offset1 = (char *)current_var1->address - (char *)std_heap;
316       offset2 = (char *)current_var2->address - (char *)std_heap;
317       // TODO, fix current_varX->subprogram->name to include name if DW_TAG_inlined_subprogram
318       XBT_DEBUG("Compare local variable %s of frame %s", current_var1->subprogram->name, current_var1->subprogram->name);
319
320
321       if(current_var1->region == 1) {
322         dw_type_t subtype = current_var1->type;
323         res = compare_areas_with_type( (char *)heap1 + offset1, (char *)heap2 + offset2, snapshot1, snapshot2, subtype, 0, 1, start_data_libsimgrid, 0);
324       } else {
325         dw_type_t subtype = current_var2->type;
326         res = compare_areas_with_type( (char *)heap1 + offset1, (char *)heap2 + offset2, snapshot1, snapshot2, subtype, 0, 2, start_data_binary, 0);
327       }
328       if(res == 1){
329         // TODO, fix current_varX->subprogram->name to include name if DW_TAG_inlined_subprogram
330         XBT_VERB("Local variable %s (%p - %p) in frame %s  is different between snapshots", current_var1->name,(char *)heap1 + offset1, (char *)heap2 + offset2, current_var1->subprogram->name);
331         xbt_dynar_free(&compared_pointers);
332         compared_pointers = NULL;
333         return res;
334       }
335       cursor++;
336     }
337     xbt_dynar_free(&compared_pointers);
338     compared_pointers = NULL;
339     return 0;
340   }
341 }
342
343 int snapshot_compare(void *state1, void *state2){
344
345   mc_snapshot_t s1, s2;
346   int num1, num2;
347   
348   if(_sg_mc_property_file && _sg_mc_property_file[0] != '\0'){ /* Liveness MC */
349     s1 = ((mc_visited_pair_t)state1)->graph_state->system_state;
350     s2 = ((mc_visited_pair_t)state2)->graph_state->system_state;
351     num1 = ((mc_visited_pair_t)state1)->num;
352     num2 =  ((mc_visited_pair_t)state2)->num;
353     /* Firstly compare automaton state */
354     /*if(xbt_automaton_state_compare(((mc_pair_t)state1)->automaton_state, ((mc_pair_t)state2)->automaton_state) != 0)
355       return 1;
356     if(xbt_automaton_propositional_symbols_compare_value(((mc_pair_t)state1)->atomic_propositions, ((mc_pair_t)state2)->atomic_propositions) != 0)
357     return 1;*/
358   }else{ /* Safety MC */
359     s1 = ((mc_visited_state_t)state1)->system_state;
360     s2 = ((mc_visited_state_t)state2)->system_state;
361     num1 = ((mc_visited_state_t)state1)->num;
362     num2 = ((mc_visited_state_t)state2)->num;
363   }
364
365   int errors = 0;
366   int res_init;
367
368   xbt_os_timer_t global_timer = xbt_os_timer_new();
369   xbt_os_timer_t timer = xbt_os_timer_new();
370
371   xbt_os_walltimer_start(global_timer);
372
373   #ifdef MC_DEBUG
374     xbt_os_walltimer_start(timer);
375   #endif
376
377   int hash_result = 0;
378   if(_sg_mc_hash) {
379     hash_result = (s1->hash != s2->hash);
380     if(hash_result) {
381       XBT_VERB("(%d - %d) Different hash : 0x%" PRIx64 "--0x%" PRIx64, num1, num2, s1->hash, s2->hash);
382 #ifndef MC_DEBUG
383       return 1;
384 #endif
385     } else {
386       XBT_VERB("(%d - %d) Same hash : 0x%" PRIx64, num1, num2, s1->hash);
387     }
388   }
389
390   int i = 0;
391   size_t size_used1, size_used2;
392   int is_diff = 0;
393
394
395   /* Compare size of stacks */
396   while(i < xbt_dynar_length(s1->stacks)){
397     size_used1 = s1->stack_sizes[i];
398     size_used2 = s2->stack_sizes[i];
399     if(size_used1 != size_used2){
400     #ifdef MC_DEBUG
401       if(is_diff == 0){
402         xbt_os_walltimer_stop(timer);
403         mc_comp_times->stacks_sizes_comparison_time = xbt_os_timer_elapsed(timer);
404       }
405       XBT_DEBUG("(%d - %d) Different size used in stacks : %zu - %zu", num1, num2, size_used1, size_used2);
406       errors++;
407       is_diff = 1;
408     #else
409       #ifdef MC_VERBOSE
410       XBT_VERB("(%d - %d) Different size used in stacks : %zu - %zu", num1, num2, size_used1, size_used2);
411       #endif
412
413       xbt_os_walltimer_stop(timer);
414       xbt_os_timer_free(timer);
415       xbt_os_walltimer_stop(global_timer);
416       mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
417       xbt_os_timer_free(global_timer);
418
419       return 1;
420     #endif  
421     }
422     i++;
423   }
424
425   #ifdef MC_DEBUG
426     if(is_diff == 0)
427       xbt_os_walltimer_stop(timer);
428     xbt_os_walltimer_start(timer);
429   #endif
430
431   /* Init heap information used in heap comparison algorithm */
432   res_init = init_heap_information((xbt_mheap_t)s1->regions[0]->data, (xbt_mheap_t)s2->regions[0]->data, s1->to_ignore, s2->to_ignore);
433   if(res_init == -1){
434      #ifdef MC_DEBUG
435     XBT_DEBUG("(%d - %d) Different heap information", num1, num2); 
436         errors++; 
437       #else
438         #ifdef MC_VERBOSE
439         XBT_VERB("(%d - %d) Different heap information", num1, num2); 
440         #endif
441
442         xbt_os_walltimer_stop(global_timer);
443         mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
444         xbt_os_timer_free(global_timer);
445
446         return 1;
447       #endif
448   }
449
450   #ifdef MC_DEBUG
451     xbt_os_walltimer_start(timer);
452   #endif
453
454   /* Stacks comparison */
455   unsigned int  cursor = 0;
456   int diff_local = 0;
457 #ifdef MC_DEBUG
458   is_diff = 0;
459 #endif
460   mc_snapshot_stack_t stack1, stack2;
461     
462   while(cursor < xbt_dynar_length(s1->stacks)){
463     stack1 = (mc_snapshot_stack_t)xbt_dynar_get_as(s1->stacks, cursor, mc_snapshot_stack_t);
464     stack2 = (mc_snapshot_stack_t)xbt_dynar_get_as(s2->stacks, cursor, mc_snapshot_stack_t);
465     diff_local = compare_local_variables(s1, s2, stack1, stack2, s1->regions[0]->data, s2->regions[0]->data);
466     if(diff_local > 0){
467       #ifdef MC_DEBUG
468         if(is_diff == 0){
469           xbt_os_walltimer_stop(timer);
470           mc_comp_times->stacks_comparison_time = xbt_os_timer_elapsed(timer);
471         }
472         XBT_DEBUG("(%d - %d) Different local variables between stacks %d", num1, num2, cursor + 1);
473         errors++;
474         is_diff = 1;
475       #else
476         
477         #ifdef MC_VERBOSE
478         XBT_VERB("(%d - %d) Different local variables between stacks %d", num1, num2, cursor + 1);
479         #endif
480           
481         reset_heap_information();
482         xbt_os_walltimer_stop(timer);
483         xbt_os_timer_free(timer);
484         xbt_os_walltimer_stop(global_timer);
485         mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
486         xbt_os_timer_free(global_timer);
487  
488         return 1;
489       #endif
490     }
491     cursor++;
492   }
493
494
495
496  const char* names[3] = { "?", "libsimgrid", "binary" };
497 #ifdef MC_DEBUG
498  double *times[3] = {
499    NULL,
500    &mc_comp_times->libsimgrid_global_variables_comparison_time,
501    &mc_comp_times->binary_global_variables_comparison_time
502  };
503 #endif
504
505  int k=0;
506  for(k=2; k!=0; --k) {
507     #ifdef MC_DEBUG
508       if(is_diff == 0)
509         xbt_os_walltimer_stop(timer);
510       xbt_os_walltimer_start(timer);
511     #endif
512
513   /* Compare global variables */
514   is_diff = compare_global_variables(k, s1->regions[k], s2->regions[k], s1, s2);
515   if(is_diff != 0){
516     #ifdef MC_DEBUG
517       xbt_os_walltimer_stop(timer);
518       *times[k] = xbt_os_timer_elapsed(timer);
519       XBT_DEBUG("(%d - %d) Different global variables in %s", num1, num2, names[k]);
520       errors++;
521     #else
522       #ifdef MC_VERBOSE
523       XBT_VERB("(%d - %d) Different global variables in %s", num1, num2, names[k]);
524       #endif
525
526       reset_heap_information();
527       xbt_os_walltimer_stop(timer);
528       xbt_os_timer_free(timer);
529       xbt_os_walltimer_stop(global_timer);
530       mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
531       xbt_os_timer_free(global_timer);
532
533       return 1;
534     #endif
535   }
536  }
537
538   #ifdef MC_DEBUG
539     xbt_os_walltimer_start(timer);
540   #endif
541
542   /* Compare heap */
543     if(mmalloc_compare_heap(s1, s2, (xbt_mheap_t)s1->regions[0]->data,
544                             (xbt_mheap_t)s2->regions[0]->data) > 0){
545
546     #ifdef MC_DEBUG
547       xbt_os_walltimer_stop(timer);
548       mc_comp_times->heap_comparison_time = xbt_os_timer_elapsed(timer); 
549       XBT_DEBUG("(%d - %d) Different heap (mmalloc_compare)", num1, num2);
550       errors++;
551     #else
552  
553       #ifdef MC_VERBOSE
554       XBT_VERB("(%d - %d) Different heap (mmalloc_compare)", num1, num2);
555       #endif
556        
557       reset_heap_information();
558       xbt_os_walltimer_stop(timer);
559       xbt_os_timer_free(timer);
560       xbt_os_walltimer_stop(global_timer);
561       mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
562       xbt_os_timer_free(global_timer);
563
564       return 1;
565     #endif
566   }else{
567     #ifdef MC_DEBUG
568       xbt_os_walltimer_stop(timer);
569     #endif
570   }
571
572   reset_heap_information();
573   
574   xbt_os_walltimer_stop(timer);
575   xbt_os_timer_free(timer);
576
577   #ifdef MC_VERBOSE
578     xbt_os_walltimer_stop(global_timer);
579     mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
580   #endif
581
582   xbt_os_timer_free(global_timer);
583
584   #ifdef MC_DEBUG
585     print_comparison_times();
586   #endif
587
588 #ifdef MC_VERBOSE
589    if(errors || hash_result)
590      XBT_VERB("(%d - %d) Difference found", num1, num2);
591    else
592      XBT_VERB("(%d - %d) No difference found", num1, num2);
593 #endif
594
595 #if defined(MC_DEBUG) && defined(MC_VERBOSE)
596    if(_sg_mc_hash) {
597      // * false positive SHOULD be avoided.
598      // * There MUST not be any false negative.
599
600      XBT_VERB("(%d - %d) State equality hash test is %s %s", num1, num2,
601        (hash_result!=0) == (errors!=0) ? "true" : "false",
602        !hash_result ? "positive" : "negative");
603    }
604 #endif
605
606    return errors > 0 || hash_result;
607   
608 }
609
610 /***************************** Statistics *****************************/
611 /*******************************************************************/
612
613 void print_comparison_times(){
614   XBT_DEBUG("*** Comparison times ***");
615   XBT_DEBUG("- Nb processes : %f", mc_comp_times->nb_processes_comparison_time);
616   XBT_DEBUG("- Nb bytes used : %f", mc_comp_times->bytes_used_comparison_time);
617   XBT_DEBUG("- Stacks sizes : %f", mc_comp_times->stacks_sizes_comparison_time);
618   XBT_DEBUG("- Binary global variables : %f", mc_comp_times->binary_global_variables_comparison_time);
619   XBT_DEBUG("- Libsimgrid global variables : %f", mc_comp_times->libsimgrid_global_variables_comparison_time);
620   XBT_DEBUG("- Heap : %f", mc_comp_times->heap_comparison_time);
621   XBT_DEBUG("- Stacks : %f", mc_comp_times->stacks_comparison_time);
622 }
623
624 /**************************** MC snapshot compare simcall **************************/
625 /***********************************************************************************/
626
627 int SIMIX_pre_mc_compare_snapshots(smx_simcall_t simcall,
628                                    mc_snapshot_t s1, mc_snapshot_t s2){
629   return snapshot_compare(s1, s2);
630 }
631
632 int MC_compare_snapshots(void *s1, void *s2){
633
634   return simcall_mc_compare_snapshots(s1, s2);
635
636 }