Logo AND Algorithmique Numérique Distribuée

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