From: Takishipp Date: Fri, 21 Jul 2017 10:34:32 +0000 (+0200) Subject: fix conflict X-Git-Tag: v3_17~322^2~4^2^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1366b293e8c700b12567e45076cf0e6b7a25478f?hp=4604ddad802d0245e7b97daa20a646f81e56aecc fix conflict --- diff --git a/src/instr/instr_interface.cpp b/src/instr/instr_interface.cpp index 76a78e66a5..dfe6eb196e 100644 --- a/src/instr/instr_interface.cpp +++ b/src/instr/instr_interface.cpp @@ -196,7 +196,7 @@ void TRACE_declare_mark_value_with_color (const char *mark_type, const char *mar mark_color = white; XBT_DEBUG("MARK,declare_value %s %s %s", mark_type, mark_value, mark_color); - pj_value.PJ_value_new (mark_value, mark_color, type); + s_val rett(mark_value, mark_color, type); } /** \ingroup TRACE_mark diff --git a/src/instr/instr_paje_values.cpp b/src/instr/instr_paje_values.cpp index 587a076821..9e60ab1db3 100644 --- a/src/instr/instr_paje_values.cpp +++ b/src/instr/instr_paje_values.cpp @@ -10,26 +10,40 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)"); -val_t paje_value :: PJ_value_new (const char *name, const char *color, type_t father) +val_t s_val::PJ_value_update (const char *name, const char *color, type_t father) { + this->ret = xbt_new0(s_val, 1); + this->ret->name = xbt_strdup (name); + this->ret->father = father; + this->ret->color = xbt_strdup (color); + + char str_id[INSTR_DEFAULT_STR_SIZE]; + snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", instr_new_paje_id()); + this->ret->id = xbt_strdup (str_id); + + xbt_dict_set (father->values, name, ret, nullptr); + XBT_DEBUG("new value %s, child of %s", this->ret->name, this->ret->father->name); + LogEntityValue(this->ret); + return this->ret; +} + +s_val::s_val(const char *name, const char *color, type_t father){ if (name == nullptr || father == nullptr){ THROWF (tracing_error, 0, "can't create a value with a nullptr name (or a nullptr father)"); } - - val_t ret = xbt_new0(s_val_t, 1); - ret->name = xbt_strdup (name); - ret->father = father; - ret->color = xbt_strdup (color); + this->ret = xbt_new0(s_val, 1); + this->ret->name = xbt_strdup (name); + this->ret->father = father; + this->ret->color = xbt_strdup (color); char str_id[INSTR_DEFAULT_STR_SIZE]; snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", instr_new_paje_id()); - ret->id = xbt_strdup (str_id); + this->ret->id = xbt_strdup (str_id); xbt_dict_set (father->values, name, ret, nullptr); XBT_DEBUG("new value %s, child of %s", ret->name, ret->father->name); - LogEntityValue(ret); - return ret; -} + LogEntityValue(this->ret); +}; val_t paje_value :: PJ_value_get_or_new (const char *name, const char *color, type_t father) { paje_value pj_value; @@ -38,7 +52,8 @@ val_t paje_value :: PJ_value_get_or_new (const char *name, const char *color, ty ret = pj_value.PJ_value_get(name, father); } catch(xbt_ex& e) { - ret = pj_value.PJ_value_new(name, color, father); + s_val rett(name, color, father); + ret = rett.ret; } return ret; } diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index 378892617c..7be771e5c6 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -81,8 +81,11 @@ class s_val { char *name; char *color; type_t father; + val_t ret; + s_val(const char *name, const char *color, type_t father); + val_t PJ_value_update (const char *name, const char *color, type_t father); }; -typedef s_val s_val_t; + //-------------------------------------------------- typedef enum { @@ -359,6 +362,10 @@ XBT_PRIVATE XBT_PRIVATE void PJ_type_free (type_t type); /* instr_config.c */ XBT_PRIVATE void recursiveDestroyType (type_t type); +/* instr_paje_values.c */ +XBT_PUBLIC(val_t) PJ_value_get_or_new (const char *name, const char *color, type_t father); +XBT_PUBLIC(val_t) PJ_value_get (const char *name, const type_t father); + XBT_PRIVATE void TRACE_TI_start(); XBT_PRIVATE void TRACE_TI_end(); diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index 039ed4c74d..7044975d24 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -267,11 +267,11 @@ static void sg_instr_new_host(simgrid::s4u::Host& host) if (msg_process == nullptr){ msg_process = PJ_type_container_new("MSG_PROCESS", container->type); type_t state = PJ_type_state_new ("MSG_PROCESS_STATE", msg_process); - pj_value.PJ_value_new ("suspend", "1 0 1", state); - pj_value.PJ_value_new ("sleep", "1 1 0", state); - pj_value.PJ_value_new ("receive", "1 0 0", state); - pj_value.PJ_value_new ("send", "0 0 1", state); - pj_value.PJ_value_new ("task_execute", "0 1 1", state); + s_val PJ_value("suspend", "1 0 1", state); + PJ_value.PJ_value_update("sleep", "1 1 0", state); + PJ_value.PJ_value_update("receive", "1 0 0", state); + PJ_value.PJ_value_update("send", "0 0 1", state); + PJ_value.PJ_value_update("task_execute", "0 1 1", state); PJ_type_link_new ("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process); PJ_type_link_new ("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process); } @@ -282,11 +282,11 @@ static void sg_instr_new_host(simgrid::s4u::Host& host) if (msg_vm == nullptr){ msg_vm = PJ_type_container_new("MSG_VM", container->type); type_t state = PJ_type_state_new ("MSG_VM_STATE", msg_vm); - pj_value.PJ_value_new ("suspend", "1 0 1", state); - pj_value.PJ_value_new ("sleep", "1 1 0", state); - pj_value.PJ_value_new ("receive", "1 0 0", state); - pj_value.PJ_value_new ("send", "0 0 1", state); - pj_value.PJ_value_new ("task_execute", "0 1 1", state); + s_val PJ_value("suspend", "1 0 1", state); + PJ_value.PJ_value_update ("sleep", "1 1 0", state); + PJ_value.PJ_value_update ("receive", "1 0 0", state); + PJ_value.PJ_value_update ("send", "0 0 1", state); + PJ_value.PJ_value_update ("task_execute", "0 1 1", state); PJ_type_link_new ("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm); PJ_type_link_new ("MSG_VM_PROCESS_LINK", PJ_type_get_root(), msg_vm, msg_vm); } @@ -403,7 +403,7 @@ void instr_new_user_state_type (const char *father_type, const char *new_typenam static void recursiveNewValueForUserStateType (const char *type_name, const char *value, const char *color, type_t root) { paje_value pj_value; if (not strcmp(root->name, type_name)) { - pj_value.PJ_value_new (value, color, root); + s_val PJ_value (value, color, root); } xbt_dict_cursor_t cursor = nullptr; type_t child_type;