From 81582ff1ff2a61ab0a5a98a01174b7ba522d7414 Mon Sep 17 00:00:00 2001 From: schnorr Date: Thu, 5 Aug 2010 11:06:11 +0000 Subject: [PATCH] declaration of configuration options for tracing git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8109 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- buildtools/Cmake/DefinePackages.cmake | 1 + src/instr/instr_config.c | 94 +++++++++++++++++++++++++++ src/instr/private.h | 10 +++ 3 files changed, 105 insertions(+) create mode 100644 src/instr/instr_config.c diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index a75cfa9dba..4bc1faace3 100755 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -324,6 +324,7 @@ set(LUA_SRC ) set(TRACING_SRC + src/instr/instr_config.c src/instr/interface.c src/instr/general.c src/instr/paje.c diff --git a/src/instr/instr_config.c b/src/instr/instr_config.c new file mode 100644 index 0000000000..57a9ee9fbc --- /dev/null +++ b/src/instr/instr_config.c @@ -0,0 +1,94 @@ +/* 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 + +#define OPT_TRACING_SMPI "tracing/smpi" +#define OPT_TRACING_PLATFORM "tracing/platform" +#define OPT_TRACING_MSG_TASK "tracing/msg/task" +#define OPT_TRACING_MSG_PROCESS "tracing/msg/process" +#define OPT_TRACING_MSG_VOLUME "tracing/msg/volume" +#define OPT_TRACING_FILENAME "tracing/filename" + +int _TRACE_smpi_enabled (void) +{ + return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI); +} + +int _TRACE_platform_enabled (void) +{ + return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_PLATFORM); +} + +int _TRACE_msg_task_enabled (void) +{ + return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_TASK); +} + +int _TRACE_msg_process_enabled (void) +{ + return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_PROCESS); +} + +int _TRACE_msg_volume_enabled (void) +{ + return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_VOLUME); +} + +char *_TRACE_filename (void) +{ + return xbt_cfg_get_string (_surf_cfg_set, OPT_TRACING_FILENAME); +} + +void TRACE_global_init(int *argc, char **argv) +{ + /* name of the tracefile */ + char *default_tracing_filename = xbt_strdup("simgrid.trace"); + xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_FILENAME, + "Trace file created by the instrumented SimGrid.", + xbt_cfgelm_string, &default_tracing_filename, 1, 1, + NULL, NULL); + + /* smpi */ + int default_tracing_smpi = 0; + xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_SMPI, + "Tracing of the SMPI interface.", + xbt_cfgelm_int, &default_tracing_smpi, 0, 1, + NULL, NULL); + + /* platform */ + int default_tracing_platform = 0; + xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_PLATFORM, + "Tracing of categorized platform (host and link) utilization.", + xbt_cfgelm_int, &default_tracing_platform, 0, 1, + NULL, NULL); + + /* msg task */ + int default_tracing_msg_task = 0; + xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_MSG_TASK, + "Tracing of MSG task behavior.", + xbt_cfgelm_int, &default_tracing_msg_task, 0, 1, + NULL, NULL); + + /* msg process */ + int default_tracing_msg_process = 0; + xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_MSG_PROCESS, + "Tracing of MSG process behavior.", + xbt_cfgelm_int, &default_tracing_msg_process, 0, 1, + NULL, NULL); + + /* msg volume (experimental) */ + int default_tracing_msg_volume = 0; + xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_MSG_VOLUME, + "Tracing of MSG communication volume (experimental).", + xbt_cfgelm_int, &default_tracing_msg_volume, 0, 1, + NULL, NULL); +} + +#endif diff --git a/src/instr/private.h b/src/instr/private.h index 52ec5bc8e5..e3455ac9f6 100644 --- a/src/instr/private.h +++ b/src/instr/private.h @@ -129,6 +129,16 @@ int TRACE_surf_gtnets_get_src (void *action); int TRACE_surf_gtnets_get_dst (void *action); void TRACE_surf_gtnets_destroy (void *action); +/* from instr_config.c */ +int _TRACE_smpi_enabled (void); +int _TRACE_platform_enabled (void); +int _TRACE_msg_task_enabled (void); +int _TRACE_msg_process_enabled (void); +int _TRACE_msg_volume_enabled (void); +char *_TRACE_filename (void); +void TRACE_global_init(int *argc, char **argv); + + #endif #endif /* PRIVATE_H_ */ -- 2.20.1