SimGrid  3.15
Versatile Simulation of Distributed Systems
mc_snapshot.h File Reference
#include <cstdint>
#include <cstddef>
#include <vector>
#include <set>
#include <string>
#include <memory>
#include <sys/types.h>
#include <simgrid_config.h>
#include "src/xbt/mmalloc/mmprivate.h"
#include <xbt/asserts.h>
#include <xbt/base.h>
#include "src/mc/mc_forward.hpp"
#include "src/mc/ModelChecker.hpp"
#include "src/mc/PageStore.hpp"
#include "src/mc/AddressSpace.hpp"
#include "src/mc/mc_unw.h"
#include "src/mc/RegionSnapshot.hpp"

Classes

struct  s_mc_snapshot_ignored_data
 Ignored data. More...
 
struct  s_fd_infos
 
struct  s_mc_stack_frame
 Information about a given stack frame. More...
 
struct  s_local_variable
 
struct  s_mc_snapshot_stack
 
class  simgrid::mc::Snapshot
 

Namespaces

 simgrid
 Alltoall Bruck.
 
 simgrid::mc
 

Typedefs

typedef struct s_mc_snapshot_ignored_data s_mc_snapshot_ignored_data_t
 Ignored data. More...
 
typedef struct s_mc_snapshot_ignored_datamc_snapshot_ignored_data_t
 
typedef struct s_fd_infos s_fd_infos_t
 
typedef struct s_fd_infosfd_infos_t
 
typedef struct s_mc_stack_frame s_mc_stack_frame_t
 Information about a given stack frame. More...
 
typedef struct s_mc_stack_framemc_stack_frame_t
 
typedef struct s_local_variable s_local_variable_t
 
typedef struct s_local_variablelocal_variable_t
 
typedef struct s_mc_snapshot_stack s_mc_snapshot_stack_t
 
typedef struct s_mc_snapshot_stackmc_snapshot_stack_t
 

Functions

void mc_region_restore_sparse (simgrid::mc::Process *process, mc_mem_region_t reg)
 
