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
[mc] Move the stack as field of SafetyChecker and CommDetChecker
[simgrid.git]
/
src
/
mc
/
mc_record.h
diff --git
a/src/mc/mc_record.h
b/src/mc/mc_record.h
index
94f6040
..
2c55598
100644
(file)
--- a/
src/mc/mc_record.h
+++ b/
src/mc/mc_record.h
@@
-17,18
+17,15
@@
#ifndef SIMGRID_MC_RECORD_H
#define SIMGRID_MC_RECORD_H
#ifndef SIMGRID_MC_RECORD_H
#define SIMGRID_MC_RECORD_H
-#include <xbt/base.h>
-
-SG_BEGIN_DECL()
+#include <string>
+#include <vector>
-/** Whether the MC record mode is enabled
- *
- * The behaviour is not changed. The only real difference is that
- * the path is writtent in the log when an interesting path is found.
- */
-#define MC_record_is_active() _sg_do_model_check_record
+#include <xbt/base.h>
+#include <xbt/dynar.h>
+#include <xbt/fifo.h>
-// **** Data conversion
+namespace simgrid {
+namespace mc {
/** An element in the recorded path
*
/** An element in the recorded path
*
@@
-38,43
+35,45
@@
SG_BEGIN_DECL()
* in things like waitany and for associating a given value of MC_random()
* calls.
*/
* in things like waitany and for associating a given value of MC_random()
* calls.
*/
-typedef struct s_mc_record_item {
- int pid;
- int value;
-} s_mc_record_item_t, *mc_record_item_t;
+struct RecordTraceElement {
+ int pid = 0;
+ int value = 0;
+ RecordTraceElement() {}
+ RecordTraceElement(int pid, int value) : pid(pid), value(value) {}
+};
+
+typedef std::vector<RecordTraceElement> RecordTrace;
-/** Convert a string representation of the path into a array of `s
_mc_record_item_
t`
+/** Convert a string representation of the path into a array of `s
imgrid::mc::RecordTraceElemen
t`
*/
*/
-XBT_PRIVATE xbt_dynar_t MC_record_from_string(const char* data);
+XBT_PRIVATE RecordTrace parseRecordTrace(const char* data);
+XBT_PRIVATE std::string traceToString(simgrid::mc::RecordTrace const& trace);
+XBT_PRIVATE void dumpRecordPath();
-/** Generate a string representation
-*
-* The current format is a ";"-delimited list of pairs:
-* "pid0,value0;pid2,value2;pid3,value3". The value can be
-* omitted is it is null.
-*/
-XBT_PRIVATE char* MC_record_stack_to_string(xbt_fifo_t stack);
+XBT_PRIVATE void replay(RecordTrace const& trace);
+XBT_PRIVATE void replay(const char* trace);
-/** Dump the path represented by a given stack in the log
- */
-XBT_PRIVATE void MC_record_dump_path(xbt_fifo_t stack);
+}
+}
-// ***** Replay
+SG_BEGIN_DECL()
-/**
Replay a path represented by the record items
+/**
Whether the MC record mode is enabled
*
*
- *
\param start Array of record item
- *
\item count Number of record items
+ *
The behaviour is not changed. The only real difference is that
+ *
the path is writtent in the log when an interesting path is found.
*/
*/
-XBT_PRIVATE void MC_record_replay(mc_record_item_t start, size_t count);
+#define MC_record_is_active() _sg_do_model_check_record
-/** Replay a path represented by a string
- *
- * \param data String representation of the path
- */
-XBT_PRIVATE void MC_record_replay_from_string(const char* data);
+// **** Data conversion
-XBT_PRIVATE void MC_record_replay_init(void);
+/** Generate a string representation
+*
+* The current format is a ";"-delimited list of pairs:
+* "pid0,value0;pid2,value2;pid3,value3". The value can be
+* omitted is it is null.
+*/
+XBT_PRIVATE char* MC_record_stack_to_string(xbt_fifo_t stack);
SG_END_DECL()
SG_END_DECL()