Logo AND Algorithmique Numérique Distribuée

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