nodestack.o clockvector.o main.o snapshot-interface.o cyclegraph.o \
datarace.o impatomic.o cmodelint.o \
snapshot.o malloc.o mymemory.o common.o mutex.o promise.o conditionvariable.o \
- context.o scanalysis.o execution.o plugins.o
+ context.o scanalysis.o execution.o plugins.o libannotate.o
CPPFLAGS += -Iinclude -I.
LDFLAGS := -ldl -lrt -rdynamic
return type == ATOMIC_INIT;
}
+bool ModelAction::is_annotation() const
+{
+ return type == ATOMIC_ANNOTATION;
+}
+
bool ModelAction::is_relaxed() const
{
return order == std::memory_order_relaxed;
case ATOMIC_TRYLOCK: return "trylock";
case ATOMIC_WAIT: return "wait";
case ATOMIC_NOTIFY_ONE: return "notify one";
- case ATOMIC_NOTIFY_ALL: return "notify all";
+ case ATOMIC_NOTIFY_ALL: return "notify all";
+ case ATOMIC_ANNOTATION: return "atomic annotation";
default: return "unknown type";
};
}
ATOMIC_UNLOCK, /**< An unlock action */
ATOMIC_NOTIFY_ONE, /**< A notify_one action */
ATOMIC_NOTIFY_ALL, /**< A notify all action */
- ATOMIC_WAIT /**< A wait action */
+ ATOMIC_WAIT, /**< A wait action */
+ ATOMIC_ANNOTATION /**< An annotation action to pass information
+ to a trace analysis */
} action_type_t;
/* Forward declaration */
bool is_rmw() const;
bool is_fence() const;
bool is_initialization() const;
+ bool is_annotation() const;
bool is_relaxed() const;
bool is_acquire() const;
bool is_release() const;
--- /dev/null
+#ifndef CDS_ANNOTATE_H
+#define CDS_ANNOTATE_H
+#include <stdint.h>
+
+void cdsannotate(uint64_t analysistype, void *annotation);
+
+#endif
--- /dev/null
+#include <cdsannotate.h>
+#include "common.h"
+#include "action.h"
+#include "model.h"
+
+/** Pass in an annotation that a trace analysis will use. The
+ * analysis type is a unique number that specifies which trace
+ * analysis needs the annotation. The reference is to a data
+ * structure that the trace understands. */
+
+void cdsannotate(uint64_t analysistype, void *annotation) {
+ /* seq_cst is just a 'don't care' parameter */
+ model->switch_to_master(new ModelAction(ATOMIC_ANNOTATION, std::memory_order_seq_cst, annotation, analysistype));
+}