mark_color = white;
XBT_DEBUG("MARK,declare_value %s %s %s", mark_type, mark_value, mark_color);
- value rett(mark_value, mark_color, type);
+ Value rett(mark_value, mark_color, type);
}
/** \ingroup TRACE_mark
}
XBT_DEBUG("MARK %s %s", mark_type, mark_value);
- new NewEvent(MSG_get_clock(), PJ_container_get_root(), type, value::get(mark_value, type));
+ new NewEvent(MSG_get_clock(), PJ_container_get_root(), type, Value::get(mark_value, type));
}
/** \ingroup TRACE_mark
{
container_t container = PJ_container_get(host);
Type* type = PJ_type_get (state, container->type);
- value* val =
- value::get_or_new(value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
+ Value* val =
+ Value::get_or_new(value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
new SetStateEvent(MSG_get_clock(), container, type, val);
}
{
container_t container = PJ_container_get(host);
Type* type = PJ_type_get (state, container->type);
- value* val =
- value::get_or_new(value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
+ Value* val =
+ Value::get_or_new(value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
new PushStateEvent(MSG_get_clock(), container, type, val);
}
}
}
-void LogEntityValue(value* val)
+void LogEntityValue(Value* val)
{
XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineEntityValue);
//print it
}
}
-SetStateEvent::SetStateEvent(double timestamp, container_t container, Type* type, value* val)
+SetStateEvent::SetStateEvent(double timestamp, container_t container, Type* type, Value* val)
{
this->event_type = PAJE_SetState;
this->timestamp = timestamp;
}
}
-PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, value* val, void* extra)
+PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, Value* val, void* extra)
{
this->event_type = PAJE_PushState;
this->timestamp = timestamp;
insert_into_buffer (this);
}
-PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, value* val)
+PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, Value* val)
: PushStateEvent(timestamp, container, type, val, nullptr)
{}
void PushStateEvent::print() {
}
}
-NewEvent::NewEvent(double timestamp, container_t container, Type* type, value* val)
+NewEvent::NewEvent(double timestamp, container_t container, Type* type, Value* val)
{
this->event_type = PAJE_NewEvent;
this->timestamp = timestamp;
void PJ_type_free (type_t type)
{
- value* val;
+ Value* val;
char *value_name;
xbt_dict_cursor_t cursor = nullptr;
xbt_dict_foreach (type->values, cursor, value_name, val) {
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)");
-value::value(const char* name, const char* color, Type* father)
+Value::Value(const char* name, const char* color, Type* father)
{
if (name == nullptr || father == nullptr){
THROWF (tracing_error, 0, "can't create a value with a nullptr name (or a nullptr father)");
}
- this->ret = xbt_new0(value, 1);
+ this->ret = xbt_new0(Value, 1);
this->ret->name = xbt_strdup (name);
this->ret->father = father;
this->ret->color = xbt_strdup (color);
LogEntityValue(this->ret);
};
-value::~value()
+Value::~Value()
{
/* FIXME: this should be cleanable
xbt_free(name);
*/
}
-value* value::get_or_new(const char* name, const char* color, Type* father)
+Value* Value::get_or_new(const char* name, const char* color, Type* father)
{
- value* ret = 0;
+ Value* ret = 0;
try {
- ret = value::get(name, father);
+ ret = Value::get(name, father);
}
catch(xbt_ex& e) {
- value rett(name, color, father);
+ Value rett(name, color, father);
ret = rett.ret;
}
return ret;
}
-value* value::get(const char* name, Type* father)
+Value* Value::get(const char* name, Type* father)
{
if (name == nullptr || father == nullptr){
THROWF (tracing_error, 0, "can't get a value with a nullptr name (or a nullptr father)");
if (father->kind == TYPE_VARIABLE)
THROWF(tracing_error, 0, "variables can't have different values (%s)", father->name);
- value* ret = (value*)xbt_dict_get_or_null(father->values, name);
+ Value* ret = (Value*)xbt_dict_get_or_null(father->values, name);
if (ret == nullptr) {
THROWF(tracing_error, 2, "value with name (%s) not found in father type (%s)", name, father->name);
}
};
//--------------------------------------------------
-class value {
+class Value {
public:
char* id;
char* name;
char* color;
type_t father;
- value* ret;
- value(const char* name, const char* color, type_t father);
- ~value();
- static value* get_or_new(const char* name, const char* color, type_t father);
- static value* get(const char* name, type_t father);
+ Value* ret;
+ Value(const char* name, const char* color, type_t father);
+ ~Value();
+ static Value* get_or_new(const char* name, const char* color, type_t father);
+ static Value* get(const char* name, type_t father);
};
private:
container_t container;
type_t type;
- value* val;
+ Value* val;
const char* filename;
int linenumber;
public:
- SetStateEvent(double timestamp, container_t container, type_t type, value* val);
+ SetStateEvent(double timestamp, container_t container, type_t type, Value* val);
void print() override;
};
public:
container_t container;
type_t type;
- value* val;
+ Value* val;
int size;
const char* filename;
int linenumber;
void* extra_;
public:
- PushStateEvent(double timestamp, container_t container, type_t type, value* val);
- PushStateEvent(double timestamp, container_t container, type_t type, value* val, void* extra);
+ PushStateEvent(double timestamp, container_t container, type_t type, Value* val);
+ PushStateEvent(double timestamp, container_t container, type_t type, Value* val, void* extra);
void print() override;
};
public:
container_t container;
type_t type;
- value* val;
+ Value* val;
public:
- NewEvent(double timestamp, container_t container, type_t type, value* val);
+ NewEvent(double timestamp, container_t container, type_t type, Value* val);
void print() override;
};
void LogVariableTypeDefinition(type_t type);
void LogStateTypeDefinition(type_t type);
void LogLinkTypeDefinition(type_t type, type_t source, type_t dest);
-void LogEntityValue(value* val);
+void LogEntityValue(Value* val);
void LogContainerCreation (container_t container);
void LogContainerDestruction (container_t container);
void LogDefineEventType(type_t type);
container_t process_container = PJ_container_get (instr_process_id(process, str, len));
Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- value* val = value::get("suspend", type);
+ Value* val = Value::get("suspend", type);
new PushStateEvent(MSG_get_clock(), process_container, type, val);
}
}
container_t process_container = PJ_container_get (instr_process_id(process, str, len));
Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- value* val = value::get("sleep", type);
+ Value* val = Value::get("sleep", type);
new PushStateEvent(MSG_get_clock(), process_container, type, val);
}
}
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- value* val = value::get("task_execute", type);
+ Value* val = Value::get("task_execute", type);
new PushStateEvent(MSG_get_clock(), process_container, type, val);
}
}
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- value* val = value::get("receive", type);
+ Value* val = Value::get("receive", type);
new PushStateEvent(MSG_get_clock(), process_container, type, val);
}
}
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- value* val = value::get("send", type);
+ Value* val = Value::get("send", type);
new PushStateEvent(MSG_get_clock(), process_container, type, val);
char key[INSTR_DEFAULT_STR_SIZE];
if (TRACE_msg_vm_is_enabled()) {
container_t vm_container = PJ_container_get(vm->getCname());
Type* type = PJ_type_get("MSG_VM_STATE", vm_container->type);
- value* val = value::get_or_new("start", "0 0 1", type); // start is blue
+ Value* val = Value::get_or_new("start", "0 0 1", type); // start is blue
new PushStateEvent(MSG_get_clock(), vm_container, type, val);
}
}
if (TRACE_msg_vm_is_enabled()) {
container_t vm_container = PJ_container_get(vm->getCname());
Type* type = PJ_type_get("MSG_VM_STATE", vm_container->type);
- value* val = value::get_or_new("suspend", "1 0 0", type); // suspend is red
+ Value* val = Value::get_or_new("suspend", "1 0 0", type); // suspend is red
new PushStateEvent(MSG_get_clock(), vm_container, type, val);
}
}
#define TRACE_AUTO_COLL(cat) \
if (TRACE_is_enabled()) { \
- Type* type = Type::getOrNull(#cat, PJ_type_get_root()); \
+ Type* type = Type::getOrNull(#cat, PJ_type_get_root()); \
if (not type) { \
- type = Type::eventNew(#cat, PJ_type_get_root()); \
+ type = Type::eventNew(#cat, PJ_type_get_root()); \
} \
char cont_name[25]; \
snprintf(cont_name, 25, "rank-%d", smpi_process()->index()); \
- value* val = value::get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type); \
+ Value* val = Value::get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type); \
new NewEvent(SIMIX_get_clock(), PJ_container_get(cont_name), type, val); \
}
container_t container = PJ_container_get (str);
Type* type = PJ_type_get ("MPI_STATE", container->type);
const char *color = instr_find_color (operation);
- value* val = value::get_or_new(operation, color, type);
+ Value* val = Value::get_or_new(operation, color, type);
new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
}
container_t container = PJ_container_get(str);
Type* type = PJ_type_get("MPI_STATE", container->type);
const char* color = instr_find_color("computing");
- new PushStateEvent(SIMIX_get_clock(), container, type, value::get_or_new("computing", color, type));
+ new PushStateEvent(SIMIX_get_clock(), container, type, Value::get_or_new("computing", color, type));
}
void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
Type* type = PJ_type_get ("MPI_STATE", container->type);
- value* val = value::get_or_new("computing", nullptr, type);
+ Value* val = Value::get_or_new("computing", nullptr, type);
new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
}
container_t container = PJ_container_get (str);
Type* type = PJ_type_get ("MPI_STATE", container->type);
const char *color = instr_find_color ("sleeping");
- value* val = value::get_or_new("sleeping", color, type);
+ Value* val = Value::get_or_new("sleeping", color, type);
new PushStateEvent(SIMIX_get_clock(), container, type, val);
}
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
Type* type = PJ_type_get ("MPI_STATE", container->type);
- value* val = value::get_or_new("sleeping", nullptr, type);
+ Value* val = Value::get_or_new("sleeping", nullptr, type);
new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
}
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
Type* type = PJ_type_get ("MPI_STATE", container->type);
- value* val = value::get_or_new("test", nullptr, type);
+ Value* val = Value::get_or_new("test", nullptr, type);
new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
}
container_t container = PJ_container_get (str);
Type* type = PJ_type_get ("MPI_STATE", container->type);
const char *color = instr_find_color (operation);
- value* val = value::get_or_new(operation, color, type);
+ Value* val = Value::get_or_new(operation, color, type);
new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
}
if (msg_process == nullptr){
msg_process = Type::containerNew("MSG_PROCESS", container->type);
Type* state = Type::stateNew ("MSG_PROCESS_STATE", msg_process);
- value PJ_value("suspend", "1 0 1", state);
- value::get_or_new("sleep", "1 1 0", state);
- value::get_or_new("receive", "1 0 0", state);
- value::get_or_new("send", "0 0 1", state);
- value::get_or_new("task_execute", "0 1 1", state);
+ Value PJ_value("suspend", "1 0 1", state);
+ Value::get_or_new("sleep", "1 1 0", state);
+ Value::get_or_new("receive", "1 0 0", state);
+ Value::get_or_new("send", "0 0 1", state);
+ Value::get_or_new("task_execute", "0 1 1", state);
Type::linkNew ("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process);
Type::linkNew ("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process);
}
if (msg_vm == nullptr){
msg_vm = Type::containerNew("MSG_VM", container->type);
Type* state = Type::stateNew ("MSG_VM_STATE", msg_vm);
- value PJ_value("suspend", "1 0 1", state);
- value::get_or_new("sleep", "1 1 0", state);
- value::get_or_new("receive", "1 0 0", state);
- value::get_or_new("send", "0 0 1", state);
- value::get_or_new("task_execute", "0 1 1", state);
+ Value PJ_value("suspend", "1 0 1", state);
+ Value::get_or_new("sleep", "1 1 0", state);
+ Value::get_or_new("receive", "1 0 0", state);
+ Value::get_or_new("send", "0 0 1", state);
+ Value::get_or_new("task_execute", "0 1 1", state);
Type::linkNew ("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm);
Type::linkNew ("MSG_VM_PROCESS_LINK", PJ_type_get_root(), msg_vm, msg_vm);
}
static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color, Type* root)
{
if (not strcmp(root->name, type_name)) {
- value PJ_value(val, color, root);
+ Value PJ_value(val, color, root);
}
xbt_dict_cursor_t cursor = nullptr;
Type* child_type;