Logo AND Algorithmique Numérique Distribuée

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