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