Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
test of sd_test
[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_enabled())
19 #define IS_TRACING_PLATFORM   (_TRACE_platform_enabled())
20 #define IS_TRACING_PROCESSES  (_TRACE_msg_process_enabled())
21 #define IS_TRACING_VOLUME     (_TRACE_msg_volume_enabled())
22 #define IS_TRACING_SMPI       (_TRACE_smpi_enabled())
23
24 #include "instr/instr.h"
25 #include "msg/msg.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, const char *name);
33 void pajeDefineStateType(const char *alias, const char *containerType, const char *name);
34 void pajeDefineEventType(const char *alias, const char *containerType, const char *name);
35 void pajeDefineLinkType(const char *alias, const char *containerType, const char *sourceContainerType, const char *destContainerType, const char *name);
36 void pajeCreateContainer(double time, const char *alias, const char *type, const char *container, const char *name);
37 void pajeCreateContainerWithPower (double time, const char *alias, const char *type, const char *container, const char *name, double power);
38 void pajeCreateContainerWithBandwidthLatency (double time, const char *alias, const char *type, const char *container, const char *name, double bw, double lat);
39 void pajeCreateContainerWithBandwidthLatencySrcDst (double time, const char *alias, const char *type, const char *container, const char *name, double bw, double lat, const char *src, const char *dst);
40 void pajeDestroyContainer (double time, const char *type, const char *container);
41 void pajeSetState (double time, const char *entityType, const char *container, const char *value);
42 void pajeSetStateWithPowerUsed (double time, const char *entityType, const char *container, const char *value, double powerUsed);
43 void pajeSetStateWithHost (double time, const char *entityType, const char *container, const char *value, const char *host);
44 void pajePushState (double time, const char *entityType, const char *container, const char *value);
45 void pajePushStateWithHost (double time, const char *entityType, const char *container, const char *value, const char *host);
46 void pajePushStateWithPowerUsed (double time, const char *entityType, const char *container, const char *value, double powerUsed);
47 void pajePushStateWithBandwidthUsed (double time, const char *entityType, const char *container, const char *value, double bwUsed);
48 void pajePopState (double time, const char *entityType, const char *container);
49 void pajeStartLink (double time, const char *entityType, const char *container, const char *value, const char *sourceContainer, const char *key);
50 void pajeStartLinkWithBandwidthLatency (double time, const char *entityType, const char *container, const char *value, const char *sourceContainer, const char *key, double bw, double lat);
51 void pajeStartLinkWithVolume (double time, const char *entityType, const char *container, const char *value, const char *sourceContainer, const char *key, double volume);
52 void pajeEndLink (double time, const char *entityType, const char *container, const char *value, const char *destContainer, const char *key);
53 void pajeDefineVariableType(const char *alias, const char *containerType, const char *name);
54 void pajeSetVariable (double time, const char *entityType, const char *container, const char *value);
55 void pajeAddVariable (double time, const char *entityType, const char *container, const char *value);
56 void pajeSubVariable (double time, const char *entityType, const char *container, const char *value);
57 void pajeNewEvent (double time, const char *entityType, const char *container, const char *value);
58
59 /* from general.c */
60 char *TRACE_paje_msg_container (m_task_t task, char *host, char *output, int len);
61 char *TRACE_paje_smx_container (smx_action_t action, int seqnumber, char *host, char *output, int len);
62 char *TRACE_paje_surf_container (void *action, int seqnumber, char *output, int len);
63 char *TRACE_host_container (m_host_t host, char *output, int len);
64 char *TRACE_task_container (m_task_t task, char *output, int len);
65 char *TRACE_process_container (m_process_t process, char *output, int len);
66 char *TRACE_process_alias_container (m_process_t process, m_host_t host, char *output, int len);
67 char *TRACE_task_alias_container (m_task_t task, m_process_t process, m_host_t host, char *output, int len);
68
69 /* from categories.c */
70 void __TRACE_category_init (void);
71 void __TRACE_category_set (smx_process_t proc, const char *category);
72 char *__TRACE_category_get (smx_process_t proc);
73 void __TRACE_category_unset (smx_process_t proc);
74 void __TRACE_msg_category_set (smx_process_t proc, m_task_t task);
75
76 /* declaration of instrumentation functions from msg_task_instr.c */
77 void __TRACE_msg_init (void);
78 void __TRACE_task_location (m_task_t task);
79 void __TRACE_task_location_present (m_task_t task);
80 void __TRACE_task_location_not_present (m_task_t task);
81 void TRACE_msg_task_create (m_task_t task);
82 void TRACE_msg_task_execute_start (m_task_t task);
83 void TRACE_msg_task_execute_end (m_task_t task);
84 void TRACE_msg_task_destroy (m_task_t task);
85 void TRACE_msg_task_get_start(void);
86 void TRACE_msg_task_get_end (double start_time, m_task_t task);
87 int TRACE_msg_task_put_start (m_task_t task); //returns TRUE if the task_put_end must be called
88 void TRACE_msg_task_put_end (void);
89
90 /* declaration of instrumentation functions from msg_process_instr.c */
91 void __TRACE_msg_process_init (void);
92 void __TRACE_msg_process_location (m_process_t process);
93 void __TRACE_msg_process_present (m_process_t process);
94 void TRACE_msg_process_change_host (m_process_t process, m_host_t old_host, m_host_t new_host);
95 void TRACE_msg_process_kill (m_process_t process);
96 void TRACE_msg_process_suspend (m_process_t process);
97 void TRACE_msg_process_resume (m_process_t process);
98 void TRACE_msg_process_sleep_in (m_process_t process); //called from msg/gos.c
99 void TRACE_msg_process_sleep_out (m_process_t process);
100 void TRACE_msg_process_end (m_process_t process);
101
102 /* declaration of instrumentation functions from msg_volume.c */
103 void __TRACE_msg_volume_start (m_task_t task);
104 void __TRACE_msg_volume_finish (m_task_t task);
105
106 /* from smx.c */
107 void TRACE_smx_action_execute (smx_action_t act);
108 void TRACE_smx_action_communicate (smx_action_t act, smx_process_t proc);
109 void TRACE_smx_action_destroy (smx_action_t act);
110
111 /* from surf.c */
112 void __TRACE_surf_init (void);
113 void __TRACE_surf_finalize (void);
114 void __TRACE_surf_check_variable_set_to_zero (double now, const char *variable, const char *resource);
115 void __TRACE_surf_set_resource_variable (double date, const char *variable, const char *resource, double value);
116 void TRACE_surf_host_declaration (char *name, double power);
117 void TRACE_surf_host_set_power (double date, char *resource, double power);
118 void TRACE_surf_host_define_id (const char *name, int host_id);
119 void TRACE_surf_host_vivaldi_parse (char *host, double x, double y, double h);
120 void TRACE_surf_link_declaration (char *name, double bw, double lat);
121 void TRACE_surf_link_set_bandwidth (double date, char *resource, double bandwidth);
122 void TRACE_surf_link_set_latency (double date, char *resource, double latency);
123 void TRACE_surf_link_save_endpoints (char *link_name, int src, int dst);
124 void TRACE_surf_link_missing (void);
125 void TRACE_msg_clean (void);
126
127 //for tracing gtnets
128 void TRACE_surf_gtnets_communicate (void *action, int src, int dst);
129 int TRACE_surf_gtnets_get_src (void *action);
130 int TRACE_surf_gtnets_get_dst (void *action);
131 void TRACE_surf_gtnets_destroy (void *action);
132
133 /* from smpi_instr.c */
134 void __TRACE_smpi_init (void);
135 void TRACE_smpi_init (int rank);
136 void TRACE_smpi_finalize (int rank);
137 void TRACE_smpi_start (void);
138 void TRACE_smpi_end (void);
139 void TRACE_smpi_collective_in (int rank, int root, const char *operation);
140 void TRACE_smpi_collective_out (int rank, int root, const char *operation);
141 void TRACE_smpi_ptp_in (int rank, int src, int dst, const char *operation);
142 void TRACE_smpi_ptp_out (int rank, int src, int dst, const char *operation);
143 void TRACE_smpi_send (int rank, int src, int dst);
144 void TRACE_smpi_recv (int rank, int src, int dst);
145
146 /* from instr_config.c */
147 int _TRACE_configured (void);
148 int _TRACE_smpi_enabled (void);
149 int _TRACE_platform_enabled (void);
150 int _TRACE_msg_task_enabled (void);
151 int _TRACE_msg_process_enabled (void);
152 int _TRACE_msg_volume_enabled (void);
153 char *_TRACE_filename (void);
154 char *_TRACE_platform_method (void);
155 void TRACE_global_init(int *argc, char **argv);
156
157 /* from resource_utilization.c */
158 void TRACE_surf_host_set_utilization (const char *name, smx_action_t smx_action, double value, double now, double delta);
159 void TRACE_surf_link_set_utilization (const char *name, smx_action_t smx_action, double value, double now, double delta);
160 void __TRACE_surf_resource_utilization_start (smx_action_t action);
161 void __TRACE_surf_resource_utilization_event (smx_action_t action, double now, double delta, const char *variable, const char *resource, double value);
162 void __TRACE_surf_resource_utilization_end (smx_action_t action);
163 void __TRACE_surf_resource_utilization_initialize (void);
164 void __TRACE_surf_resource_utilization_finalize (void);
165
166 #endif
167
168 #endif /* PRIVATE_H_ */