]> AND Public Git Repository - simgrid.git/blobdiff - src/mc/sosp/Snapshot.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow to disable the TCP windowing modeling by setting network/TCP-gamma to 0
[simgrid.git] / src / mc / sosp / Snapshot.hpp
index 412c7b998c723203b41485d255136ca3ffba2298..4a64390540e572540f9101f6f9a2a3f25ccc5f14 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -15,9 +15,8 @@
 
 /** Ignored data
  *
- *  Some parts of the snapshot are ignored by zeroing them out: the real
- *  values is stored here.
- * */
+ *  Some parts of the snapshot are ignored by zeroing them out: the real values is stored here.
+ */
 struct s_mc_snapshot_ignored_data_t {
   void* start;
   std::vector<char> data;
@@ -56,6 +55,8 @@ using const_mc_snapshot_stack_t = const s_mc_snapshot_stack_t*;
 
 namespace simgrid::mc {
 
+using hash_type = std::uint64_t;
+
 class XBT_PRIVATE Snapshot final : public AddressSpace {
 public:
   /* Initialization */
@@ -74,11 +75,13 @@ public:
   Region* get_region(const void* addr, Region* hinted_region) const;
   void restore(RemoteProcess* process) const;
 
+  bool operator==(const Snapshot& other);
+  bool operator!=(const Snapshot& other) { return not(*this == other); }
+
   // To be private
   long num_state_;
   std::size_t heap_bytes_used_ = 0;
   std::vector<std::unique_ptr<Region>> snapshot_regions_;
-  std::set<pid_t> enabled_processes_;
   std::vector<std::size_t> stack_sizes_;
   std::vector<s_mc_snapshot_stack_t> stacks_;
   std::vector<simgrid::mc::IgnoredHeapRegion> to_ignore_;
@@ -89,6 +92,9 @@ private:
   void add_region(RegionType type, ObjectInformation* object_info, void* start_addr, std::size_t size);
   void snapshot_regions(RemoteProcess* process);
   void snapshot_stacks(RemoteProcess* process);
+  void handle_ignore();
+  void ignore_restore() const;
+  hash_type do_hash() const;
 };
 } // namespace simgrid::mc