Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Make s_mc_global_t::stacks a std::vector
[simgrid.git] / src / mc / mc_checkpoint.cpp
1 /* Copyright (c) 2008-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 <unistd.h>
8
9 #include <string.h>
10 #include <link.h>
11 #include <dirent.h>
12
13 #include "internal_config.h"
14 #include "mc_memory_map.h"
15 #include "mc_private.h"
16 #include "xbt/module.h"
17 #include <xbt/mmalloc.h>
18 #include "../smpi/private.h"
19 #include <alloca.h>
20
21 #include "xbt/mmalloc/mmprivate.h"
22
23 #include "../simix/smx_private.h"
24
25 #include <libunwind.h>
26 #include <libelf.h>
27
28 #include "mc_private.h"
29 #include <mc/mc.h>
30
31 #include "mc_snapshot.h"
32 #include "mc_object_info.h"
33 #include "mc_mmu.h"
34 #include "mc_unw.h"
35 #include "mc_protocol.h"
36 #include "mc_smx.h"
37 #include "mc_hash.hpp"
38
39 using simgrid::mc::remote;
40
41 extern "C" {
42
43 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_checkpoint, mc,
44                                 "Logging specific to mc_checkpoint");
45
46 /************************************  Free functions **************************************/
47 /*****************************************************************************************/
48
49 s_mc_snapshot_stack::~s_mc_snapshot_stack()
50 {
51   xbt_dynar_free(&(this->stack_frames));
52   if (this->context)
53     mc_unw_destroy_context(this->context);
54   xbt_free(this->context);
55 }
56
57 static void MC_snapshot_stack_free_voidp(void *s)
58 {
59   mc_snapshot_stack_t stack = (mc_snapshot_stack_t) * (void **) s;
60   delete stack;
61 }
62
63 static void local_variable_free_voidp(void *v)
64 {
65   local_variable_t var = *(local_variable_t*)v;
66   delete var;
67 }
68
69 }
70
71 extern "C" {
72
73 /** @brief Restore a region from a snapshot
74  *
75  *  @param reg     Target region
76  */
77 static void MC_region_restore(mc_mem_region_t region)
78 {
79   switch(region->storage_type()) {
80   case simgrid::mc::StorageType::NoData:
81   default:
82     xbt_die("Storage type not supported");
83     break;
84
85   case simgrid::mc::StorageType::Flat:
86     mc_model_checker->process().write_bytes(region->flat_data().data(),
87       region->size(), region->permanent_address());
88     break;
89
90   case simgrid::mc::StorageType::Chunked:
91     mc_region_restore_sparse(&mc_model_checker->process(), region);
92     break;
93
94   case simgrid::mc::StorageType::Privatized:
95     for (auto& p : region->privatized_data())
96       MC_region_restore(&p);
97     break;
98   }
99 }
100
101 }
102
103 namespace simgrid {
104 namespace mc {
105
106 simgrid::mc::RegionSnapshot privatized_region(
107     RegionType region_type, void *start_addr, void* permanent_addr, size_t size
108     )
109 {
110   size_t process_count = MC_smpi_process_count();
111
112   // Read smpi_privatisation_regions from MCed:
113   smpi_privatisation_region_t remote_smpi_privatisation_regions;
114   mc_model_checker->process().read_variable(
115     "smpi_privatisation_regions",
116     &remote_smpi_privatisation_regions, sizeof(remote_smpi_privatisation_regions));
117   s_smpi_privatisation_region_t privatisation_regions[process_count];
118   mc_model_checker->process().read_bytes(
119     &privatisation_regions, sizeof(privatisation_regions),
120     remote(remote_smpi_privatisation_regions));
121
122   std::vector<simgrid::mc::RegionSnapshot> data;
123   data.reserve(process_count);
124   for (size_t i = 0; i < process_count; i++)
125     data.push_back(
126       simgrid::mc::region(region_type, start_addr,
127         privatisation_regions[i].address, size)
128       );
129
130   simgrid::mc::RegionSnapshot region = simgrid::mc::RegionSnapshot(
131     region_type, start_addr, permanent_addr, size);
132   region.privatized_data(std::move(data));
133   return std::move(region);
134 }
135
136 }
137 }
138
139 extern "C" {
140
141 static void MC_snapshot_add_region(int index, mc_snapshot_t snapshot,
142                                   simgrid::mc::RegionType type,
143                                   mc_object_info_t object_info,
144                                   void *start_addr, void* permanent_addr, size_t size)
145 {
146   if (type == simgrid::mc::RegionType::Data)
147     xbt_assert(object_info, "Missing object info for object.");
148   else if (type == simgrid::mc::RegionType::Heap)
149     xbt_assert(!object_info, "Unexpected object info for heap region.");
150
151   const bool privatization_aware = MC_object_info_is_privatized(object_info);
152
153   simgrid::mc::RegionSnapshot region;
154   if (privatization_aware && MC_smpi_process_count())
155     region = simgrid::mc::privatized_region(type, start_addr, permanent_addr, size);
156   else
157     region = simgrid::mc::region(type, start_addr, permanent_addr, size);
158
159   region.object_info(object_info);
160   snapshot->snapshot_regions[index]
161     = std::unique_ptr<simgrid::mc::RegionSnapshot>(
162       new simgrid::mc::RegionSnapshot(std::move(region)));
163   return;
164 }
165
166 static void MC_get_memory_regions(mc_process_t process, mc_snapshot_t snapshot)
167 {
168   const size_t n = process->object_infos_size;
169   snapshot->snapshot_regions.resize(n + 1);
170   for (size_t i = 0; i != n; ++i) {
171     mc_object_info_t object_info = process->object_infos[i];
172     MC_snapshot_add_region(i, snapshot, simgrid::mc::RegionType::Data, object_info,
173       object_info->start_rw, object_info->start_rw,
174       object_info->end_rw - object_info->start_rw);
175   }
176
177   xbt_mheap_t heap = process->get_heap();
178   void *start_heap = heap->base;
179   void *end_heap = heap->breakval;
180
181   MC_snapshot_add_region(n, snapshot, simgrid::mc::RegionType::Heap, NULL,
182                         start_heap, start_heap,
183                         (char *) end_heap - (char *) start_heap);
184   snapshot->heap_bytes_used = mmalloc_get_bytes_used_remote(
185     heap->heaplimit,
186     process->get_malloc_info());
187
188 #ifdef HAVE_SMPI
189   if (smpi_privatize_global_variables && MC_smpi_process_count()) {
190     // snapshot->privatization_index = smpi_loaded_page
191     mc_model_checker->process().read_variable(
192       "smpi_loaded_page", &snapshot->privatization_index,
193       sizeof(snapshot->privatization_index));
194   } else
195 #endif
196   {
197     snapshot->privatization_index = simgrid::mc::ProcessIndexMissing;
198   }
199 }
200
201 /** \brief Fills the position of the segments (executable, read-only, read/write).
202  *
203  *  `dl_iterate_phdr` would be more robust but would not work in cross-process.
204  * */
205 void MC_find_object_address(std::vector<simgrid::mc::VmMap> const& maps, mc_object_info_t result)
206 {
207   const char *name = basename(result->file_name);
208   for (size_t i = 0; i < maps.size(); ++i) {
209     simgrid::mc::VmMap const& reg = maps[i];
210     if (maps[i].pathname.empty()
211         || strcmp(basename(maps[i].pathname.c_str()), name)) {
212       // Nothing to do
213     } else if ((reg.prot & PROT_WRITE)) {
214       xbt_assert(!result->start_rw,
215                  "Multiple read-write segments for %s, not supported",
216                  maps[i].pathname.c_str());
217       result->start_rw = (char*) reg.start_addr;
218       result->end_rw = (char*) reg.end_addr;
219       // .bss is usually after the .data:
220       simgrid::mc::VmMap const& next = maps[i + 1];
221       if (next.pathname.empty() && (next.prot & PROT_WRITE)
222           && next.start_addr == reg.end_addr) {
223         result->end_rw = (char*) maps[i + 1].end_addr;
224       }
225     } else if ((reg.prot & PROT_READ) && (reg.prot & PROT_EXEC)) {
226       xbt_assert(!result->start_exec,
227                  "Multiple executable segments for %s, not supported",
228                  maps[i].pathname.c_str());
229       result->start_exec = (char*) reg.start_addr;
230       result->end_exec = (char*) reg.end_addr;
231     } else if ((reg.prot & PROT_READ) && !(reg.prot & PROT_EXEC)) {
232       xbt_assert(!result->start_ro,
233                  "Multiple read only segments for %s, not supported",
234                  maps[i].pathname.c_str());
235       result->start_ro = (char*) reg.start_addr;
236       result->end_ro = (char*) reg.end_addr;
237     }
238   }
239
240   result->start = result->start_rw;
241   if ((const void*) result->start_ro > result->start)
242     result->start = result->start_ro;
243   if ((const void*) result->start_exec > result->start)
244     result->start = result->start_exec;
245
246   result->end = result->end_rw;
247   if (result->end_ro && (const void*) result->end_ro < result->end)
248     result->end = result->end_ro;
249   if (result->end_exec && (const void*) result->end_exec > result->end)
250     result->end = result->end_exec;
251
252   xbt_assert(result->file_name);
253   xbt_assert(result->start_rw);
254   xbt_assert(result->start_exec);
255 }
256
257 /************************************* Take Snapshot ************************************/
258 /****************************************************************************************/
259
260 /** \brief Checks whether the variable is in scope for a given IP.
261  *
262  *  A variable may be defined only from a given value of IP.
263  *
264  *  \param var   Variable description
265  *  \param frame Scope description
266  *  \param ip    Instruction pointer
267  *  \return      true if the variable is valid
268  * */
269 static bool mc_valid_variable(dw_variable_t var, dw_frame_t scope,
270                               const void *ip)
271 {
272   // The variable is not yet valid:
273   if ((const void *) ((const char *) scope->low_pc + var->start_scope) > ip)
274     return false;
275   else
276     return true;
277 }
278
279 static void mc_fill_local_variables_values(mc_stack_frame_t stack_frame,
280                                            dw_frame_t scope, int process_index,
281                                            std::vector<s_local_variable>& result)
282 {
283   mc_process_t process = &mc_model_checker->process();
284
285   void *ip = (void *) stack_frame->ip;
286   if (ip < scope->low_pc || ip >= scope->high_pc)
287     return;
288
289   unsigned cursor = 0;
290   dw_variable_t current_variable;
291   xbt_dynar_foreach(scope->variables, cursor, current_variable) {
292
293     if (!mc_valid_variable(current_variable, scope, (void *) stack_frame->ip))
294       continue;
295
296     int region_type;
297     // FIXME, get rid of `region_type`
298     if ((long) stack_frame->ip > (long) process->libsimgrid_info->start_exec)
299       region_type = 1;
300     else
301       region_type = 2;
302
303     s_local_variable_t new_var;
304     new_var.subprogram = stack_frame->frame;
305     new_var.ip = stack_frame->ip;
306     new_var.name = current_variable->name;
307     new_var.type = current_variable->type;
308     new_var.region = region_type;
309     new_var.address = nullptr;
310
311     if (current_variable->address != NULL) {
312       new_var.address = current_variable->address;
313     } else if (current_variable->locations.size != 0) {
314       s_mc_location_t location;
315       mc_dwarf_resolve_locations(
316         &location, &current_variable->locations,
317         current_variable->object_info,
318         &(stack_frame->unw_cursor),
319         (void *) stack_frame->frame_base,
320         &mc_model_checker->process(), process_index);
321
322       switch(mc_get_location_type(&location)) {
323       case MC_LOCATION_TYPE_ADDRESS:
324         new_var.address = location.memory_location;
325         break;
326       case MC_LOCATION_TYPE_REGISTER:
327       default:
328         xbt_die("Cannot handle non-address variable");
329       }
330
331     } else {
332       xbt_die("No address");
333     }
334
335     result.push_back(std::move(new_var));
336   }
337
338   // Recursive processing of nested scopes:
339   dw_frame_t nested_scope = NULL;
340   xbt_dynar_foreach(scope->scopes, cursor, nested_scope) {
341     mc_fill_local_variables_values(stack_frame, nested_scope, process_index, result);
342   }
343 }
344
345 static std::vector<s_local_variable> MC_get_local_variables_values(xbt_dynar_t stack_frames, int process_index)
346 {
347
348   unsigned cursor1 = 0;
349   mc_stack_frame_t stack_frame;
350
351   std::vector<s_local_variable> variables;
352   xbt_dynar_foreach(stack_frames, cursor1, stack_frame) {
353     mc_fill_local_variables_values(stack_frame, stack_frame->frame, process_index, variables);
354   }
355   return std::move(variables);
356 }
357
358 static void MC_stack_frame_free_voipd(void *s)
359 {
360   mc_stack_frame_t stack_frame = *(mc_stack_frame_t *) s;
361   delete(stack_frame);
362 }
363
364 static xbt_dynar_t MC_unwind_stack_frames(mc_unw_context_t stack_context)
365 {
366   mc_process_t process = &mc_model_checker->process();
367   xbt_dynar_t result =
368       xbt_dynar_new(sizeof(mc_stack_frame_t), MC_stack_frame_free_voipd);
369
370   unw_cursor_t c;
371
372   // TODO, check condition check (unw_init_local==0 means end of frame)
373   if (mc_unw_init_cursor(&c, stack_context) != 0) {
374
375     xbt_die("Could not initialize stack unwinding");
376
377   } else
378     while (1) {
379
380       mc_stack_frame_t stack_frame = new s_mc_stack_frame_t();
381       xbt_dynar_push(result, &stack_frame);
382
383       stack_frame->unw_cursor = c;
384
385       unw_word_t ip, sp;
386
387       unw_get_reg(&c, UNW_REG_IP, &ip);
388       unw_get_reg(&c, UNW_REG_SP, &sp);
389
390       stack_frame->ip = ip;
391       stack_frame->sp = sp;
392
393       // TODO, use real addresses in frame_t instead of fixing it here
394
395       dw_frame_t frame = process->find_function(remote(ip));
396       stack_frame->frame = frame;
397
398       if (frame) {
399         stack_frame->frame_name = frame->name;
400         stack_frame->frame_base =
401             (unw_word_t) mc_find_frame_base(frame, frame->object_info, &c);
402       } else {
403         stack_frame->frame_base = 0;
404         stack_frame->frame_name = std::string();
405       }
406
407       /* Stop before context switch with maestro */
408       if (frame != NULL && frame->name != NULL
409           && !strcmp(frame->name, "smx_ctx_sysv_wrapper"))
410         break;
411
412       int ret = unw_step(&c);
413       if (ret == 0) {
414         xbt_die("Unexpected end of stack.");
415       } else if (ret < 0) {
416         xbt_die("Error while unwinding stack");
417       }
418     }
419
420   if (xbt_dynar_length(result) == 0) {
421     XBT_INFO("unw_init_local failed");
422     xbt_abort();
423   }
424
425   return result;
426 };
427
428 static std::vector<s_mc_snapshot_stack_t> MC_take_snapshot_stacks(mc_snapshot_t * snapshot)
429 {
430   std::vector<s_mc_snapshot_stack_t> res;
431
432   unsigned int cursor = 0;
433   stack_region_t current_stack;
434
435   // FIXME, cross-process support (stack_areas)
436   xbt_dynar_foreach(stacks_areas, cursor, current_stack) {
437     s_mc_snapshot_stack_t st;
438
439     // Read the context from remote process:
440     unw_context_t context;
441     mc_model_checker->process().read_bytes(
442       &context, sizeof(context), remote(current_stack->context));
443
444     st.context = xbt_new0(s_mc_unw_context_t, 1);
445     if (mc_unw_init_context(st.context, &mc_model_checker->process(),
446       &context) < 0) {
447       xbt_die("Could not initialise the libunwind context.");
448     }
449     st.stack_frames = MC_unwind_stack_frames(st.context);
450     st.local_variables = MC_get_local_variables_values(st.stack_frames, current_stack->process_index);
451     st.process_index = current_stack->process_index;
452
453     unw_word_t sp = xbt_dynar_get_as(st.stack_frames, 0, mc_stack_frame_t)->sp;
454
455     res.push_back(std::move(st));
456
457     size_t stack_size =
458       (char*) current_stack->address + current_stack->size - (char*) sp;
459     (*snapshot)->stack_sizes.push_back(stack_size);
460   }
461
462   return std::move(res);
463
464 }
465
466 static std::vector<s_mc_heap_ignore_region_t> MC_take_snapshot_ignore()
467 {
468   std::vector<s_mc_heap_ignore_region_t> res;
469
470   if (mc_heap_comparison_ignore == NULL)
471     return std::move(res);
472
473   unsigned int cursor = 0;
474   mc_heap_ignore_region_t current_region;
475
476   xbt_dynar_foreach(mc_heap_comparison_ignore, cursor, current_region) {
477     s_mc_heap_ignore_region_t new_region;
478     new_region.address = current_region->address;
479     new_region.size = current_region->size;
480     new_region.block = current_region->block;
481     new_region.fragment = current_region->fragment;
482     res.push_back(std::move(new_region));
483   }
484
485   return std::move(res);
486 }
487
488 static void MC_snapshot_handle_ignore(mc_snapshot_t snapshot)
489 {
490   xbt_assert(snapshot->process);
491   
492   // Copy the memory:
493   for (auto const& region : mc_model_checker->process().ignored_regions()) {
494     s_mc_snapshot_ignored_data_t ignored_data;
495     ignored_data.start = (void*)region.addr;
496     ignored_data.data.resize(region.size);
497     // TODO, we should do this once per privatization segment:
498     snapshot->process->read_bytes(
499       ignored_data.data.data(), region.size, remote(region.addr),
500       simgrid::mc::ProcessIndexDisabled);
501     snapshot->ignored_data.push_back(std::move(ignored_data));
502   }
503
504   // Zero the memory:
505   for(auto const& region : mc_model_checker->process().ignored_regions()) {
506     snapshot->process->clear_bytes(remote(region.addr), region.size);
507   }
508
509 }
510
511 static void MC_snapshot_ignore_restore(mc_snapshot_t snapshot)
512 {
513   for (auto const& ignored_data : snapshot->ignored_data)
514     snapshot->process->write_bytes(
515       ignored_data.data.data(), ignored_data.data.size(),
516       remote(ignored_data.start));
517 }
518
519 static std::vector<s_fd_infos_t> MC_get_current_fds(pid_t pid)
520 {
521   const size_t fd_dir_path_size = 20;
522   char fd_dir_path[fd_dir_path_size];
523   int res = snprintf(fd_dir_path, fd_dir_path_size,
524     "/proc/%lli/fd", (long long int) pid);
525   xbt_assert(res >= 0);
526   if ((size_t) res > fd_dir_path_size)
527     xbt_die("Unexpected buffer is too small for fd_dir_path");
528
529   DIR* fd_dir = opendir(fd_dir_path);
530   if (fd_dir == NULL)
531     xbt_die("Cannot open directory '/proc/self/fd'\n");
532
533   std::vector<s_fd_infos_t> fds;
534
535   struct dirent* fd_number;
536   while ((fd_number = readdir(fd_dir))) {
537
538     int fd_value = atoi(fd_number->d_name);
539
540     if(fd_value < 3)
541       continue;
542
543     const size_t source_size = 25;
544     char source[25];
545     int res = snprintf(source, source_size, "/proc/%lli/fd/%s",
546         (long long int) pid, fd_number->d_name);
547     xbt_assert(res >= 0);
548     if ((size_t) res > source_size)
549       xbt_die("Unexpected buffer is too small for fd %s", fd_number->d_name);
550
551     const size_t link_size = 200;
552     char link[200];
553     res = readlink(source, link, link_size);
554     if (res<0) {
555       xbt_die("Could not read link for %s", source);
556     }
557     if (res==200) {
558       xbt_die("Buffer to small for link of %s", source);
559     }
560     link[res] = '\0';
561
562     if(smpi_is_privatisation_file(link))
563       continue;
564
565     // This is (probably) the DIR* we are reading:
566     // TODO, read all the file entries at once and close the DIR.*
567     if(strcmp(fd_dir_path, link) == 0)
568       continue;
569
570     // We don't handle them.
571     // It does not mean we should silently ignore them however.
572     if (strncmp(link, "pipe:", 5) == 0 || strncmp(link, "socket:", 7) == 0)
573       continue;
574
575     // If dot_output enabled, do not handle the corresponding file
576     if (dot_output !=  NULL && strcmp(basename(link), _sg_mc_dot_output_file) == 0)
577       continue;
578
579     // This is probably a shared memory used by lttng-ust:
580     if(strncmp("/dev/shm/ust-shm-tmp-", link, 21)==0)
581       continue;
582
583     // Add an entry for this FD in the snapshot:
584     s_fd_infos_t fd;
585     fd.filename = std::string(link);
586     fd.number = fd_value;
587     fd.flags = fcntl(fd_value, F_GETFL) | fcntl(fd_value, F_GETFD) ;
588     fd.current_position = lseek(fd_value, 0, SEEK_CUR);
589     fds.push_back(std::move(fd));
590   }
591
592   closedir (fd_dir);
593   return std::move(fds);
594 }
595
596 mc_snapshot_t MC_take_snapshot(int num_state)
597 {
598   XBT_DEBUG("Taking snapshot %i", num_state);
599
600   mc_process_t mc_process = &mc_model_checker->process();
601
602   mc_snapshot_t snapshot = new simgrid::mc::Snapshot();
603
604   snapshot->process = mc_process;
605   snapshot->num_state = num_state;
606
607   smx_process_t process;
608   MC_EACH_SIMIX_PROCESS(process,
609     snapshot->enabled_processes.insert(process->pid));
610
611   MC_snapshot_handle_ignore(snapshot);
612
613   if (_sg_mc_snapshot_fds)
614     snapshot->current_fds = MC_get_current_fds(process->pid);
615
616   /* Save the std heap and the writable mapped pages of libsimgrid and binary */
617   MC_get_memory_regions(mc_process, snapshot);
618
619   snapshot->to_ignore = MC_take_snapshot_ignore();
620
621   if (_sg_mc_visited > 0 || strcmp(_sg_mc_property_file, "")) {
622     snapshot->stacks =
623         MC_take_snapshot_stacks(&snapshot);
624     if (_sg_mc_hash && !snapshot->stacks.empty()) {
625       snapshot->hash = mc_hash_processes_state(num_state, snapshot->stacks);
626     } else {
627       snapshot->hash = 0;
628     }
629   } else {
630     snapshot->hash = 0;
631   }
632
633   MC_snapshot_ignore_restore(snapshot);
634   return snapshot;
635 }
636
637 static inline
638 void MC_restore_snapshot_regions(mc_snapshot_t snapshot)
639 {
640   for(std::unique_ptr<s_mc_mem_region_t> const& region : snapshot->snapshot_regions) {
641     // For privatized, variables we decided it was not necessary to take the snapshot:
642     if (region)
643       MC_region_restore(region.get());
644   }
645
646 #ifdef HAVE_SMPI
647   // TODO, send a message to implement this in the MCed process
648   if(snapshot->privatization_index >= 0) {
649     // We just rewrote the global variables.
650     // The privatisation segment SMPI thinks
651     // is mapped might be inconsistent with the segment which
652     // is really mapped in memory (kernel state).
653     // We ask politely SMPI to map the segment anyway,
654     // even if it thinks it is the current one:
655     smpi_really_switch_data_segment(snapshot->privatization_index);
656   }
657 #endif
658 }
659
660 static inline
661 void MC_restore_snapshot_fds(mc_snapshot_t snapshot)
662 {
663   if (mc_mode == MC_MODE_SERVER)
664     xbt_die("FD snapshot not implemented in client/server mode.");
665
666   for (auto const& fd : snapshot->current_fds) {
667     
668     int new_fd = open(fd.filename.c_str(), fd.flags);
669     if (new_fd < 0) {
670       xbt_die("Could not reopen the file %s fo restoring the file descriptor",
671         fd.filename.c_str());
672     }
673     if (new_fd != fd.number) {
674       dup2(new_fd, fd.number);
675       close(new_fd);
676     };
677     lseek(fd.number, fd.current_position, SEEK_SET);
678   }
679 }
680
681 void MC_restore_snapshot(mc_snapshot_t snapshot)
682 {
683   XBT_DEBUG("Restore snapshot %i", snapshot->num_state);
684   MC_restore_snapshot_regions(snapshot);
685   if (_sg_mc_snapshot_fds)
686     MC_restore_snapshot_fds(snapshot);
687   MC_snapshot_ignore_restore(snapshot);
688   mc_model_checker->process().cache_flags = 0;
689 }
690
691 mc_snapshot_t simcall_HANDLER_mc_snapshot(smx_simcall_t simcall)
692 {
693   return MC_take_snapshot(1);
694 }
695
696 }