Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
3bc538cb69edf8fe20bbcebce43c7e1b191f12c8
[simgrid.git] / src / instr / private.h
1 /*
2  * private.h
3  *
4  *  Created on: Nov 23, 2009
5  *      Author: Lucas Schnorr
6  *     License: This program is free software; you can redistribute
7  *              it and/or modify it under the terms of the license
8  *              (GNU LGPL) which comes with this package.
9  *
10  *     Copyright (c) 2009 The SimGrid team.
11  */
12
13 #ifndef INSTR_PRIVATE_H_
14 #define INSTR_PRIVATE_H_
15
16 #include "instr/tracing_config.h"
17
18 #ifdef HAVE_TRACING
19
20 extern int tracing_active; /* declared in paje.c */
21 extern int trace_mask; /* declared in interface.c */
22
23 #define IS_TRACING                        (tracing_active)
24 #define IS_TRACED(n)          (n->category)
25 #define IS_TRACING_TASKS      ((TRACE_TASK)&trace_mask)
26 #define IS_TRACING_PLATFORM   ((TRACE_PLATFORM)&trace_mask)
27 #define IS_TRACING_PROCESSES  ((TRACE_PROCESS)&trace_mask)
28
29 #include "instr/instr.h"
30 #include "msg/msg.h"
31 #include "simix/private.h"
32
33 /* from paje.c */
34 void TRACE_paje_create_header(void);
35 void TRACE_paje_start (FILE *file);
36 FILE *TRACE_paje_end (void);
37 void pajeDefineContainerType(const char *alias, const char *containerType, const char *name);
38 void pajeDefineStateType(const char *alias, const char *containerType, const char *name);
39 void pajeDefineEventType(const char *alias, const char *containerType, const char *name);
40 void pajeDefineLinkType(const char *alias, const char *containerType, const char *sourceContainerType, const char *destContainerType, const char *name);
41 void pajeCreateContainer(double time, const char *alias, const char *type, const char *container, const char *name);
42 void pajeCreateContainerWithPower (double time, const char *alias, const char *type, const char *container, const char *name, double power);
43 void pajeCreateContainerWithBandwidthLatency (double time, const char *alias, const char *type, const char *container, const char *name, double bw, double lat);
44 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);
45 void pajeDestroyContainer (double time, const char *type, const char *container);
46 void pajeSetState (double time, const char *entityType, const char *container, const char *value);
47 void pajeSetStateWithPowerUsed (double time, const char *entityType, const char *container, const char *value, double powerUsed);
48 void pajeSetStateWithHost (double time, const char *entityType, const char *container, const char *value, const char *host);
49 void pajePushState (double time, const char *entityType, const char *container, const char *value);
50 void pajePushStateWithHost (double time, const char *entityType, const char *container, const char *value, const char *host);
51 void pajePushStateWithPowerUsed (double time, const char *entityType, const char *container, const char *value, double powerUsed);
52 void pajePushStateWithBandwidthUsed (double time, const char *entityType, const char *container, const char *value, double bwUsed);
53 void pajePopState (double time, const char *entityType, const char *container);
54 void pajeStartLink (double time, const char *entityType, const char *container, const char *value, const char *sourceContainer, const char *key);
55 void pajeStartLinkWithBandwidthLatency (double time, const char *entityType, const char *container, const char *value, const char *sourceContainer, const char *key, double bw, double lat);
56 void pajeEndLink (double time, const char *entityType, const char *container, const char *value, const char *destContainer, const char *key);
57 void pajeDefineVariableType(const char *alias, const char *containerType, const char *name);
58 void pajeSetVariable (double time, const char *entityType, const char *container, const char *value);
59 void pajeAddVariable (double time, const char *entityType, const char *container, const char *value);
60 void pajeSubVariable (double time, const char *entityType, const char *container, const char *value);
61
62 /* from general.c */
63 char *TRACE_paje_msg_container (m_task_t task, char *host, char *output, int len);
64 char *TRACE_paje_smx_container (smx_action_t action, int seqnumber, char *host, char *output, int len);
65 char *TRACE_paje_surf_container (void *action, int seqnumber, char *output, int len);
66 char *TRACE_host_container (m_host_t host, char *output, int len);
67 char *TRACE_task_container (m_task_t task, char *output, int len);
68 char *TRACE_process_container (m_process_t process, char *output, int len);
69 char *TRACE_process_alias_container (m_process_t process, m_host_t host, char *output, int len);
70 char *TRACE_task_alias_container (m_task_t task, m_process_t process, m_host_t host, char *output, int len);
71
72 /* declaration of instrumentation functions from msg_task_instr.c */
73 void __TRACE_msg_init (void);
74 void __TRACE_current_category_set (m_task_t task);
75 void __TRACE_current_category_unset (void);
76 char *__TRACE_current_category_get (smx_process_t proc);
77 void __TRACE_task_location (m_task_t task);
78 void __TRACE_task_location_present (m_task_t task);
79 void __TRACE_task_location_not_present (m_task_t task);
80 void TRACE_msg_task_create (m_task_t task);
81 void TRACE_msg_task_execute_start (m_task_t task);
82 void TRACE_msg_task_execute_end (m_task_t task);
83 void TRACE_msg_task_destroy (m_task_t task);
84 void TRACE_msg_task_get_start(void);
85 void TRACE_msg_task_get_end (double start_time, m_task_t task);
86 int TRACE_msg_task_put_start (m_task_t task); //returns TRUE if the task_put_end must be called
87 void TRACE_msg_task_put_end (void);
88
89 /* declaration of instrumentation functions from msg_process_instr.c */
90 void __TRACE_msg_process_init (void);
91 int __TRACE_msg_process_location (m_process_t process);
92 void TRACE_msg_process_change_host (m_process_t process, m_host_t old_host, m_host_t new_host);
93 void TRACE_msg_process_kill (m_process_t process);
94 void TRACE_msg_process_suspend (m_process_t process);
95 void TRACE_msg_process_resume (m_process_t process);
96 void TRACE_msg_process_sleep_in (m_process_t process); //called from msg/gos.c
97 void TRACE_msg_process_sleep_out (m_process_t process);
98 void TRACE_msg_process_end (m_process_t process);
99
100 /* from smx.c */
101 void TRACE_smx_action_execute (smx_action_t act);
102 void TRACE_smx_action_communicate (smx_action_t act, smx_process_t proc);
103 void TRACE_smx_action_destroy (smx_action_t act);
104
105 /* from surf.c */
106 void __TRACE_surf_init (void);
107 void __TRACE_surf_finalize (void);
108 void __TRACE_surf_check_variable_set_to_zero (double now, const char *variable, const char *resource);
109 void __TRACE_surf_update_action_state_resource (double now, double delta, const char *type, const char *name, double value);
110 void __TRACE_surf_set_resource_variable (double date, const char *variable, const char *resource, double value);
111 void TRACE_surf_host_declaration (char *name, double power);
112 void TRACE_surf_host_set_power (double date, char *resource, double power);
113 void TRACE_surf_host_set_utilization (const char *name, smx_action_t smx_action, double value, double now, double delta);
114 void TRACE_surf_host_define_id (const char *name, int host_id);
115 void TRACE_surf_host_vivaldi_parse (char *host, double x, double y, double h);
116 void TRACE_surf_link_declaration (char *name, double bw, double lat);
117 void TRACE_surf_link_set_bandwidth (double date, char *resource, double bandwidth);
118 void TRACE_surf_link_set_latency (double date, char *resource, double latency);
119 void TRACE_surf_link_set_utilization (const char *name, smx_action_t smx_action, double value, double now, double delta);
120 void TRACE_surf_link_save_endpoints (char *link_name, int src, int dst);
121 void TRACE_surf_link_missing (void);
122 void TRACE_msg_clean (void);
123
124 //for tracing gtnets
125 void TRACE_surf_gtnets_communicate (void *action, int src, int dst);
126 int TRACE_surf_gtnets_get_src (void *action);
127 int TRACE_surf_gtnets_get_dst (void *action);
128 void TRACE_surf_gtnets_destroy (void *action);
129
130 #endif
131
132 #endif /* PRIVATE_H_ */