Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics on tracing mechanism
[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_is_enabled())
19 #define IS_TRACING_PLATFORM   (TRACE_platform_is_enabled())
20 #define IS_TRACING_PROCESSES  (TRACE_msg_process_is_enabled())
21 #define IS_TRACING_VOLUME     (TRACE_msg_volume_is_enabled())
22 #define IS_TRACING_SMPI       (TRACE_smpi_is_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_alloc (void);
62 void TRACE_category_release (void);
63 void TRACE_category_set (smx_process_t proc, const char *category);
64 char *TRACE_category_get (smx_process_t proc);
65 void TRACE_category_unset (smx_process_t proc);
66 void TRACE_msg_category_set (smx_process_t proc, m_task_t task);
67
68 /* declaration of instrumentation functions from msg_task_instr.c */
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 void TRACE_msg_process_alloc (void);
82 void TRACE_msg_process_release (void);
83 void TRACE_msg_process_change_host (m_process_t process, m_host_t old_host, m_host_t new_host);
84 void TRACE_msg_process_kill (m_process_t process);
85 void TRACE_msg_process_suspend (m_process_t process);
86 void TRACE_msg_process_resume (m_process_t process);
87 void TRACE_msg_process_sleep_in (m_process_t process); //called from msg/gos.c
88 void TRACE_msg_process_sleep_out (m_process_t process);
89 void TRACE_msg_process_end (m_process_t process);
90
91 /* declaration of instrumentation functions from msg_volume.c */
92 void TRACE_msg_volume_start (m_task_t task);
93 void TRACE_msg_volume_finish (m_task_t task);
94
95 /* from smx.c */
96 void TRACE_smx_action_execute (smx_action_t act);
97 void TRACE_smx_action_communicate (smx_action_t act, smx_process_t proc);
98 void TRACE_smx_action_destroy (smx_action_t act);
99
100 /* from surf.c */
101 void TRACE_surf_alloc (void);
102 void TRACE_surf_release (void);
103 void TRACE_surf_host_declaration (char *name, double power);
104 void TRACE_surf_host_set_power (double date, char *resource, double power);
105 void TRACE_surf_host_define_id (const char *name, int host_id);
106 void TRACE_surf_host_vivaldi_parse (char *host, double x, double y, double h);
107 void TRACE_surf_link_declaration (void *link, char *name, double bw, double lat);
108 void TRACE_surf_link_set_bandwidth (double date, void *link, double bandwidth);
109 void TRACE_surf_link_set_latency (double date, void *link, double latency);
110 void TRACE_surf_save_onelink (void);
111 int TRACE_surf_link_is_traced (void *link);
112
113 //for tracing gtnets
114 void TRACE_surf_gtnets_communicate (void *action, int src, int dst);
115 int TRACE_surf_gtnets_get_src (void *action);
116 int TRACE_surf_gtnets_get_dst (void *action);
117 void TRACE_surf_gtnets_destroy (void *action);
118
119 /* from smpi_instr.c */
120 void TRACE_smpi_alloc (void);
121 void TRACE_smpi_release (void);
122 void TRACE_smpi_init (int rank);
123 void TRACE_smpi_finalize (int rank);
124 void TRACE_smpi_start (void);
125 void TRACE_smpi_collective_in (int rank, int root, const char *operation);
126 void TRACE_smpi_collective_out (int rank, int root, const char *operation);
127 void TRACE_smpi_ptp_in (int rank, int src, int dst, const char *operation);
128 void TRACE_smpi_ptp_out (int rank, int src, int dst, const char *operation);
129 void TRACE_smpi_send (int rank, int src, int dst);
130 void TRACE_smpi_recv (int rank, int src, int dst);
131
132 /* from instr_config.c */
133 int TRACE_is_configured (void);
134 int TRACE_smpi_is_enabled (void);
135 int TRACE_platform_is_enabled (void);
136 int TRACE_msg_task_is_enabled (void);
137 int TRACE_msg_process_is_enabled (void);
138 int TRACE_msg_volume_is_enabled (void);
139 char *TRACE_get_filename (void);
140 char *TRACE_get_platform_method (void);
141 void TRACE_global_init(int *argc, char **argv);
142
143 /* from resource_utilization.c */
144 void TRACE_surf_host_set_utilization (const char *name, smx_action_t smx_action, double value, double now, double delta);
145 void TRACE_surf_link_set_utilization (void *link, smx_action_t smx_action, double value, double now, double delta);
146 void TRACE_surf_resource_utilization_start (smx_action_t action);
147 void TRACE_surf_resource_utilization_event (smx_action_t action, double now, double delta, const char *variable, const char *resource, double value);
148 void TRACE_surf_resource_utilization_end (smx_action_t action);
149 void TRACE_surf_resource_utilization_alloc (void);
150 void TRACE_surf_resource_utilization_release (void);
151
152 #endif
153
154 #endif /* PRIVATE_H_ */