Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
57a9ee9fbcddf92ce266d47e70d0f687a36aa05e
[simgrid.git] / src / instr / instr_config.c
1 /* Copyright (c) 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7
8 #include "instr/private.h"
9
10 #ifdef HAVE_TRACING
11
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"
18
19 int _TRACE_smpi_enabled (void)
20 {
21   return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI);
22 }
23
24 int _TRACE_platform_enabled (void)
25 {
26   return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_PLATFORM);
27 }
28
29 int _TRACE_msg_task_enabled (void)
30 {
31   return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_TASK);
32 }
33
34 int _TRACE_msg_process_enabled (void)
35 {
36   return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_PROCESS);
37 }
38
39 int _TRACE_msg_volume_enabled (void)
40 {
41   return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_VOLUME);
42 }
43
44 char *_TRACE_filename (void)
45 {
46   return xbt_cfg_get_string (_surf_cfg_set, OPT_TRACING_FILENAME);
47 }
48
49 void TRACE_global_init(int *argc, char **argv)
50 {
51   /* name of the tracefile */
52   char *default_tracing_filename = xbt_strdup("simgrid.trace");
53   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_FILENAME,
54                     "Trace file created by the instrumented SimGrid.",
55                     xbt_cfgelm_string, &default_tracing_filename, 1, 1,
56                     NULL, NULL);
57
58   /* smpi */
59   int default_tracing_smpi = 0;
60   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_SMPI,
61                    "Tracing of the SMPI interface.",
62                    xbt_cfgelm_int, &default_tracing_smpi, 0, 1,
63                    NULL, NULL);
64
65   /* platform */
66   int default_tracing_platform = 0;
67   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_PLATFORM,
68                    "Tracing of categorized platform (host and link) utilization.",
69                    xbt_cfgelm_int, &default_tracing_platform, 0, 1,
70                    NULL, NULL);
71
72   /* msg task */
73   int default_tracing_msg_task = 0;
74   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_MSG_TASK,
75                    "Tracing of MSG task behavior.",
76                    xbt_cfgelm_int, &default_tracing_msg_task, 0, 1,
77                    NULL, NULL);
78
79   /* msg process */
80   int default_tracing_msg_process = 0;
81   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_MSG_PROCESS,
82                    "Tracing of MSG process behavior.",
83                    xbt_cfgelm_int, &default_tracing_msg_process, 0, 1,
84                    NULL, NULL);
85
86   /* msg volume (experimental) */
87   int default_tracing_msg_volume = 0;
88   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_MSG_VOLUME,
89                    "Tracing of MSG communication volume (experimental).",
90                    xbt_cfgelm_int, &default_tracing_msg_volume, 0, 1,
91                    NULL, NULL);
92 }
93
94 #endif