#include "mc_object_info.h"
#include "mc_mmu.h"
#include "mc_unw.h"
+#include "mc_protocol.h"
+#include "mc_smx.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_checkpoint, mc,
"Logging specific to mc_checkpoint");
if (strncmp(link, "pipe:", 5) == 0 || strncmp(link, "socket:", 7) == 0)
continue;
+ // If dot_output enabled, do not handle the corresponding file
+ if (dot_output != NULL && strcmp(basename(link), _sg_mc_dot_output_file) == 0)
+ continue;
+
// This is probably a shared memory used by lttng-ust:
if(strncmp("/dev/shm/ust-shm-tmp-", link, 21)==0)
continue;
snapshot->address_space.address_space_class = &mc_snapshot_class;
snapshot->enabled_processes = xbt_dynar_new(sizeof(int), NULL);
+
smx_process_t process;
- // FIXME, cross-process support (simix_global->process_list)
- xbt_swag_foreach(process, simix_global->process_list) {
- xbt_dynar_push_as(snapshot->enabled_processes, int, (int)process->pid);
- }
+ MC_EACH_SIMIX_PROCESS(process,
+ xbt_dynar_push_as(snapshot->enabled_processes, int, (int)process->pid));
MC_snapshot_handle_ignore(snapshot);
- MC_get_current_fd(snapshot);
+ if (_sg_mc_snapshot_fds)
+ MC_get_current_fd(snapshot);
const bool use_soft_dirty = _sg_mc_sparse_checkpoint
&& _sg_mc_soft_dirty
#endif
}
-// FIXME, cross-process support ~ we need to implement this on the app side
-// or use some form of [remote syscall execution](http://criu.org/Remote_syscall_execution)
-// based on [parasite code execution](http://criu.org/Parasite_code).
static inline
void MC_restore_snapshot_fds(mc_snapshot_t snapshot)
{
+ if (mc_mode == MC_MODE_SERVER)
+ xbt_die("FD snapshot not implemented in client/server mode.");
+
int new_fd;
size_t i;
for(i=0; i < snapshot->total_fd; i++){
&& MC_process_is_self(&mc_model_checker->process);
MC_restore_snapshot_regions(snapshot);
- MC_restore_snapshot_fds(snapshot);
+ if (_sg_mc_snapshot_fds)
+ MC_restore_snapshot_fds(snapshot);
if (use_soft_dirty) {
mc_softdirty_reset();
}
{
return MC_take_snapshot(1);
}
-
-void *MC_snapshot(void)
-{
- return simcall_mc_snapshot();
-}