Logo AND Algorithmique Numérique Distribuée

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