Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
trace: a dictionary to keep link keys, put and get functions to manage it
[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 /* declaration of instrumentation functions from msg_task_instr.c */
70 void __TRACE_msg_init (void);
71 void __TRACE_current_category_set (m_task_t task);
72 void __TRACE_current_category_unset (void);
73 char *__TRACE_current_category_get (smx_process_t proc);
74 void __TRACE_task_location (m_task_t task);
75 void __TRACE_task_location_present (m_task_t task);
76 void __TRACE_task_location_not_present (m_task_t task);
77 void TRACE_msg_task_create (m_task_t task);
78 void TRACE_msg_task_execute_start (m_task_t task);
79 void TRACE_msg_task_execute_end (m_task_t task);
80 void TRACE_msg_task_destroy (m_task_t task);
81 void TRACE_msg_task_get_start(void);
82 void TRACE_msg_task_get_end (double start_time, m_task_t task);
83 int TRACE_msg_task_put_start (m_task_t task); //returns TRUE if the task_put_end must be called
84 void TRACE_msg_task_put_end (void);
85
86 /* declaration of instrumentation functions from msg_process_instr.c */
87 void __TRACE_msg_process_init (void);
88 void __TRACE_msg_process_location (m_process_t process);
89 void __TRACE_msg_process_present (m_process_t process);
90 void TRACE_msg_process_change_host (m_process_t process, m_host_t old_host, m_host_t new_host);
91 void TRACE_msg_process_kill (m_process_t process);
92 void TRACE_msg_process_suspend (m_process_t process);
93 void TRACE_msg_process_resume (m_process_t process);
94 void TRACE_msg_process_sleep_in (m_process_t process); //called from msg/gos.c
95 void TRACE_msg_process_sleep_out (m_process_t process);
96 void TRACE_msg_process_end (m_process_t process);
97
98 /* declaration of instrumentation functions from msg_volume.c */
99 void __TRACE_msg_volume_start (m_task_t task);
100 void __TRACE_msg_volume_finish (m_task_t task);
101
102 /* from smx.c */
103 void TRACE_smx_action_execute (smx_action_t act);
104 void TRACE_smx_action_communicate (smx_action_t act, smx_process_t proc);
105 void TRACE_smx_action_destroy (smx_action_t act);
106
107 /* from surf.c */
108 void __TRACE_surf_init (void);
109 void __TRACE_surf_finalize (void);
110 void __TRACE_surf_check_variable_set_to_zero (double now, const char *variable, const char *resource);
111 void __TRACE_surf_update_action_state_resource (double now, double delta, const char *type, const char *name, double value);
112 void __TRACE_surf_set_resource_variable (double date, const char *variable, const char *resource, double value);
113 void TRACE_surf_host_declaration (char *name, double power);
114 void TRACE_surf_host_set_power (double date, char *resource, double power);
115 void TRACE_surf_host_set_utilization (const char *name, smx_action_t smx_action, double value, double now, double delta);
116 void TRACE_surf_host_define_id (const char *name, int host_id);
117 void TRACE_surf_host_vivaldi_parse (char *host, double x, double y, double h);
118 void TRACE_surf_link_declaration (char *name, double bw, double lat);
119 void TRACE_surf_link_set_bandwidth (double date, char *resource, double bandwidth);
120 void TRACE_surf_link_set_latency (double date, char *resource, double latency);
121 void TRACE_surf_link_set_utilization (const char *name, smx_action_t smx_action, double value, double now, double delta);
122 void TRACE_surf_link_save_endpoints (char *link_name, int src, int dst);
123 void TRACE_surf_link_missing (void);
124 void TRACE_msg_clean (void);
125
126 //for tracing gtnets
127 void TRACE_surf_gtnets_communicate (void *action, int src, int dst);
128 int TRACE_surf_gtnets_get_src (void *action);
129 int TRACE_surf_gtnets_get_dst (void *action);
130 void TRACE_surf_gtnets_destroy (void *action);
131
132 /* from smpi_instr.c */
133 void __TRACE_smpi_init (void);
134 void TRACE_smpi_init (int rank);
135 void TRACE_smpi_finalize (int rank);
136 void TRACE_smpi_start (void);
137 void TRACE_smpi_end (void);
138 void TRACE_smpi_collective_in (int rank, int root, const char *operation);
139 void TRACE_smpi_collective_out (int rank, int root, const char *operation);
140
141 /* from instr_config.c */
142 int _TRACE_configured (void);
143 int _TRACE_smpi_enabled (void);
144 int _TRACE_platform_enabled (void);
145 int _TRACE_msg_task_enabled (void);
146 int _TRACE_msg_process_enabled (void);
147 int _TRACE_msg_volume_enabled (void);
148 char *_TRACE_filename (void);
149 void TRACE_global_init(int *argc, char **argv);
150
151
152 #endif
153
154 #endif /* PRIVATE_H_ */