From bff077b4621c68455a86e60292cb0bf872a879d5 Mon Sep 17 00:00:00 2001 From: mquinson Date: Thu, 6 Mar 2008 10:26:18 +0000 Subject: [PATCH 1/1] Do connect all log channel manually to parent using XBT_LOG_CONNECT() too, so that it works properly under windows git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5270 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/amok/base.c | 7 ++++++- src/gras/gras.c | 27 +++++++++++++++++++++++++++ src/msg/global.c | 6 ++++++ src/simdag/sd_global.c | 5 +++++ src/simix/smx_config.c | 9 +++++++++ src/smpi/smpi_base.c | 10 ++++++++++ src/surf/surf.c | 14 ++++++++++++++ src/xbt/xbt_main.c | 25 +++++++++++++++++++++++++ 8 files changed, 102 insertions(+), 1 deletion(-) diff --git a/src/amok/base.c b/src/amok/base.c index fa3b09ee85..07fcc40230 100644 --- a/src/amok/base.c +++ b/src/amok/base.c @@ -14,7 +14,12 @@ XBT_LOG_NEW_SUBCATEGORY(amok,XBT_LOG_ROOT_CAT,"All AMOK categories"); void amok_base_init(void) { gras_datadesc_type_t host_desc; - + + /* Connect our log channels: that must be done manually under windows */ + XBT_LOG_CONNECT(amok_bw, amok); + XBT_LOG_CONNECT(amok_bw_sat, amok_bw); + XBT_LOG_CONNECT(amok_pm, amok); + /* Build the datatype descriptions */ host_desc = gras_datadesc_struct("s_xbt_host_t"); gras_datadesc_struct_append(host_desc,"name",gras_datadesc_by_name("string")); diff --git a/src/gras/gras.c b/src/gras/gras.c index 63f1d6cf9d..7bf58273ca 100644 --- a/src/gras/gras.c +++ b/src/gras/gras.c @@ -60,6 +60,33 @@ void gras_init(int *argc,char **argv) { * - declare process specific data we need (without creating them) */ if (gras_running_process == 0) { + /* Connect our log channels: that must be done manually under windows */ + XBT_LOG_CONNECT(gras_ddt, gras); + XBT_LOG_CONNECT(gras_ddt_cbps, gras_ddt); + XBT_LOG_CONNECT(gras_ddt_convert, gras_ddt); + XBT_LOG_CONNECT(gras_ddt_create, gras_ddt); + XBT_LOG_CONNECT(gras_ddt_exchange, gras_ddt); + XBT_LOG_CONNECT(gras_ddt_lexer, gras_ddt_parse); + XBT_LOG_CONNECT(gras_ddt_parse, gras_ddt); + + XBT_LOG_CONNECT(gras_modules, gras); + + XBT_LOG_CONNECT(gras_msg, gras); + XBT_LOG_CONNECT(gras_msg_read, gras_msg); + XBT_LOG_CONNECT(gras_msg_rpc, gras_msg); + + XBT_LOG_CONNECT(gras_timer, gras); + + XBT_LOG_CONNECT(gras_trp, gras); + XBT_LOG_CONNECT(gras_trp_file, gras_trp); + XBT_LOG_CONNECT(gras_trp_meas, gras_trp); + XBT_LOG_CONNECT(gras_trp_sg, gras_trp); + XBT_LOG_CONNECT(gras_trp_tcp, gras_trp); + + XBT_LOG_CONNECT(gras_virtu, gras); + XBT_LOG_CONNECT(gras_virtu_emul, gras_virtu); + XBT_LOG_CONNECT(gras_virtu_process, gras_virtu); + gras_trp_register(); gras_msg_register(); } diff --git a/src/msg/global.c b/src/msg/global.c index 3ab2ecab75..565788c91d 100644 --- a/src/msg/global.c +++ b/src/msg/global.c @@ -46,6 +46,12 @@ void MSG_global_init(int *argc, char **argv) { xbt_getpid = MSG_process_self_PID; if (!msg_global) { + /* Connect our log channels: that must be done manually under windows */ + XBT_LOG_CONNECT(msg_gos, msg); + XBT_LOG_CONNECT(msg_kernel, msg); + XBT_LOG_CONNECT(msg_mailbox, msg); + XBT_LOG_CONNECT(msg_process, msg); + SIMIX_global_init(argc, argv); msg_global = xbt_new0(s_MSG_Global_t, 1); diff --git a/src/simdag/sd_global.c b/src/simdag/sd_global.c index 17d7ae5d5f..27e445f363 100644 --- a/src/simdag/sd_global.c +++ b/src/simdag/sd_global.c @@ -73,6 +73,11 @@ static void sd_config_init(void) if (_sd_init_status) return; /* Already inited, nothing to do */ + /* Connect our log channels: that must be done manually under windows */ + XBT_LOG_CONNECT(sd_kernel, sd); + XBT_LOG_CONNECT(sd_task, sd); + XBT_LOG_CONNECT(sd_workstation, sd); + _sd_init_status = 1; _sd_cfg_set = xbt_cfg_new(); diff --git a/src/simix/smx_config.c b/src/simix/smx_config.c index 044e2b6fc7..77d690fb10 100644 --- a/src/simix/smx_config.c +++ b/src/simix/smx_config.c @@ -66,6 +66,15 @@ void simix_config_init(void) if (_simix_init_status) return; /* Already inited, nothing to do */ + /* Connect our log channels: that must be done manually under windows */ + XBT_LOG_CONNECT(simix_action, simix); + XBT_LOG_CONNECT(simix_deployment, simix); + XBT_LOG_CONNECT(simix_environment, simix); + XBT_LOG_CONNECT(simix_host, simix); + XBT_LOG_CONNECT(simix_kernel, simix); + XBT_LOG_CONNECT(simix_process, simix); + XBT_LOG_CONNECT(simix_synchro, simix); + _simix_init_status = 1; _simix_cfg_set = xbt_cfg_new(); diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index d923982079..c119790d33 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -43,6 +43,16 @@ void smpi_mpi_init() int i; smpi_host_data_t hdata; + /* Connect our log channels: that must be done manually under windows */ + /* (should be done only once, not for each process) */ + XBT_LOG_CONNECT(smpi_base, smpi); + XBT_LOG_CONNECT(smpi_bench, smpi); + XBT_LOG_CONNECT(smpi_kernel, smpi); + XBT_LOG_CONNECT(smpi_mpi, smpi); + XBT_LOG_CONNECT(smpi_receiver, smpi); + XBT_LOG_CONNECT(smpi_sender, smpi); + XBT_LOG_CONNECT(smpi_util, smpi); + SIMIX_mutex_lock(smpi_global->running_hosts_count_mutex); smpi_global->running_hosts_count++; SIMIX_mutex_unlock(smpi_global->running_hosts_count_mutex); diff --git a/src/surf/surf.c b/src/surf/surf.c index 83bfde3806..b46ade33ab 100644 --- a/src/surf/surf.c +++ b/src/surf/surf.c @@ -307,6 +307,20 @@ void surf_init(int *argc, char **argv) const char *initial_path; + /* Connect our log channels: that must be done manually under windows */ + XBT_LOG_CONNECT(surf_cpu, surf); + XBT_LOG_CONNECT(surf_kernel, surf); + XBT_LOG_CONNECT(surf_lagrange_dichotomy, surf_lagrange); + XBT_LOG_CONNECT(surf_lagrange, surf); + XBT_LOG_CONNECT(surf_maxmin, surf); + XBT_LOG_CONNECT(surf_network_gtnets, surf); + XBT_LOG_CONNECT(surf_network, surf); + XBT_LOG_CONNECT(surf_parse, surf); + XBT_LOG_CONNECT(surf_sdp_out, surf); + XBT_LOG_CONNECT(surf_sdp, surf); + XBT_LOG_CONNECT(surf_timer, surf); + XBT_LOG_CONNECT(surf_workstation, surf); + xbt_init(argc, argv); if (!surf_path) { diff --git a/src/xbt/xbt_main.c b/src/xbt/xbt_main.c index bba945cbee..00de65f09e 100644 --- a/src/xbt/xbt_main.c +++ b/src/xbt/xbt_main.c @@ -31,6 +31,31 @@ xbt_init(int *argc, char **argv) { if (xbt_initialized!=1) return; + /* Connect our log channels: that must be done manually under windows */ + XBT_LOG_CONNECT(graphxml_parse, xbt); + XBT_LOG_CONNECT(log, xbt); + XBT_LOG_CONNECT(module, xbt); + XBT_LOG_CONNECT(peer, xbt); + XBT_LOG_CONNECT(strbuff, xbt); + XBT_LOG_CONNECT(xbt_cfg, xbt); + XBT_LOG_CONNECT(xbt_dict_add, xbt_dict); + XBT_LOG_CONNECT(xbt_dict_collapse, xbt_dict); + XBT_LOG_CONNECT(xbt_dict_cursor, xbt_dict); + XBT_LOG_CONNECT(xbt_dict_elm, xbt_dict); + XBT_LOG_CONNECT(xbt_dict_multi, xbt_dict); + XBT_LOG_CONNECT(xbt_dict_remove, xbt_dict); + XBT_LOG_CONNECT(xbt_dict_search, xbt_dict); + XBT_LOG_CONNECT(xbt_dict, xbt); + XBT_LOG_CONNECT(xbt_dyn, xbt); + XBT_LOG_CONNECT(xbt_ex, xbt); + XBT_LOG_CONNECT(xbt_fifo, xbt); + XBT_LOG_CONNECT(xbt_graph, xbt); + XBT_LOG_CONNECT(xbt_matrix, xbt); + XBT_LOG_CONNECT(xbt_queue, xbt); + XBT_LOG_CONNECT(xbt_set, xbt); + XBT_LOG_CONNECT(xbt_sync_os, xbt); + XBT_LOG_CONNECT(xbt_sync_rl, xbt); + xbt_binary_name = xbt_strdup(argv[0]); srand((unsigned int)time(NULL)); VERB0("Initialize XBT"); -- 2.20.1