From ca82f90e6d610b6bb3b038cd9ee48d378cc8a909 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 8 Nov 2019 10:51:57 +0100 Subject: [PATCH] Slightly reorganize log categories; remove unused ones. --- examples/deprecated/msg/dht-kademlia/task.c | 1 - examples/smpi/ampi_test/ampi_test.cpp | 2 -- src/bindings/java/jtrace.cpp | 3 --- src/bindings/lua/lua_host.cpp | 2 -- src/bindings/lua/lua_platf.cpp | 2 +- src/kernel/activity/ConditionVariableImpl.cpp | 2 +- src/mc/checker/simgrid_mc.cpp | 2 -- src/mc/mc_client_api.cpp | 3 --- src/mc/mc_comm_pattern.cpp | 3 --- src/mc/mc_config.cpp | 2 -- src/mc/mc_memory.cpp | 5 ----- src/mc/mc_state.cpp | 2 -- src/mc/sosp/PageStore.cpp | 2 -- src/mc/sosp/Region.cpp | 2 -- src/msg/msg_comm.cpp | 2 -- src/msg/msg_global.cpp | 1 - src/msg/msg_process.cpp | 2 -- src/plugins/file_system/s4u_FileSystem.cpp | 2 +- src/plugins/vm/VmLiveMigration.cpp | 2 +- src/plugins/vm/s4u_VirtualMachine.cpp | 3 +-- src/s4u/s4u_Actor.cpp | 2 +- src/s4u/s4u_Barrier.cpp | 2 +- src/s4u/s4u_Io.cpp | 2 -- src/s4u/s4u_Link.cpp | 2 -- src/s4u/s4u_Netzone.cpp | 2 -- src/smpi/mpi/smpi_group.cpp | 3 --- src/smpi/plugins/ampi/ampi.cpp | 2 -- src/smpi/plugins/ampi/instr_ampi.cpp | 2 -- src/xbt/automaton/automaton.c | 3 --- src/xbt/automaton/automatonparse_promela.c | 3 --- src/xbt/backtrace.cpp | 3 --- src/xbt/dict_elm.c | 2 -- src/xbt/xbt_os_synchro.cpp | 2 -- teshsuite/smpi/bug-17132/bug-17132.c | 3 --- tools/graphicator/graphicator.c | 2 -- 35 files changed, 7 insertions(+), 73 deletions(-) diff --git a/examples/deprecated/msg/dht-kademlia/task.c b/examples/deprecated/msg/dht-kademlia/task.c index 126a15d4e1..bcfc22888a 100644 --- a/examples/deprecated/msg/dht-kademlia/task.c +++ b/examples/deprecated/msg/dht-kademlia/task.c @@ -6,7 +6,6 @@ #include "task.h" #include "answer.h" -XBT_LOG_NEW_DEFAULT_CATEGORY(msg_kademlia_task, "Messages specific for this msg example"); /** @brief Creates a new "find node" task * @param sender_id the id of the node who sends the task diff --git a/examples/smpi/ampi_test/ampi_test.cpp b/examples/smpi/ampi_test/ampi_test.cpp index 9c7650a961..05b2efa216 100644 --- a/examples/smpi/ampi_test/ampi_test.cpp +++ b/examples/smpi/ampi_test/ampi_test.cpp @@ -7,8 +7,6 @@ #include "smpi/smpi.h" #include "smpi/sampi.h" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_plugin_load_balancer_example, smpi, "Simple tracing test for SAMPI functions"); - int main(int argc, char* argv[]) { MPI_Init(&argc, &argv); diff --git a/src/bindings/java/jtrace.cpp b/src/bindings/java/jtrace.cpp index 35d9c7ba50..d30e29974e 100644 --- a/src/bindings/java/jtrace.cpp +++ b/src/bindings/java/jtrace.cpp @@ -17,9 +17,6 @@ #endif /* end of eclipse-mandated pimple */ -// Define a new category -XBT_LOG_NEW_DEFAULT_CATEGORY (jtrace, "TRACE for Java(TM)"); - JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclare(JNIEnv * env, jclass cls, jstring js) { const char *s = env->GetStringUTFChars(js, 0); diff --git a/src/bindings/lua/lua_host.cpp b/src/bindings/lua/lua_host.cpp index c9e15239b8..a6334223ff 100644 --- a/src/bindings/lua/lua_host.cpp +++ b/src/bindings/lua/lua_host.cpp @@ -9,8 +9,6 @@ #include "simgrid/s4u/Host.hpp" #include -XBT_LOG_NEW_DEFAULT_CATEGORY(lua_host, "Lua Host module"); - constexpr char HOST_MODULE_NAME[] = "simgrid.host"; constexpr char HOST_FIELDNAME[] = "__simgrid_host"; diff --git a/src/bindings/lua/lua_platf.cpp b/src/bindings/lua/lua_platf.cpp index 404887ff22..2316b7b321 100644 --- a/src/bindings/lua/lua_platf.cpp +++ b/src/bindings/lua/lua_platf.cpp @@ -24,7 +24,7 @@ #include -XBT_LOG_NEW_DEFAULT_CATEGORY(lua_platf, "Lua bindings (platform module)"); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_platf, lua, "Lua bindings (platform module)"); constexpr char PLATF_MODULE_NAME[] = "simgrid.engine"; constexpr char AS_FIELDNAME[] = "__simgrid_as"; diff --git a/src/kernel/activity/ConditionVariableImpl.cpp b/src/kernel/activity/ConditionVariableImpl.cpp index 5efb83c75b..027ef16d18 100644 --- a/src/kernel/activity/ConditionVariableImpl.cpp +++ b/src/kernel/activity/ConditionVariableImpl.cpp @@ -8,7 +8,7 @@ #include "src/kernel/activity/MutexImpl.hpp" #include "src/kernel/activity/SynchroRaw.hpp" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ConditionVariable, simix_synchro, "Condition variables"); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_condition, simix_synchro, "Condition variables"); /********************************* Condition **********************************/ diff --git a/src/mc/checker/simgrid_mc.cpp b/src/mc/checker/simgrid_mc.cpp index 010cbfecca..6e91f110ed 100644 --- a/src/mc/checker/simgrid_mc.cpp +++ b/src/mc/checker/simgrid_mc.cpp @@ -14,8 +14,6 @@ #include #include -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_main, mc, "Entry point for simgrid-mc"); - static inline char** argvdup(int argc, char** argv) { diff --git a/src/mc/mc_client_api.cpp b/src/mc/mc_client_api.cpp index d2c13d6445..ac87f79183 100644 --- a/src/mc/mc_client_api.cpp +++ b/src/mc/mc_client_api.cpp @@ -18,9 +18,6 @@ * communicate with the MC (declared in modelchecker.h). */ -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_client_api, mc, - "Public API for the model-checked application"); - // MC_random() is in mc_base.cpp void MC_assert(int prop) diff --git a/src/mc/mc_comm_pattern.cpp b/src/mc/mc_comm_pattern.cpp index 8e4b405ac0..7700754c56 100644 --- a/src/mc/mc_comm_pattern.cpp +++ b/src/mc/mc_comm_pattern.cpp @@ -10,9 +10,6 @@ using simgrid::mc::remote; -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_comm_pattern, mc, - "Logging specific to MC communication patterns"); - static void MC_patterns_copy(std::vector& dest, std::vector const& source) { diff --git a/src/mc/mc_config.cpp b/src/mc/mc_config.cpp index 2ba61a4d88..e6b4fb45f0 100644 --- a/src/mc/mc_config.cpp +++ b/src/mc/mc_config.cpp @@ -11,8 +11,6 @@ #include -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_config, mc, "Configuration of the Model Checker"); - #if SIMGRID_HAVE_MC namespace simgrid { namespace mc { diff --git a/src/mc/mc_memory.cpp b/src/mc/mc_memory.cpp index 15015f0aba..ff6bbb256a 100644 --- a/src/mc/mc_memory.cpp +++ b/src/mc/mc_memory.cpp @@ -7,15 +7,10 @@ #include #include -#include "xbt/log.h" - #include "mc/mc.h" #include "src/mc/mc_private.hpp" #include "src/xbt/mmalloc/mmprivate.h" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_memory, mc, - "Logging specific to MC (memory)"); - /* Initialize the model-checker memory subsystem */ /* It creates the two heap regions: std_heap and mc_heap */ void MC_memory_init() diff --git a/src/mc/mc_state.cpp b/src/mc/mc_state.cpp index 535dae9642..b811c1d1e8 100644 --- a/src/mc/mc_state.cpp +++ b/src/mc/mc_state.cpp @@ -13,8 +13,6 @@ using simgrid::mc::remote; -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_state, mc, "Logging specific to MC (state)"); - namespace simgrid { namespace mc { diff --git a/src/mc/sosp/PageStore.cpp b/src/mc/sosp/PageStore.cpp index e99c188997..e11d6532b4 100644 --- a/src/mc/sosp/PageStore.cpp +++ b/src/mc/sosp/PageStore.cpp @@ -21,8 +21,6 @@ #include // memcpy, memcmp #include -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_page_snapshot, mc, "Logging specific to mc_page_snapshot"); - namespace simgrid { namespace mc { diff --git a/src/mc/sosp/Region.cpp b/src/mc/sosp/Region.cpp index 8c27e7ce6c..3208437e33 100644 --- a/src/mc/sosp/Region.cpp +++ b/src/mc/sosp/Region.cpp @@ -16,8 +16,6 @@ #define MAP_POPULATE MAP_PREFAULT_READ #endif -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_RegionSnaphot, mc, "Logging specific to region snapshots"); - namespace simgrid { namespace mc { diff --git a/src/msg/msg_comm.cpp b/src/msg/msg_comm.cpp index c386327e38..463619d61b 100644 --- a/src/msg/msg_comm.cpp +++ b/src/msg/msg_comm.cpp @@ -13,8 +13,6 @@ #include "src/instr/instr_private.hpp" #include "src/msg/msg_private.hpp" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_comm, msg, "Logging specific to MSG (comm)"); - namespace simgrid { namespace msg { diff --git a/src/msg/msg_global.cpp b/src/msg/msg_global.cpp index d8e0f77e4d..9608ac7806 100644 --- a/src/msg/msg_global.cpp +++ b/src/msg/msg_global.cpp @@ -12,7 +12,6 @@ #include XBT_LOG_NEW_CATEGORY(msg, "All MSG categories"); -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg, "Logging specific to MSG (kernel)"); bool MSG_Global_t::debug_multiple_use = false; diff --git a/src/msg/msg_process.cpp b/src/msg/msg_process.cpp index e790079093..0997ce7c09 100644 --- a/src/msg/msg_process.cpp +++ b/src/msg/msg_process.cpp @@ -9,8 +9,6 @@ #include "src/instr/instr_private.hpp" #include "src/simix/smx_private.hpp" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg, "Logging specific to MSG (process)"); - std::string instr_pid(simgrid::s4u::Actor const& proc) { return std::string(proc.get_name()) + "-" + std::to_string(proc.get_pid()); diff --git a/src/plugins/file_system/s4u_FileSystem.cpp b/src/plugins/file_system/s4u_FileSystem.cpp index 669bf1d706..5ab8307f9f 100644 --- a/src/plugins/file_system/s4u_FileSystem.cpp +++ b/src/plugins/file_system/s4u_FileSystem.cpp @@ -17,7 +17,7 @@ #include #include -XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_file, "S4U files"); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_file, s4u, "S4U files"); int sg_storage_max_file_descriptors = 1024; namespace simgrid { diff --git a/src/plugins/vm/VmLiveMigration.cpp b/src/plugins/vm/VmLiveMigration.cpp index 90b555321d..a828f8ad16 100644 --- a/src/plugins/vm/VmLiveMigration.cpp +++ b/src/plugins/vm/VmLiveMigration.cpp @@ -9,7 +9,7 @@ #include "src/plugins/vm/VirtualMachineImpl.hpp" #include "src/plugins/vm/VmHostExt.hpp" -XBT_LOG_NEW_DEFAULT_CATEGORY(vm_live_migration, "S4U virtual machines live migration"); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(vm_live_migration, s4u, "S4U virtual machines live migration"); namespace simgrid { namespace vm { diff --git a/src/plugins/vm/s4u_VirtualMachine.cpp b/src/plugins/vm/s4u_VirtualMachine.cpp index e812231543..803eaeddd5 100644 --- a/src/plugins/vm/s4u_VirtualMachine.cpp +++ b/src/plugins/vm/s4u_VirtualMachine.cpp @@ -11,8 +11,7 @@ #include "src/plugins/vm/VmHostExt.hpp" #include "src/surf/cpu_cas01.hpp" -XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_vm, "S4U virtual machines"); - +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_vm, s4u, "S4U virtual machines"); namespace simgrid { namespace s4u { diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 8099c33e14..10e25304e8 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -18,7 +18,7 @@ #include #include -XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_actor, "S4U actors"); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_actor, s4u, "S4U actors"); namespace simgrid { namespace s4u { diff --git a/src/s4u/s4u_Barrier.cpp b/src/s4u/s4u_Barrier.cpp index be8bb6e6e1..7289a6ccb6 100644 --- a/src/s4u/s4u_Barrier.cpp +++ b/src/s4u/s4u_Barrier.cpp @@ -12,7 +12,7 @@ #include "simgrid/simix.h" #include "xbt/log.hpp" -XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_barrier, "S4U barrier"); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_barrier, s4u, "S4U barrier"); namespace simgrid { namespace s4u { diff --git a/src/s4u/s4u_Io.cpp b/src/s4u/s4u_Io.cpp index 30ebf50f7d..cca68b0156 100644 --- a/src/s4u/s4u_Io.cpp +++ b/src/s4u/s4u_Io.cpp @@ -9,8 +9,6 @@ #include "src/kernel/activity/IoImpl.hpp" #include "xbt/log.h" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_io, s4u_activity, "S4U asynchronous IOs"); - namespace simgrid { namespace s4u { diff --git a/src/s4u/s4u_Link.cpp b/src/s4u/s4u_Link.cpp index bb48a1bb1f..742f0628e3 100644 --- a/src/s4u/s4u_Link.cpp +++ b/src/s4u/s4u_Link.cpp @@ -13,8 +13,6 @@ #include "src/surf/network_interface.hpp" #include "xbt/log.h" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_link, s4u, "Logging specific to the S4U links"); - namespace simgrid { namespace s4u { diff --git a/src/s4u/s4u_Netzone.cpp b/src/s4u/s4u_Netzone.cpp index f5ee74e8bd..807bf42da0 100644 --- a/src/s4u/s4u_Netzone.cpp +++ b/src/s4u/s4u_Netzone.cpp @@ -9,8 +9,6 @@ #include "simgrid/s4u/NetZone.hpp" #include "simgrid/zone.h" -XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_netzone, "S4U Networking Zones"); - namespace simgrid { namespace s4u { diff --git a/src/smpi/mpi/smpi_group.cpp b/src/smpi/mpi/smpi_group.cpp index fb70b84d08..00d32b2a58 100644 --- a/src/smpi/mpi/smpi_group.cpp +++ b/src/smpi/mpi/smpi_group.cpp @@ -7,9 +7,6 @@ #include "smpi_group.hpp" #include "smpi_comm.hpp" #include -#include - -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_group, smpi, "Logging specific to SMPI (group)"); simgrid::smpi::Group mpi_MPI_GROUP_EMPTY; MPI_Group MPI_GROUP_EMPTY=&mpi_MPI_GROUP_EMPTY; diff --git a/src/smpi/plugins/ampi/ampi.cpp b/src/smpi/plugins/ampi/ampi.cpp index 852bf1caa4..9888163092 100644 --- a/src/smpi/plugins/ampi/ampi.cpp +++ b/src/smpi/plugins/ampi/ampi.cpp @@ -15,8 +15,6 @@ #include "ampi.hpp" #include -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(plugin_pampi, smpi, "Logging specific to the AMPI functions"); - static std::vector memory_size(500, 0); // FIXME cheinrich This needs to be dynamic static std::map alloc_table; // Keep track of all allocations diff --git a/src/smpi/plugins/ampi/instr_ampi.cpp b/src/smpi/plugins/ampi/instr_ampi.cpp index bc1320dceb..7bd514152b 100644 --- a/src/smpi/plugins/ampi/instr_ampi.cpp +++ b/src/smpi/plugins/ampi/instr_ampi.cpp @@ -9,8 +9,6 @@ #include #include -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_sampi, instr, "Tracing (S)AMPI"); - static std::map ampi_colors = {{"migrate", "0.2 0.5 0.2"}, {"iteration", "0.5 0.5 0.5"} }; diff --git a/src/xbt/automaton/automaton.c b/src/xbt/automaton/automaton.c index fd3e111e86..2a65be1277 100644 --- a/src/xbt/automaton/automaton.c +++ b/src/xbt/automaton/automaton.c @@ -7,11 +7,8 @@ #include "xbt/automaton.h" #include /* printf */ -#include #include -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_automaton, xbt, "Automaton"); - struct xbt_automaton_propositional_symbol{ char* pred; /** Callback used to evaluate the value of the symbol */ diff --git a/src/xbt/automaton/automatonparse_promela.c b/src/xbt/automaton/automatonparse_promela.c index bf93af4335..bb18110f54 100644 --- a/src/xbt/automaton/automatonparse_promela.c +++ b/src/xbt/automaton/automatonparse_promela.c @@ -12,13 +12,10 @@ #if HAVE_UNISTD_H # include /* isatty */ #endif -#include #include #include "parserPromela.tab.cacc" -XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_automaton); - static xbt_automaton_t parsed_automaton; char* state_id_src; diff --git a/src/xbt/backtrace.cpp b/src/xbt/backtrace.cpp index 74126b10af..17f5e9c7bf 100644 --- a/src/xbt/backtrace.cpp +++ b/src/xbt/backtrace.cpp @@ -6,7 +6,6 @@ #include "src/internal_config.h" #include -#include #include #include #include @@ -34,8 +33,6 @@ #include #endif -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_backtrace, xbt, "Backtrace"); - /** @brief show the backtrace of the current point (lovely while debugging) */ void xbt_backtrace_display_current() { diff --git a/src/xbt/dict_elm.c b/src/xbt/dict_elm.c index be4d8a0c0b..9c5bc3b6e6 100644 --- a/src/xbt/dict_elm.c +++ b/src/xbt/dict_elm.c @@ -7,8 +7,6 @@ #include "dict_private.h" /* prototypes of this module */ -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dict_elm, xbt_dict, "Dictionaries internals"); - xbt_mallocator_t dict_elm_mallocator = NULL; xbt_dictelm_t xbt_dictelm_new(const char* key, int key_len, unsigned int hash_code, void* content) diff --git a/src/xbt/xbt_os_synchro.cpp b/src/xbt/xbt_os_synchro.cpp index 1992ab40f2..14bde58c74 100644 --- a/src/xbt/xbt_os_synchro.cpp +++ b/src/xbt/xbt_os_synchro.cpp @@ -12,8 +12,6 @@ #include "src/kernel/activity/MutexImpl.hpp" #include "xbt/synchro.h" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_sync, xbt, "Synchronization mechanism"); - /****** mutex related functions ******/ xbt_mutex_t xbt_mutex_init(void) { diff --git a/teshsuite/smpi/bug-17132/bug-17132.c b/teshsuite/smpi/bug-17132/bug-17132.c index 090c3ffc50..673f567c3b 100644 --- a/teshsuite/smpi/bug-17132/bug-17132.c +++ b/teshsuite/smpi/bug-17132/bug-17132.c @@ -6,12 +6,9 @@ /* Bug report: https://gforge.inria.fr/tracker/index.php?func=detail&aid=17132&group_id=12&atid=165 */ -#include "xbt/log.h" #include #include -XBT_LOG_NEW_DEFAULT_CATEGORY(MM_mpi, "Messages for this SMPI test"); - int main(int argc, char ** argv) { size_t M = 8*1024; diff --git a/tools/graphicator/graphicator.c b/tools/graphicator/graphicator.c index 0cb86c879f..749419760e 100644 --- a/tools/graphicator/graphicator.c +++ b/tools/graphicator/graphicator.c @@ -7,8 +7,6 @@ #include "simgrid/msg.h" #include "xbt/graph.h" -XBT_LOG_NEW_DEFAULT_CATEGORY(graphicator, "Graphicator Logging System"); - int main(int argc, char **argv) { MSG_init(&argc, argv); -- 2.20.1