Logo AND Algorithmique Numérique Distribuée

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