A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
useless cosmetics around NS3 long routes
[simgrid.git]
/
src
/
mc
/
mc_checkpoint.cpp
diff --git
a/src/mc/mc_checkpoint.cpp
b/src/mc/mc_checkpoint.cpp
index
04f995e
..
84cdfd8
100644
(file)
--- a/
src/mc/mc_checkpoint.cpp
+++ b/
src/mc/mc_checkpoint.cpp
@@
-17,10
+17,9
@@
#include "src/internal_config.h"
#include "src/mc/mc_private.h"
#include "src/internal_config.h"
#include "src/mc/mc_private.h"
-#include "xbt/module.h"
-#include <xbt/mmalloc.h>
-#include <xbt/memory.hpp>
#include "src/smpi/private.h"
#include "src/smpi/private.h"
+#include "xbt/mmalloc.h"
+#include "xbt/module.h"
#include "src/xbt/mmalloc/mmprivate.h"
#include "src/xbt/mmalloc/mmprivate.h"
@@
-32,12
+31,12
@@
#include "src/mc/mc_private.h"
#include <mc/mc.h>
#include "src/mc/mc_private.h"
#include <mc/mc.h>
-#include "src/mc/mc_
snapshot.h
"
+#include "src/mc/mc_
hash.hpp
"
#include "src/mc/mc_mmu.h"
#include "src/mc/mc_mmu.h"
-#include "src/mc/mc_unw.h"
-#include "src/mc/mc_protocol.h"
#include "src/mc/mc_smx.h"
#include "src/mc/mc_smx.h"
-#include "mc_hash.hpp"
+#include "src/mc/mc_snapshot.h"
+#include "src/mc/mc_unw.h"
+#include "src/mc/remote/mc_protocol.h"
#include "src/mc/RegionSnapshot.hpp"
#include "src/mc/ObjectInformation.hpp"
#include "src/mc/RegionSnapshot.hpp"
#include "src/mc/ObjectInformation.hpp"
@@
-46,8
+45,7
@@
using simgrid::mc::remote;
using simgrid::mc::remote;
-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");
namespace simgrid {
namespace mc {
namespace simgrid {
namespace mc {
@@
-57,7
+55,7
@@
namespace mc {
/** @brief Restore a region from a snapshot
*
/** @brief Restore a region from a snapshot
*
- * @param reg Target region
+ * @param reg
ion
Target region
*/
static void restore(mc_mem_region_t region)
{
*/
static void restore(mc_mem_region_t region)
{
@@
-246,13
+244,13
@@
void find_object_address(
}
result->start = result->start_rw;
}
result->start = result->start_rw;
- if ((const void*) result->start_ro
>
result->start)
+ if ((const void*) result->start_ro
<
result->start)
result->start = result->start_ro;
result->start = result->start_ro;
- if ((const void*) result->start_exec
>
result->start)
+ if ((const void*) result->start_exec
<
result->start)
result->start = result->start_exec;
result->end = result->end_rw;
result->start = result->start_exec;
result->end = result->end_rw;
- if (result->end_ro && (const void*) result->end_ro
<
result->end)
+ if (result->end_ro && (const void*) result->end_ro
>
result->end)
result->end = result->end_ro;
if (result->end_exec && (const void*) result->end_exec > result->end)
result->end = result->end_exec;
result->end = result->end_ro;
if (result->end_exec && (const void*) result->end_exec > result->end)
result->end = result->end_exec;
@@
-270,7
+268,7
@@
void find_object_address(
* A variable may be defined only from a given value of IP.
*
* \param var Variable description
* A variable may be defined only from a given value of IP.
*
* \param var Variable description
- * \param
fram
e Scope description
+ * \param
scop
e Scope description
* \param ip Instruction pointer
* \return true if the variable is valid
* */
* \param ip Instruction pointer
* \return true if the variable is valid
* */
@@
-292,7
+290,7
@@
static void fill_local_variables_values(mc_stack_frame_t stack_frame,
{
simgrid::mc::Process* process = &mc_model_checker->process();
{
simgrid::mc::Process* process = &mc_model_checker->process();
- if (!scope->range.contain(stack_frame->ip))
+ if (!scope
|| !scope
->range.contain(stack_frame->ip))
return;
for(simgrid::mc::Variable& current_variable :
return;
for(simgrid::mc::Variable& current_variable :
@@
-367,7
+365,8
@@
static std::vector<s_mc_stack_frame_t> unwind_stack_frames(simgrid::mc::UnwindCo
stack_frame.unw_cursor = c;
stack_frame.unw_cursor = c;
- unw_word_t ip, sp;
+ unw_word_t ip;
+ unw_word_t sp;
unw_get_reg(&c, UNW_REG_IP, &ip);
unw_get_reg(&c, UNW_REG_SP, &sp);
unw_get_reg(&c, UNW_REG_IP, &ip);
unw_get_reg(&c, UNW_REG_SP, &sp);
@@
-527,7
+526,7
@@
static std::vector<s_fd_infos_t> get_current_fds(pid_t pid)
// We don't handle them.
// It does not mean we should silently ignore them however.
// We don't handle them.
// It does not mean we should silently ignore them however.
- if (strncmp(link, "pipe:",
5) == 0 || strncmp(link, "socket:", 7
) == 0)
+ if (strncmp(link, "pipe:",
std::strlen("pipe:")) == 0 || strncmp(link, "socket:", std::strlen("socket:")
) == 0)
continue;
// If dot_output enabled, do not handle the corresponding file
continue;
// If dot_output enabled, do not handle the corresponding file
@@
-541,7
+540,7
@@
static std::vector<s_fd_infos_t> get_current_fds(pid_t pid)
}
// This is probably a shared memory used by lttng-ust:
}
// This is probably a shared memory used by lttng-ust:
- if(strncmp("/dev/shm/ust-shm-tmp-", link,
21
)==0)
+ if(strncmp("/dev/shm/ust-shm-tmp-", link,
std::strlen("/dev/shm/ust-shm-tmp-")
)==0)
continue;
// Add an entry for this FD in the snapshot:
continue;
// Add an entry for this FD in the snapshot:
@@
-563,13
+562,10
@@
std::shared_ptr<simgrid::mc::Snapshot> take_snapshot(int num_state)
simgrid::mc::Process* mc_process = &mc_model_checker->process();
simgrid::mc::Process* mc_process = &mc_model_checker->process();
- std::shared_ptr<simgrid::mc::Snapshot> snapshot =
- std::make_shared<simgrid::mc::Snapshot>(mc_process);
-
- snapshot->num_state = num_state;
+ std::shared_ptr<simgrid::mc::Snapshot> snapshot = std::make_shared<simgrid::mc::Snapshot>(mc_process, num_state);
- for (auto& p : mc_model_checker->process().
simix_processe
s())
- snapshot->enabled_processes.insert(p.copy.pid);
+ for (auto& p : mc_model_checker->process().
actor
s())
+ snapshot->enabled_processes.insert(p.copy.
getBuffer()->
pid);
snapshot_handle_ignore(snapshot.get());
snapshot_handle_ignore(snapshot.get());
@@
-581,7
+577,7
@@
std::shared_ptr<simgrid::mc::Snapshot> take_snapshot(int num_state)
snapshot->to_ignore = mc_model_checker->process().ignored_heap();
snapshot->to_ignore = mc_model_checker->process().ignored_heap();
- if (_sg_mc_
visited
> 0 || strcmp(_sg_mc_property_file, "")) {
+ if (_sg_mc_
max_visited_states
> 0 || strcmp(_sg_mc_property_file, "")) {
snapshot->stacks = take_snapshot_stacks(snapshot.get());
if (_sg_mc_hash)
snapshot->hash = simgrid::mc::hash(*snapshot);
snapshot->stacks = take_snapshot_stacks(snapshot.get());
if (_sg_mc_hash)
snapshot->hash = simgrid::mc::hash(*snapshot);
@@
-618,8
+614,7
@@
void restore_snapshot_regions(simgrid::mc::Snapshot* snapshot)
static inline
void restore_snapshot_fds(simgrid::mc::Snapshot* snapshot)
{
static inline
void restore_snapshot_fds(simgrid::mc::Snapshot* snapshot)
{
- if (mc_mode == MC_MODE_SERVER)
- xbt_die("FD snapshot not implemented in client/server mode.");
+ xbt_die("FD snapshot not implemented in client/server mode.");
for (auto const& fd : snapshot->current_fds) {
for (auto const& fd : snapshot->current_fds) {