#include "src/mc/mc_mmu.h"
#include "src/mc/mc_unw.h"
#include "src/mc/mc_protocol.h"
#include "src/mc/mc_mmu.h"
#include "src/mc/mc_unw.h"
#include "src/mc/mc_protocol.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_checkpoint, mc,
"Logging specific to mc_checkpoint");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_checkpoint, mc,
"Logging specific to mc_checkpoint");
/************************************ Free functions **************************************/
/*****************************************************************************************/
/************************************ Free functions **************************************/
/*****************************************************************************************/
#ifdef HAVE_SMPI
RegionSnapshot privatized_region(
RegionType region_type, void *start_addr, void* permanent_addr,
#ifdef HAVE_SMPI
RegionSnapshot privatized_region(
RegionType region_type, void *start_addr, void* permanent_addr,
simgrid::mc::RegionType type,
simgrid::mc::ObjectInformation* object_info,
void *start_addr, void* permanent_addr,
simgrid::mc::RegionType type,
simgrid::mc::ObjectInformation* object_info,
void *start_addr, void* permanent_addr,
{
const size_t n = process->object_infos.size();
snapshot->snapshot_regions.resize(n + 1);
int i = 0;
for (auto const& object_info : process->object_infos) {
{
const size_t n = process->object_infos.size();
snapshot->snapshot_regions.resize(n + 1);
int i = 0;
for (auto const& object_info : process->object_infos) {
- MC_snapshot_add_region(i, snapshot, simgrid::mc::RegionType::Data,
+ add_region(i, snapshot, simgrid::mc::RegionType::Data,
object_info.get(),
object_info->start_rw, object_info->start_rw,
object_info->end_rw - object_info->start_rw);
object_info.get(),
object_info->start_rw, object_info->start_rw,
object_info->end_rw - object_info->start_rw);
- MC_snapshot_add_region(n, snapshot, simgrid::mc::RegionType::Heap, NULL,
+ add_region(n, snapshot, simgrid::mc::RegionType::Heap, nullptr,
std::vector<simgrid::xbt::VmMap> const& maps,
simgrid::mc::ObjectInformation* result)
{
char* file_name = xbt_strdup(result->file_name.c_str());
std::vector<simgrid::xbt::VmMap> const& maps,
simgrid::mc::ObjectInformation* result)
{
char* file_name = xbt_strdup(result->file_name.c_str());
for (size_t i = 0; i < maps.size(); ++i) {
simgrid::xbt::VmMap const& reg = maps[i];
if (maps[i].pathname.empty()
for (size_t i = 0; i < maps.size(); ++i) {
simgrid::xbt::VmMap const& reg = maps[i];
if (maps[i].pathname.empty()
// Nothing to do
} else if ((reg.prot & PROT_WRITE)) {
xbt_assert(!result->start_rw,
// Nothing to do
} else if ((reg.prot & PROT_WRITE)) {
xbt_assert(!result->start_rw,
simgrid::mc::Frame* scope,
const void *ip)
{
// The variable is not yet valid:
simgrid::mc::Frame* scope,
const void *ip)
{
// The variable is not yet valid:
simgrid::mc::Frame* scope,
int process_index,
std::vector<s_local_variable>& result)
{
simgrid::mc::Process* process = &mc_model_checker->process();
simgrid::mc::Frame* scope,
int process_index,
std::vector<s_local_variable>& result)
{
simgrid::mc::Process* process = &mc_model_checker->process();
new_var.address = current_variable.address;
} else if (!current_variable.location_list.empty()) {
simgrid::dwarf::Location location =
new_var.address = current_variable.address;
} else if (!current_variable.location_list.empty()) {
simgrid::dwarf::Location location =
stack_frame, &nested_scope, process_index, result);
}
stack_frame, &nested_scope, process_index, result);
}
std::vector<s_mc_stack_frame_t>& stack_frames, int process_index)
{
std::vector<s_local_variable> variables;
for (s_mc_stack_frame_t& stack_frame : stack_frames)
std::vector<s_mc_stack_frame_t>& stack_frames, int process_index)
{
std::vector<s_local_variable> variables;
for (s_mc_stack_frame_t& stack_frame : stack_frames)
- mc_fill_local_variables_values(&stack_frame, stack_frame.frame, process_index, variables);
+ fill_local_variables_values(&stack_frame, stack_frame.frame, process_index, variables);
-static void MC_stack_frame_free_voipd(void *s)
-{
- mc_stack_frame_t stack_frame = *(mc_stack_frame_t *) s;
- delete(stack_frame);
-}
-
-static std::vector<s_mc_stack_frame_t> MC_unwind_stack_frames(mc_unw_context_t stack_context)
+static std::vector<s_mc_stack_frame_t> unwind_stack_frames(mc_unw_context_t stack_context)
{
simgrid::mc::Process* process = &mc_model_checker->process();
std::vector<s_mc_stack_frame_t> result;
{
simgrid::mc::Process* process = &mc_model_checker->process();
std::vector<s_mc_stack_frame_t> result;
- st.stack_frames = MC_unwind_stack_frames(&st.context);
- st.local_variables = MC_get_local_variables_values(st.stack_frames, stack.process_index);
+ st.stack_frames = unwind_stack_frames(&st.context);
+ st.local_variables = get_local_variables_values(st.stack_frames, stack.process_index);
- smx_process_t process;
- MC_EACH_SIMIX_PROCESS(process,
- snapshot->enabled_processes.insert(process->pid));
+ for (auto& p : mc_model_checker->process().simix_processes())
+ snapshot->enabled_processes.insert(p.copy.pid);
const bool use_soft_dirty = _sg_mc_sparse_checkpoint && _sg_mc_soft_dirty;
/* Save the std heap and the writable mapped pages of libsimgrid and binary */
const bool use_soft_dirty = _sg_mc_sparse_checkpoint && _sg_mc_soft_dirty;
/* Save the std heap and the writable mapped pages of libsimgrid and binary */
{
for(std::unique_ptr<s_mc_mem_region_t> const& region : snapshot->snapshot_regions) {
// For privatized, variables we decided it was not necessary to take the snapshot:
if (region)
{
for(std::unique_ptr<s_mc_mem_region_t> const& region : snapshot->snapshot_regions) {
// For privatized, variables we decided it was not necessary to take the snapshot:
if (region)
{
XBT_DEBUG("Restore snapshot %i", snapshot->num_state);
const bool use_soft_dirty = _sg_mc_sparse_checkpoint && _sg_mc_soft_dirty;
{
XBT_DEBUG("Restore snapshot %i", snapshot->num_state);
const bool use_soft_dirty = _sg_mc_sparse_checkpoint && _sg_mc_soft_dirty;