static __attribute__ ((always_inline)) const void *MC_region_read(mc_mem_region_t region
 Read memory from a snapshot region. More...
 
 return (char *) snapshot_page+offset
 
else return mc_get_snapshot_region (addr, snapshot, process_index)
 
static const voidmc_snapshot_get_heap_end (simgrid::mc::Snapshot *snapshot)
 
void mc_restore_page_snapshot_region (simgrid::mc::Process *process, void *start_addr, simgrid::mc::ChunkedData const &pagenos)
 Restore a snapshot of a region. More...
 
const voidMC_region_read_fragmented (mc_mem_region_t region, void *target, const void *addr, std::size_t size)
 
int MC_snapshot_region_memcmp (const void *addr1, mc_mem_region_t region1, const void *addr2, mc_mem_region_t region2, std::size_t size)
 
int MC_snapshot_memcmp (const void *addr1, simgrid::mc::Snapshot *snapshot1, const void *addr2, simgrid::mc::Snapshot *snapshot2, int process_index, std::size_t size)
 
 xbt_assert (region->contain(simgrid::mc::remote(addr)), "Trying to read out of the region boundary.")
 
 switch (region->storage_type())
 
return *void ** MC_region_read (region, &res, addr, sizeof(void *))
 

Variables

static mc_mem_region_t region
 
auto pageno = split.first
 
auto offset = split.second
 
const voidsnapshot_page = region->page_data().page(pageno)
 
static mc_mem_region_t int process_index
 
static simgrid::mc::Snapshotsnapshot
 
static voidtarget
 
static void const voidaddr
 
static void const void std::size_t size
 

Typedef Documentation

◆ s_mc_snapshot_ignored_data_t

Ignored data.

Some parts of the snapshot are ignored by zeroing them out: the real values is stored here.

◆ mc_snapshot_ignored_data_t

◆ s_fd_infos_t

typedef struct s_fd_infos s_fd_infos_t

◆ fd_infos_t

typedef struct s_fd_infos * fd_infos_t

◆ s_mc_stack_frame_t

Information about a given stack frame.

◆ mc_stack_frame_t

◆ s_local_variable_t

◆ local_variable_t

◆ s_mc_snapshot_stack_t

◆ mc_snapshot_stack_t

Function Documentation

◆ mc_region_restore_sparse()

void mc_region_restore_sparse ( simgrid::mc::Process process,
mc_mem_region_t  reg 
)

◆ __attribute__()

static __attribute__ ( (always_inline)  ) const
inlinestatic

Read memory from a snapshot region.

Parameters
addrProcess (non-snapshot) address of the data
regionSnapshot memory region where the data is located
targetBuffer to store the value
sizeSize of the data to read in bytes
Returns
Pointer where the data is located (target buffer of original location)

◆ return()

return ( char *  )

◆ mc_get_snapshot_region()

else return mc_get_snapshot_region ( addr  ,
snapshot  ,
process_index   
)

◆ mc_snapshot_get_heap_end()

static const void* mc_snapshot_get_heap_end ( simgrid::mc::Snapshot snapshot)
static

◆ mc_restore_page_snapshot_region()

void mc_restore_page_snapshot_region ( simgrid::mc::Process process,
void start_addr,
simgrid::mc::ChunkedData const &  pages_copy 
)

Restore a snapshot of a region.

If possible, the restoration will be incremental (the modified pages will not be touched).

Parameters
start_addr
page_countNumber of pages of the region
pagenos

◆ MC_region_read_fragmented()

const void* MC_region_read_fragmented ( mc_mem_region_t  region,
void target,
const void addr,
std::size_t  size 
)

◆ MC_snapshot_region_memcmp()

int MC_snapshot_region_memcmp ( const void addr1,
mc_mem_region_t  region1,
const void addr2,
mc_mem_region_t  region2,
std::size_t  size 
)

◆ MC_snapshot_memcmp()

int MC_snapshot_memcmp ( const void addr1,
simgrid::mc::Snapshot snapshot1,
const void addr2,
simgrid::mc::Snapshot snapshot2,
int  process_index,
std::size_t  size 
)

◆ xbt_assert()

xbt_assert ( region->  containsimgrid::mc::remote(addr),
"Trying to read out of the region boundary."   
)
Examples:
examples/msg/actions-comm/actions-comm.c, examples/msg/actions-storage/actions-storage.c, examples/msg/app-masterworker/app-masterworker.c, examples/msg/app-pingpong/app-pingpong.c, examples/msg/app-pmm/app-pmm.c, examples/msg/app-token-ring/app-token-ring.c, examples/msg/async-wait/async-wait.c, examples/msg/async-waitall/async-waitall.c, examples/msg/async-waitany/async-waitany.c, examples/msg/async-yield/async-yield.c, examples/msg/dht-chord/dht-chord.c, examples/msg/network-ns3/network-ns3.c, examples/msg/platform-properties/platform-properties.c, examples/msg/process-create/process-create.c, examples/msg/process-kill/process-kill.c, examples/msg/process-migration/process-migration.c, examples/msg/process-startkilltime/process-startkilltime.c, examples/msg/process-suspend/process-suspend.c, examples/msg/task-priority/task-priority.c, examples/msg/trace-categories/trace-categories.c, examples/msg/trace-host-user-variables/trace-host-user-variables.c, examples/msg/trace-link-user-variables/trace-link-user-variables.c, examples/msg/trace-masterworker/trace-masterworker.c, examples/msg/trace-platform/trace-platform.c, examples/msg/trace-process-migration/trace-process-migration.c, examples/msg/trace-route-user-variables/trace-route-user-variables.c, examples/s4u/actions-comm/s4u_actions-comm.cpp, examples/s4u/actions-storage/s4u_actions-storage.cpp, examples/s4u/actor-migration/s4u_actor-migration.cpp, examples/s4u/actor-suspend/s4u_actor-suspend.cpp, and examples/s4u/app-token-ring/s4u_app-token-ring.cpp.

◆ switch()

switch ( region->  storage_type())

◆ MC_region_read()

return* void** MC_region_read ( region  ,
res,
addr  ,
sizeof(void *)   
)

Variable Documentation

◆ region

Initial value:
{
auto split = simgrid::mc::mmu::split(addr - region->start().address())
static mc_mem_region_t region
Definition: mc_snapshot.h:39
static void const void * addr
Definition: mc_snapshot.h:219

◆ pageno

auto pageno = split.first

◆ offset

std::uintptr_t offset = split.second

◆ snapshot_page

const void* snapshot_page = region->page_data().page(pageno)

◆ process_index

static simgrid::mc::Snapshot int process_index
Initial value:
{
switch (region->storage_type()) {
default:
xbt_die("Storage type not supported");
{
uintptr_t offset = (uintptr_t) addr - (uintptr_t) region->start().address();
return (void *) ((uintptr_t) region->flat_data().get() + offset);
}
return mc_translate_address_region_chunked(addr, region);
{
"Missing process index for privatized region");
xbt_assert((size_t) process_index < region->privatized_data().size(),
"Out of range process index");
simgrid::mc::RegionSnapshot& subregion= region->privatized_data()[process_index];
return mc_translate_address_region(addr, &subregion, process_index);
}
}
}
static void const void std::size_t size
Definition: mc_snapshot.h:220
#define xbt_die(...)
Kill the program with an error message.
Definition: sysdep.h:44
class simgrid::mc::RegionSnapshot * mc_mem_region_t
Definition: RegionSnapshot.hpp:280
xbt_assert(region->contain(simgrid::mc::remote(addr)), "Trying to read out of the region boundary.")
auto offset
Definition: mc_snapshot.h:42
A copy/snapshot of a given memory region.
Definition: RegionSnapshot.hpp:113
static simgrid::mc::Snapshot * snapshot
Definition: mc_snapshot.h:160
static mc_mem_region_t region
Definition: mc_snapshot.h:39
else return mc_get_snapshot_region(addr, snapshot, process_index)
static mc_mem_region_t int process_index
Definition: mc_snapshot.h:49
Definition: mc_snapshot.h:133
static void const void * addr
Definition: mc_snapshot.h:219

◆ snapshot

◆ target

void* target

◆ addr

static const void * addr
Initial value:
{
void* res

◆ size

void const void std::size_t size
Initial value:
{
xbt_assert(region->contain(simgrid::mc::remote(addr)), "Trying to read out of the region boundary.")
static mc_mem_region_t region
Definition: mc_snapshot.h:39