1 /* Copyright (c) 2010. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include "instr/private.h"
12 #define OPT_TRACING_SMPI "tracing/smpi"
13 #define OPT_TRACING_PLATFORM "tracing/platform"
14 #define OPT_TRACING_MSG_TASK "tracing/msg/task"
15 #define OPT_TRACING_MSG_PROCESS "tracing/msg/process"
16 #define OPT_TRACING_MSG_VOLUME "tracing/msg/volume"
17 #define OPT_TRACING_FILENAME "tracing/filename"
19 static int trace_configured = 0;
21 int _TRACE_configured (void)
23 return trace_configured;
26 int _TRACE_smpi_enabled (void)
28 return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI);
31 int _TRACE_platform_enabled (void)
33 return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_PLATFORM);
36 int _TRACE_msg_task_enabled (void)
38 return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_TASK);
41 int _TRACE_msg_process_enabled (void)
43 return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_PROCESS);
46 int _TRACE_msg_volume_enabled (void)
48 return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_VOLUME);
51 char *_TRACE_filename (void)
53 return xbt_cfg_get_string (_surf_cfg_set, OPT_TRACING_FILENAME);
56 void TRACE_global_init(int *argc, char **argv)
58 /* name of the tracefile */
59 char *default_tracing_filename = xbt_strdup("simgrid.trace");
60 xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_FILENAME,
61 "Trace file created by the instrumented SimGrid.",
62 xbt_cfgelm_string, &default_tracing_filename, 1, 1,
66 int default_tracing_smpi = 0;
67 xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_SMPI,
68 "Tracing of the SMPI interface.",
69 xbt_cfgelm_int, &default_tracing_smpi, 0, 1,
73 int default_tracing_platform = 0;
74 xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_PLATFORM,
75 "Tracing of categorized platform (host and link) utilization.",
76 xbt_cfgelm_int, &default_tracing_platform, 0, 1,
80 int default_tracing_msg_task = 0;
81 xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_MSG_TASK,
82 "Tracing of MSG task behavior.",
83 xbt_cfgelm_int, &default_tracing_msg_task, 0, 1,
87 int default_tracing_msg_process = 0;
88 xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_MSG_PROCESS,
89 "Tracing of MSG process behavior.",
90 xbt_cfgelm_int, &default_tracing_msg_process, 0, 1,
93 /* msg volume (experimental) */
94 int default_tracing_msg_volume = 0;
95 xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_MSG_VOLUME,
96 "Tracing of MSG communication volume (experimental).",
97 xbt_cfgelm_int, &default_tracing_msg_volume, 0, 1,
100 /* instrumentation can be considered configured now */
101 trace_configured = 1;