Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
new event to declare a variable type associated with a color
[simgrid.git] / src / instr / private.h
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 #ifndef INSTR_PRIVATE_H_
8 #define INSTR_PRIVATE_H_
9
10 #include "simgrid_config.h"
11
12 #ifdef HAVE_TRACING
13
14 extern int tracing_active;      /* declared in paje.c */
15
16 #define IS_TRACING                        (tracing_active)
17 #define IS_TRACED(n)          (n->category)
18 #define IS_TRACING_TASKS      (TRACE_msg_task_is_enabled())
19 #define IS_TRACING_PLATFORM   (TRACE_platform_is_enabled())
20 #define IS_TRACING_PROCESSES  (TRACE_msg_process_is_enabled())
21 #define IS_TRACING_VOLUME     (TRACE_msg_volume_is_enabled())
22 #define IS_TRACING_SMPI       (TRACE_smpi_is_enabled())
23
24 #define INSTR_DEFAULT_STR_SIZE 500
25
26 #include "instr/instr.h"
27 #include "msg/msg.h"
28 #include "simdag/private.h"
29 #include "simix/private.h"
30
31 /* from paje.c */
32 void TRACE_paje_create_header(void);
33 void TRACE_paje_start(FILE * file);
34 FILE *TRACE_paje_end(void);
35 void pajeDefineContainerType(const char *alias, const char *containerType,
36                              const char *name);
37 void pajeDefineStateType(const char *alias, const char *containerType,
38                          const char *name);
39 void pajeDefineEventType(const char *alias, const char *containerType,
40                          const char *name);
41 void pajeDefineLinkType(const char *alias, const char *containerType,
42                         const char *sourceContainerType,
43                         const char *destContainerType, const char *name);
44 void pajeCreateContainer(double time, const char *alias, const char *type,
45                          const char *container, const char *name);
46 void pajeDestroyContainer(double time, const char *type,
47                           const char *container);
48 void pajeSetState(double time, const char *entityType,
49                   const char *container, const char *value);
50 void pajePushState(double time, const char *entityType,
51                    const char *container, const char *value);
52 void pajePopState(double time, const char *entityType,
53                   const char *container);
54 void pajeStartLink(double time, const char *entityType,
55                    const char *container, const char *value,
56                    const char *sourceContainer, const char *key);
57 void pajeStartLinkWithVolume(double time, const char *entityType,
58                              const char *container, const char *value,
59                              const char *sourceContainer, const char *key,
60                              double volume);
61 void pajeEndLink(double time, const char *entityType,
62                  const char *container, const char *value,
63                  const char *destContainer, const char *key);
64 void pajeDefineVariableType(const char *alias, const char *containerType,
65                             const char *name);
66 void pajeDefineVariableTypeWithColor(const char *alias, const char *containerType,
67                             const char *name, const char *color);
68 void pajeSetVariable(double time, const char *entityType,
69                      const char *container, const char *value);
70 void pajeAddVariable(double time, const char *entityType,
71                      const char *container, const char *value);
72 void pajeSubVariable(double time, const char *entityType,
73                      const char *container, const char *value);
74 void pajeNewEvent(double time, const char *entityType,
75                   const char *container, const char *value);
76
77 /* from general.c */
78 char *TRACE_paje_msg_container(m_task_t task, char *host, char *output,
79                                int len);
80 char *TRACE_paje_smx_container(smx_action_t action, int seqnumber,
81                                char *host, char *output, int len);
82 char *TRACE_paje_surf_container(void *action, int seqnumber, char *output,
83                                 int len);
84 char *TRACE_host_container(m_host_t host, char *output, int len);
85 char *TRACE_task_container(m_task_t task, char *output, int len);
86 char *TRACE_process_container(m_process_t process, char *output, int len);
87 char *TRACE_process_alias_container(m_process_t process, m_host_t host,
88                                     char *output, int len);
89 char *TRACE_task_alias_container(m_task_t task, m_process_t process,
90                                  m_host_t host, char *output, int len);
91
92 /* from categories.c */
93 void TRACE_category_alloc(void);
94 void TRACE_category_release(void);
95 void TRACE_category_set(smx_process_t proc, const char *category);
96 char *TRACE_category_get(smx_process_t proc);
97 void TRACE_category_unset(smx_process_t proc);
98 void TRACE_msg_category_set(smx_process_t proc, m_task_t task);
99
100 /* declaration of instrumentation functions from msg_task_instr.c */
101 void TRACE_msg_task_alloc(void);
102 void TRACE_msg_task_release(void);
103 void TRACE_msg_task_create(m_task_t task);
104 void TRACE_msg_task_execute_start(m_task_t task);
105 void TRACE_msg_task_execute_end(m_task_t task);
106 void TRACE_msg_task_destroy(m_task_t task);
107 void TRACE_msg_task_get_start(void);
108 void TRACE_msg_task_get_end(double start_time, m_task_t task);
109 int TRACE_msg_task_put_start(m_task_t task);    //returns TRUE if the task_put_end must be called
110 void TRACE_msg_task_put_end(void);
111
112 /* declaration of instrumentation functions from msg_process_instr.c */
113 void TRACE_msg_process_alloc(void);
114 void TRACE_msg_process_release(void);
115 void TRACE_msg_process_change_host(m_process_t process, m_host_t old_host,
116                                    m_host_t new_host);
117 void TRACE_msg_process_kill(m_process_t process);
118 void TRACE_msg_process_suspend(m_process_t process);
119 void TRACE_msg_process_resume(m_process_t process);
120 void TRACE_msg_process_sleep_in(m_process_t process);   //called from msg/gos.c
121 void TRACE_msg_process_sleep_out(m_process_t process);
122 void TRACE_msg_process_end(m_process_t process);
123
124 /* declaration of instrumentation functions from msg_volume.c */
125 void TRACE_msg_volume_start(m_task_t task);
126 void TRACE_msg_volume_finish(m_task_t task);
127
128 /* from smx.c */
129 void TRACE_smx_action_execute(smx_action_t act);
130 void TRACE_smx_action_communicate(smx_action_t act, smx_process_t proc);
131 void TRACE_smx_action_destroy(smx_action_t act);
132
133 /* from surf_instr.c */
134 void TRACE_surf_alloc(void);
135 void TRACE_surf_release(void);
136 void TRACE_surf_host_declaration(const char *name, double power);
137 void TRACE_surf_host_set_power(double date, const char *resource,
138                                double power);
139 void TRACE_surf_host_define_id(const char *name, int host_id);
140 void TRACE_surf_host_vivaldi_parse(char *host, double x, double y,
141                                    double h);
142 void TRACE_surf_link_declaration(void *link, char *name, double bw,
143                                  double lat);
144 void TRACE_surf_link_set_bandwidth(double date, void *link,
145                                    double bandwidth);
146 void TRACE_surf_link_set_latency(double date, void *link, double latency);
147 void TRACE_surf_save_onelink(void);
148 int TRACE_surf_link_is_traced(void *link);
149 void TRACE_surf_action(surf_action_t surf_action, const char *category);
150
151 //for tracing gtnets
152 void TRACE_surf_gtnets_communicate(void *action, int src, int dst);
153 int TRACE_surf_gtnets_get_src(void *action);
154 int TRACE_surf_gtnets_get_dst(void *action);
155 void TRACE_surf_gtnets_destroy(void *action);
156
157 /* from smpi_instr.c */
158 void TRACE_smpi_alloc(void);
159 void TRACE_smpi_release(void);
160 void TRACE_smpi_init(int rank);
161 void TRACE_smpi_finalize(int rank);
162 void TRACE_smpi_start(void);
163 void TRACE_smpi_collective_in(int rank, int root, const char *operation);
164 void TRACE_smpi_collective_out(int rank, int root, const char *operation);
165 void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation);
166 void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation);
167 void TRACE_smpi_send(int rank, int src, int dst);
168 void TRACE_smpi_recv(int rank, int src, int dst);
169
170 /* from instr_config.c */
171 int TRACE_is_configured(void);
172 int TRACE_smpi_is_enabled(void);
173 int TRACE_smpi_is_grouped(void);
174 int TRACE_platform_is_enabled(void);
175 int TRACE_uncategorized (void);
176 int TRACE_msg_task_is_enabled(void);
177 int TRACE_msg_process_is_enabled(void);
178 int TRACE_msg_volume_is_enabled(void);
179 char *TRACE_get_filename(void);
180 char *TRACE_get_platform_method(void);
181 void TRACE_global_init(int *argc, char **argv);
182
183 /* from resource_utilization.c */
184 void TRACE_surf_host_set_utilization(const char *name,
185                                      smx_action_t smx_action,
186                                      surf_action_t surf_action,
187                                      double value, double now,
188                                      double delta);
189 void TRACE_surf_link_set_utilization(void *link, smx_action_t smx_action,
190                                      surf_action_t surf_action,
191                                      double value, double now,
192                                      double delta);
193 void TRACE_surf_resource_utilization_start(smx_action_t action);
194 void TRACE_surf_resource_utilization_event(smx_action_t action, double now,
195                                            double delta,
196                                            const char *variable,
197                                            const char *resource,
198                                            double value);
199 void TRACE_surf_resource_utilization_end(smx_action_t action);
200 void TRACE_surf_resource_utilization_alloc(void);
201 void TRACE_surf_resource_utilization_release(void);
202
203 /* sd_instr.c */
204 void TRACE_sd_task_create(SD_task_t task);
205 void TRACE_sd_task_destroy(SD_task_t task);
206
207 #endif
208
209 #endif                          /* PRIVATE_H_ */