#include "datarace.h"
#include "threads-model.h"
#include "output.h"
+#include "traceanalysis.h"
#define INITIAL_THREAD_ID 0
thrd_last_action(new SnapVector<ModelAction *>(1)),
thrd_last_fence_release(new SnapVector<ModelAction *>()),
node_stack(new NodeStack()),
+ trace_analyses(new ModelVector<Trace_Analysis *>()),
priv(new struct model_snapshot_members()),
mo_graph(new CycleGraph())
{
delete thrd_last_action;
delete thrd_last_fence_release;
delete node_stack;
+ for (unsigned int i = 0; i <trace_analyses->size();i++)
+ delete (*trace_analyses)[i];
+ delete trace_analyses;
delete scheduler;
delete mo_graph;
delete priv;
assert_bug("Deadlock detected");
checkDataRaces();
+ run_trace_analyses();
}
record_stats();
return true;
}
+/**
+ * @brief Run trace analyses on complete trace. */
+
+void ModelChecker::run_trace_analyses() {
+ for(unsigned int i=0; i < trace_analyses->size(); i++) {
+ (*trace_analyses)[i]->analyze(action_trace);
+ }
+}
+
/**
* @brief Find the last fence-related backtracking conflict for a ModelAction
*
class Scheduler;
class Thread;
class ClockVector;
+class Trace_Analysis;
struct model_snapshot_members;
/** @brief Shorthand for a list of release sequence heads */
SnapVector<ModelAction *> * const thrd_last_action;
SnapVector<ModelAction *> * const thrd_last_fence_release;
NodeStack * const node_stack;
+ ModelVector<Trace_Analysis *> * trace_analyses;
+
/** Private data members that should be snapshotted. They are grouped
* together for efficiency and maintainability. */
/** @brief The cumulative execution stats */
struct execution_stats stats;
void record_stats();
-
+ void run_trace_analyses();
void print_infeasibility(const char *prefix) const;
bool is_feasible_prefix_ignore_relseq() const;
bool is_infeasible() const;
--- /dev/null
+#ifndef TRACE_ANALYSIS_H
+#define TRACE_ANALYSIS_H
+#include "model.h"
+
+class Trace_Analysis {
+ public:
+ virtual void analyze(action_list_t *);
+};
+#endif