From ae855a0d996d06d373fbc233e78b0fbe7f1f2df6 Mon Sep 17 00:00:00 2001 From: schnorr Date: Thu, 2 Dec 2010 22:38:33 +0000 Subject: [PATCH] [trace] renaming almost all tracing files in src/instr details: - this is just an ongoing code re-organization - it serves as a preparation for jedule code in src/instr git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8959 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- buildtools/Cmake/DefinePackages.cmake | 27 ++++---- examples/msg/actions/actions.c | 2 +- src/instr/general.c | 65 ------------------- .../{categories.c => instr_categories.c} | 2 +- src/instr/instr_config.c | 2 +- src/instr/{interface.c => instr_interface.c} | 2 +- ...sg_process_instr.c => instr_msg_process.c} | 23 ++++++- .../{msg_task_instr.c => instr_msg_task.c} | 34 +++++++++- .../{msg_volume.c => instr_msg_volume.c} | 2 +- src/instr/{paje.c => instr_paje.c} | 2 +- src/instr/{private.h => instr_private.h} | 13 ++-- ...ization.c => instr_resource_utilization.c} | 2 +- src/instr/{sd_instr.c => instr_simdag.c} | 2 +- src/instr/{smpi_instr.c => instr_smpi.c} | 2 +- src/instr/{smx_instr.c => instr_smx.c} | 2 +- src/instr/{surf_instr.c => instr_surf.c} | 2 +- .../{variables_instr.c => instr_variables.c} | 2 +- src/msg/private.h | 2 +- src/simdag/sd_global.c | 2 +- src/simdag/sd_task.c | 2 +- src/simix/private.h | 2 +- src/smpi/private.h | 2 +- src/surf/surf_private.h | 2 +- 23 files changed, 90 insertions(+), 108 deletions(-) delete mode 100644 src/instr/general.c rename src/instr/{categories.c => instr_categories.c} (97%) rename src/instr/{interface.c => instr_interface.c} (99%) rename src/instr/{msg_process_instr.c => instr_msg_process.c} (90%) rename src/instr/{msg_task_instr.c => instr_msg_task.c} (87%) rename src/instr/{msg_volume.c => instr_msg_volume.c} (98%) rename src/instr/{paje.c => instr_paje.c} (99%) rename src/instr/{private.h => instr_private.h} (97%) rename src/instr/{resource_utilization.c => instr_resource_utilization.c} (99%) rename src/instr/{sd_instr.c => instr_simdag.c} (95%) rename src/instr/{smpi_instr.c => instr_smpi.c} (99%) rename src/instr/{smx_instr.c => instr_smx.c} (97%) rename src/instr/{surf_instr.c => instr_surf.c} (99%) rename src/instr/{variables_instr.c => instr_variables.c} (98%) diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index b66ec4c037..132869db1f 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -299,20 +299,19 @@ set(LUA_SRC set(TRACING_SRC src/instr/instr_config.c - src/instr/categories.c - src/instr/interface.c - src/instr/general.c - src/instr/paje.c - src/instr/msg_task_instr.c - src/instr/msg_process_instr.c - src/instr/msg_volume.c - src/instr/smx_instr.c - src/instr/surf_instr.c - src/instr/smpi_instr.c - src/instr/sd_instr.c - src/instr/variables_instr.c - src/instr/resource_utilization.c - src/instr/private.h + src/instr/instr_categories.c + src/instr/instr_interface.c + src/instr/instr_paje.c + src/instr/instr_msg_task.c + src/instr/instr_msg_process.c + src/instr/instr_msg_volume.c + src/instr/instr_smx.c + src/instr/instr_surf.c + src/instr/instr_smpi.c + src/instr/instr_simdag.c + src/instr/instr_variables.c + src/instr/instr_resource_utilization.c + src/instr/instr_private.h ) set(RUBY_SRC diff --git a/examples/msg/actions/actions.c b/examples/msg/actions/actions.c index 0e7e3f9ceb..85651974e9 100644 --- a/examples/msg/actions/actions.c +++ b/examples/msg/actions/actions.c @@ -10,7 +10,7 @@ #include "simix/simix.h" /* semaphores for the barrier */ #include "xbt.h" /* calloc, printf */ #include "simgrid_config.h" /* getline */ -#include "instr/private.h" +#include "instr/instr_private.h" XBT_LOG_NEW_DEFAULT_CATEGORY(actions, "Messages specific for this msg example"); diff --git a/src/instr/general.c b/src/instr/general.c deleted file mode 100644 index fd65abec54..0000000000 --- a/src/instr/general.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (c) 2010. The SimGrid Team. - * All rights reserved. */ - -/* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ - -#include "instr/private.h" - - -#ifdef HAVE_TRACING - -char *TRACE_host_container(m_host_t host, char *output, int len) -{ - if (output) { - snprintf(output, len, "%s", MSG_host_get_name(host)); - return output; - } else { - return NULL; - } -} - -char *TRACE_task_container(m_task_t task, char *output, int len) -{ - if (output) { - snprintf(output, len, "%p-%lld", task, task->counter); - return output; - } else { - return NULL; - } -} - -char *TRACE_process_container(m_process_t process, char *output, int len) -{ - if (output) { - snprintf(output, len, "%s-%p", MSG_process_get_name(process), process); - return output; - } else { - return NULL; - } -} - -char *TRACE_process_alias_container(m_process_t process, m_host_t host, - char *output, int len) -{ - if (output) { - snprintf(output, len, "%p-%p", process, host); - return output; - } else { - return NULL; - } -} - -char *TRACE_task_alias_container(m_task_t task, m_process_t process, - m_host_t host, char *output, int len) -{ - if (output) { - snprintf(output, len, "%p-%lld-%p-%p", task, task->counter, process, - host); - return output; - } else { - return NULL; - } -} - -#endif diff --git a/src/instr/categories.c b/src/instr/instr_categories.c similarity index 97% rename from src/instr/categories.c rename to src/instr/instr_categories.c index f1e37b2273..be11384ddd 100644 --- a/src/instr/categories.c +++ b/src/instr/instr_categories.c @@ -4,7 +4,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "instr/private.h" +#include "instr/instr_private.h" #ifdef HAVE_TRACING diff --git a/src/instr/instr_config.c b/src/instr/instr_config.c index 4a783d87a9..cc42af4e77 100644 --- a/src/instr/instr_config.c +++ b/src/instr/instr_config.c @@ -5,7 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "instr/private.h" +#include "instr/instr_private.h" #ifdef HAVE_TRACING diff --git a/src/instr/interface.c b/src/instr/instr_interface.c similarity index 99% rename from src/instr/interface.c rename to src/instr/instr_interface.c index f08e3ad361..fbf8457d78 100644 --- a/src/instr/interface.c +++ b/src/instr/instr_interface.c @@ -8,7 +8,7 @@ #ifdef HAVE_TRACING -#include "instr/private.h" +#include "instr/instr_private.h" XBT_LOG_NEW_DEFAULT_CATEGORY(tracing, "Tracing Interface"); diff --git a/src/instr/msg_process_instr.c b/src/instr/instr_msg_process.c similarity index 90% rename from src/instr/msg_process_instr.c rename to src/instr/instr_msg_process.c index d09b8f2a90..164548ad4f 100644 --- a/src/instr/msg_process_instr.c +++ b/src/instr/instr_msg_process.c @@ -4,12 +4,33 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "instr/private.h" +#include "instr/instr_private.h" #ifdef HAVE_TRACING static xbt_dict_t process_containers = NULL; +char *TRACE_process_alias_container(m_process_t process, m_host_t host, + char *output, int len) +{ + if (output) { + snprintf(output, len, "%p-%p", process, host); + return output; + } else { + return NULL; + } +} + +char *TRACE_process_container(m_process_t process, char *output, int len) +{ + if (output) { + snprintf(output, len, "%s-%p", MSG_process_get_name(process), process); + return output; + } else { + return NULL; + } +} + void TRACE_msg_process_alloc(void) { process_containers = xbt_dict_new(); diff --git a/src/instr/msg_task_instr.c b/src/instr/instr_msg_task.c similarity index 87% rename from src/instr/msg_task_instr.c rename to src/instr/instr_msg_task.c index 09e217a3a6..f73f3610cc 100644 --- a/src/instr/msg_task_instr.c +++ b/src/instr/instr_msg_task.c @@ -4,12 +4,44 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "instr/private.h" +#include "instr/instr_private.h" #ifdef HAVE_TRACING static xbt_dict_t task_containers = NULL; +static char *TRACE_task_alias_container(m_task_t task, m_process_t process, + m_host_t host, char *output, int len) +{ + if (output) { + snprintf(output, len, "%p-%lld-%p-%p", task, task->counter, process, + host); + return output; + } else { + return NULL; + } +} + +static char *TRACE_host_container(m_host_t host, char *output, int len) +{ + if (output) { + snprintf(output, len, "%s", MSG_host_get_name(host)); + return output; + } else { + return NULL; + } +} + +char *TRACE_task_container(m_task_t task, char *output, int len) +{ + if (output) { + snprintf(output, len, "%p-%lld", task, task->counter); + return output; + } else { + return NULL; + } +} + void TRACE_msg_task_alloc(void) { task_containers = xbt_dict_new(); diff --git a/src/instr/msg_volume.c b/src/instr/instr_msg_volume.c similarity index 98% rename from src/instr/msg_volume.c rename to src/instr/instr_msg_volume.c index 91a52acbe0..97b23315a6 100644 --- a/src/instr/msg_volume.c +++ b/src/instr/instr_msg_volume.c @@ -4,7 +4,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "instr/private.h" +#include "instr/instr_private.h" #ifdef HAVE_TRACING diff --git a/src/instr/paje.c b/src/instr/instr_paje.c similarity index 99% rename from src/instr/paje.c rename to src/instr/instr_paje.c index d2d211cd1c..d617480ada 100644 --- a/src/instr/paje.c +++ b/src/instr/instr_paje.c @@ -4,7 +4,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "instr/private.h" +#include "instr/instr_private.h" #ifdef HAVE_TRACING diff --git a/src/instr/private.h b/src/instr/instr_private.h similarity index 97% rename from src/instr/private.h rename to src/instr/instr_private.h index 4f9b99ddca..f6942c9c66 100644 --- a/src/instr/private.h +++ b/src/instr/instr_private.h @@ -74,15 +74,6 @@ void pajeSubVariable(double time, const char *entityType, void pajeNewEvent(double time, const char *entityType, const char *container, const char *value); -/* from general.c */ -char *TRACE_host_container(m_host_t host, char *output, int len); -char *TRACE_task_container(m_task_t task, char *output, int len); -char *TRACE_process_container(m_process_t process, char *output, int len); -char *TRACE_process_alias_container(m_process_t process, m_host_t host, - char *output, int len); -char *TRACE_task_alias_container(m_task_t task, m_process_t process, - m_host_t host, char *output, int len); - /* from categories.c */ void TRACE_category_alloc(void); void TRACE_category_release(void); @@ -92,6 +83,7 @@ void TRACE_category_unset(smx_process_t proc); void TRACE_msg_category_set(smx_process_t proc, m_task_t task); /* declaration of instrumentation functions from msg_task_instr.c */ +char *TRACE_task_container(m_task_t task, char *output, int len); void TRACE_msg_task_alloc(void); void TRACE_msg_task_release(void); void TRACE_msg_task_create(m_task_t task); @@ -104,6 +96,9 @@ int TRACE_msg_task_put_start(m_task_t task); //returns TRUE if the task_put_e void TRACE_msg_task_put_end(void); /* declaration of instrumentation functions from msg_process_instr.c */ +char *TRACE_process_alias_container(m_process_t process, m_host_t host, + char *output, int len); +char *TRACE_process_container(m_process_t process, char *output, int len); void TRACE_msg_process_alloc(void); void TRACE_msg_process_release(void); void TRACE_msg_process_change_host(m_process_t process, m_host_t old_host, diff --git a/src/instr/resource_utilization.c b/src/instr/instr_resource_utilization.c similarity index 99% rename from src/instr/resource_utilization.c rename to src/instr/instr_resource_utilization.c index 8b1e7ba047..87e93bbd34 100644 --- a/src/instr/resource_utilization.c +++ b/src/instr/instr_resource_utilization.c @@ -4,7 +4,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "instr/private.h" +#include "instr/instr_private.h" #ifdef HAVE_TRACING diff --git a/src/instr/sd_instr.c b/src/instr/instr_simdag.c similarity index 95% rename from src/instr/sd_instr.c rename to src/instr/instr_simdag.c index 535834d47c..741ef8d897 100644 --- a/src/instr/sd_instr.c +++ b/src/instr/instr_simdag.c @@ -4,7 +4,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "instr/private.h" +#include "instr/instr_private.h" #ifdef HAVE_TRACING diff --git a/src/instr/smpi_instr.c b/src/instr/instr_smpi.c similarity index 99% rename from src/instr/smpi_instr.c rename to src/instr/instr_smpi.c index 07d8cc12e8..0e247c7222 100644 --- a/src/instr/smpi_instr.c +++ b/src/instr/instr_smpi.c @@ -4,7 +4,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "instr/private.h" +#include "instr/instr_private.h" #ifdef HAVE_TRACING diff --git a/src/instr/smx_instr.c b/src/instr/instr_smx.c similarity index 97% rename from src/instr/smx_instr.c rename to src/instr/instr_smx.c index 69242845a0..afd8a04154 100644 --- a/src/instr/smx_instr.c +++ b/src/instr/instr_smx.c @@ -4,7 +4,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "instr/private.h" +#include "instr/instr_private.h" #ifdef HAVE_TRACING diff --git a/src/instr/surf_instr.c b/src/instr/instr_surf.c similarity index 99% rename from src/instr/surf_instr.c rename to src/instr/instr_surf.c index f73e28095f..235a890ede 100644 --- a/src/instr/surf_instr.c +++ b/src/instr/instr_surf.c @@ -4,7 +4,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "instr/private.h" +#include "instr/instr_private.h" #include "surf/surf_private.h" #ifdef HAVE_TRACING diff --git a/src/instr/variables_instr.c b/src/instr/instr_variables.c similarity index 98% rename from src/instr/variables_instr.c rename to src/instr/instr_variables.c index 303eadaf8a..40dfcf084f 100644 --- a/src/instr/variables_instr.c +++ b/src/instr/instr_variables.c @@ -4,7 +4,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "instr/private.h" +#include "instr/instr_private.h" #include "surf/surf_private.h" #include "surf/network_private.h" diff --git a/src/msg/private.h b/src/msg/private.h index 3c19b3a9d4..6c6f6e81df 100644 --- a/src/msg/private.h +++ b/src/msg/private.h @@ -15,7 +15,7 @@ #include "xbt/swag.h" #include "xbt/dict.h" #include "xbt/config.h" -#include "instr/private.h" +#include "instr/instr_private.h" SG_BEGIN_DECL() diff --git a/src/simdag/sd_global.c b/src/simdag/sd_global.c index 71eb57a97f..c24ce295be 100644 --- a/src/simdag/sd_global.c +++ b/src/simdag/sd_global.c @@ -12,7 +12,7 @@ #include "xbt/log.h" #include "xbt/str.h" #include "xbt/config.h" -#include "instr/private.h" +#include "instr/instr_private.h" #ifdef HAVE_LUA #include #include diff --git a/src/simdag/sd_task.c b/src/simdag/sd_task.c index 9d6affe509..105ac01ef5 100644 --- a/src/simdag/sd_task.c +++ b/src/simdag/sd_task.c @@ -8,7 +8,7 @@ #include "simdag/simdag.h" #include "xbt/sysdep.h" #include "xbt/dynar.h" -#include "instr/private.h" +#include "instr/instr_private.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_task, sd, "Logging specific to SimDag (task)"); diff --git a/src/simix/private.h b/src/simix/private.h index c62284d6d4..9095077e3c 100644 --- a/src/simix/private.h +++ b/src/simix/private.h @@ -15,7 +15,7 @@ #include "xbt/config.h" #include "xbt/function_types.h" #include "xbt/ex_interface.h" -#include "instr/private.h" +#include "instr/instr_private.h" #include "process_private.h" #include "host_private.h" #include "network_private.h" diff --git a/src/smpi/private.h b/src/smpi/private.h index aea894b4c7..fe280e6989 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -12,7 +12,7 @@ #include "simix/simix.h" #include "smpi/smpi.h" #include "smpi/smpif.h" -#include "instr/private.h" +#include "instr/instr_private.h" struct s_smpi_process_data; typedef struct s_smpi_process_data *smpi_process_data_t; diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index 77d50344c0..03a70abdc1 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -12,7 +12,7 @@ #include "xbt/log.h" #include "surf/surfxml_parse_private.h" #include "surf/random_mgr.h" -#include "instr/private.h" +#include "instr/instr_private.h" #define NO_MAX_DURATION -1.0 -- 2.20.1