Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
09bc980cebe501e94ea36d19ed1c31c09c8df6f2
[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/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_msg_task_create (m_task_t task);
79 void TRACE_msg_task_execute_start (m_task_t task);
80 void TRACE_msg_task_execute_end (m_task_t task);
81 void TRACE_msg_task_destroy (m_task_t task);
82 void TRACE_msg_task_get_start(void);
83 void TRACE_msg_task_get_end (double start_time, m_task_t task);
84 int TRACE_msg_task_put_start (m_task_t task); //returns TRUE if the task_put_end must be called
85 void TRACE_msg_task_put_end (void);
86
87 /* declaration of instrumentation functions from msg_process_instr.c */
88 void __TRACE_msg_process_init (void);
89 void __TRACE_msg_process_location (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 /* from smx.c */
99 void TRACE_smx_action_execute (smx_action_t act);
100 void TRACE_smx_action_communicate (smx_action_t act, smx_process_t proc);
101 void TRACE_smx_action_destroy (smx_action_t act);
102
103 /* from surf.c */
104 void __TRACE_surf_init (void);
105 void __TRACE_surf_finalize (void);
106 void __TRACE_surf_check_variable_set_to_zero (double now, const char *variable, const char *resource);
107 void __TRACE_surf_update_action_state_resource (double now, double delta, const char *type, const char *name, double value);
108 void __TRACE_surf_set_resource_variable (double date, const char *variable, const char *resource, double value);
109 void TRACE_surf_update_action_state (void *surf_action, smx_action_t smx_action, double value, const char *stateValue, double now, double delta);
110 void TRACE_surf_update_action_state_net_resource (const char *name, smx_action_t smx_action, double value, double now, double delta);
111 void TRACE_surf_update_action_state_cpu_resource (const char *name, smx_action_t smx_action, double value, double now, double delta);
112 void TRACE_surf_net_link_new (char *name, double bw, double lat);
113 void TRACE_surf_cpu_new (char *name, double power);
114 void TRACE_surf_cpu_set_power (double date, char *resource, double power);
115 void TRACE_surf_link_set_bandwidth (double date, char *resource, double bandwidth);
116 void TRACE_surf_link_set_latency (double date, char *resource, double latency);
117 void TRACE_surf_routing_full_parse_end (char *link_name, int src, int dst);
118 void TRACE_surf_missing_link (void);
119 void TRACE_surf_define_host_id (const char *name, int host_id);
120 //for tracing gtnets
121 void TRACE_surf_gtnets_communicate (void *action, int src, int dst);
122 int TRACE_surf_gtnets_get_src (void *action);
123 int TRACE_surf_gtnets_get_dst (void *action);
124 void TRACE_surf_gtnets_destroy (void *action);
125
126 #endif
127
128 #endif /* PRIVATE_H_ */