From ce169099d562a6ce5dedb68848f1f4f06ae30e04 Mon Sep 17 00:00:00 2001 From: Lucas Schnorr Date: Tue, 5 Apr 2011 18:19:24 +0200 Subject: [PATCH] if tracing category X is created, define pX for hosts, bX for links details: - avoids confusion when doing spatial aggregation with the triva's hierarchical graph view --- src/instr/instr_config.c | 4 ++-- src/instr/instr_resource_utilization.c | 14 ++++++++++---- src/instr/instr_routing.c | 11 +++++++++-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/instr/instr_config.c b/src/instr/instr_config.c index defc1f54a6..8aad85e6bc 100644 --- a/src/instr/instr_config.c +++ b/src/instr/instr_config.c @@ -445,7 +445,7 @@ void TRACE_generate_triva_cat_conf (void) " size = power;\n" " values = ("); xbt_dict_foreach(created_categories,cursor2,name2,value2) { - fprintf (file, "%s, ", name2); + fprintf (file, "p%s, ", name2); } fprintf (file, ");\n" @@ -455,7 +455,7 @@ void TRACE_generate_triva_cat_conf (void) " size = bandwidth;\n" " values = ("); xbt_dict_foreach(created_categories,cursor2,name2,value2) { - fprintf (file, "%s, ", name2); + fprintf (file, "b%s, ", name2); } fprintf (file, ");\n" diff --git a/src/instr/instr_resource_utilization.c b/src/instr/instr_resource_utilization.c index 1e4cdf7ffa..f80332eaa4 100644 --- a/src/instr/instr_resource_utilization.c +++ b/src/instr/instr_resource_utilization.c @@ -308,9 +308,12 @@ void TRACE_surf_link_set_utilization(const char *resource, smx_action_t smx_acti if (TRACE_categorized()){ if (!surf_action->category) return; - XBT_DEBUG("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, surf_action->category, value); + //variable of this category starts by 'b', because we have a link here + char category_type[INSTR_DEFAULT_STR_SIZE]; + snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "b%s", surf_action->category); + XBT_DEBUG("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, category_type, value); container_t container = getContainerByName (resource); - type_t type = getVariableType(surf_action->category, NULL, container->type); + type_t type = getVariableType(category_type, NULL, container->type); TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value); } return; @@ -342,9 +345,12 @@ void TRACE_surf_host_set_utilization(const char *resource, if (TRACE_categorized()){ if (!surf_action->category) return; - XBT_DEBUG("CAT HOST [%f - %f] %s %s %f", now, now+delta, resource, surf_action->category, value); + //variable of this category starts by 'p', because we have a host here + char category_type[INSTR_DEFAULT_STR_SIZE]; + snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "p%s", surf_action->category); + XBT_DEBUG("CAT HOST [%f - %f] %s %s %f", now, now+delta, resource, category_type, value); container_t container = getContainerByName (resource); - type_t type = getVariableType(surf_action->category, NULL, container->type); + type_t type = getVariableType(category_type, NULL, container->type); TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value); } return; diff --git a/src/instr/instr_routing.c b/src/instr/instr_routing.c index 3dc81263c2..96098309c1 100644 --- a/src/instr/instr_routing.c +++ b/src/instr/instr_routing.c @@ -298,8 +298,15 @@ void instr_routing_define_callbacks () */ static void recursiveNewUserVariableType (const char *new_typename, const char *color, type_t root) { - if (!strcmp (root->name, "HOST") || !strcmp (root->name, "LINK")){ - getVariableType(new_typename, color, root); + if (!strcmp (root->name, "HOST")){ + char tnstr[INSTR_DEFAULT_STR_SIZE]; + snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "p%s", new_typename); + getVariableType(tnstr, color, root); + } + if (!strcmp (root->name, "LINK")){ + char tnstr[INSTR_DEFAULT_STR_SIZE]; + snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "b%s", new_typename); + getVariableType(tnstr, color, root); } xbt_dict_cursor_t cursor = NULL; type_t child_type; -- 2.20.1