Logo AND Algorithmique Numérique Distribuée

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