Logo AND Algorithmique Numérique Distribuée

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