Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
change mmalloc.h into a public header
[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 "instr/tracing_config.h"
11
12 #ifdef HAVE_TRACING
13
14 extern int tracing_active; /* declared in paje.c */
15 extern int trace_mask; /* declared in interface.c */
16
17 #define IS_TRACING                        (tracing_active)
18 #define IS_TRACED(n)          (n->category)
19 #define IS_TRACING_TASKS      ((TRACE_TASK)&trace_mask)
20 #define IS_TRACING_PLATFORM   ((TRACE_PLATFORM)&trace_mask)
21 #define IS_TRACING_PROCESSES  ((TRACE_PROCESS)&trace_mask)
22 #define IS_TRACING_VOLUME     ((TRACE_VOLUME)&trace_mask)
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
58 /* from general.c */
59 char *TRACE_paje_msg_container (m_task_t task, char *host, char *output, int len);
60 char *TRACE_paje_smx_container (smx_action_t action, int seqnumber, char *host, char *output, int len);
61 char *TRACE_paje_surf_container (void *action, int seqnumber, char *output, int len);
62 char *TRACE_host_container (m_host_t host, char *output, int len);
63 char *TRACE_task_container (m_task_t task, char *output, int len);
64 char *TRACE_process_container (m_process_t process, char *output, int len);
65 char *TRACE_process_alias_container (m_process_t process, m_host_t host, char *output, int len);
66 char *TRACE_task_alias_container (m_task_t task, m_process_t process, m_host_t host, char *output, int len);
67
68 /* declaration of instrumentation functions from msg_task_instr.c */
69 void __TRACE_msg_init (void);
70 void __TRACE_current_category_set (m_task_t task);
71 void __TRACE_current_category_unset (void);
72 char *__TRACE_current_category_get (smx_process_t proc);
73 void __TRACE_task_location (m_task_t task);
74 void __TRACE_task_location_present (m_task_t task);
75 void __TRACE_task_location_not_present (m_task_t task);
76 void TRACE_msg_task_create (m_task_t task);
77 void TRACE_msg_task_execute_start (m_task_t task);
78 void TRACE_msg_task_execute_end (m_task_t task);
79 void TRACE_msg_task_destroy (m_task_t task);
80 void TRACE_msg_task_get_start(void);
81 void TRACE_msg_task_get_end (double start_time, m_task_t task);
82 int TRACE_msg_task_put_start (m_task_t task); //returns TRUE if the task_put_end must be called
83 void TRACE_msg_task_put_end (void);
84
85 /* declaration of instrumentation functions from msg_process_instr.c */
86 void __TRACE_msg_process_init (void);
87 void __TRACE_msg_process_location (m_process_t process);
88 void __TRACE_msg_process_present (m_process_t process);
89 void TRACE_msg_process_change_host (m_process_t process, m_host_t old_host, m_host_t new_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);
96
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);
100
101 /* from smx.c */
102 void TRACE_smx_action_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);
105
106 /* from surf.c */
107 void __TRACE_surf_init (void);
108 void __TRACE_surf_finalize (void);
109 void __TRACE_surf_check_variable_set_to_zero (double now, const char *variable, const char *resource);
110 void __TRACE_surf_update_action_state_resource (double now, double delta, const char *type, const char *name, double value);
111 void __TRACE_surf_set_resource_variable (double date, const char *variable, const char *resource, double value);
112 void TRACE_surf_host_declaration (char *name, double power);
113 void TRACE_surf_host_set_power (double date, char *resource, double power);
114 void TRACE_surf_host_set_utilization (const char *name, smx_action_t smx_action, double value, double now, double delta);
115 void TRACE_surf_host_define_id (const char *name, int host_id);
116 void TRACE_surf_host_vivaldi_parse (char *host, double x, double y, double h);
117 void TRACE_surf_link_declaration (char *name, double bw, double lat);
118 void TRACE_surf_link_set_bandwidth (double date, char *resource, double bandwidth);
119 void TRACE_surf_link_set_latency (double date, char *resource, double latency);
120 void TRACE_surf_link_set_utilization (const char *name, smx_action_t smx_action, double value, double now, double delta);
121 void TRACE_surf_link_save_endpoints (char *link_name, int src, int dst);
122 void TRACE_surf_link_missing (void);
123 void TRACE_msg_clean (void);
124
125 //for tracing gtnets
126 void TRACE_surf_gtnets_communicate (void *action, int src, int dst);
127 int TRACE_surf_gtnets_get_src (void *action);
128 int TRACE_surf_gtnets_get_dst (void *action);
129 void TRACE_surf_gtnets_destroy (void *action);
130
131 #endif
132
133 #endif /* PRIVATE_H_ */