Logo AND Algorithmique Numérique Distribuée

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