Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simplify the actor finalization a tiny bit by using a callback
[simgrid.git] / src / instr / instr_paje_header.cpp
1 /* Copyright (c) 2010-2018. 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 #include "simgrid/sg_config.hpp"
8 #include "src/instr/instr_private.hpp"
9
10 extern std::ofstream tracing_file;
11
12 static void TRACE_header_PajeDefineContainerType(bool basic)
13 {
14   tracing_file << "%EventDef PajeDefineContainerType " << simgrid::instr::PAJE_DefineContainerType << std::endl;
15   tracing_file << "%       Alias string" << std::endl;
16   if (basic){
17     tracing_file << "%       ContainerType string" << std::endl;
18   }else{
19     tracing_file << "%       Type string" << std::endl;
20   }
21   tracing_file << "%       Name string" << std::endl;
22   tracing_file << "%EndEventDef" << std::endl;
23 }
24
25 static void TRACE_header_PajeDefineVariableType(bool basic)
26 {
27   tracing_file << "%EventDef PajeDefineVariableType " << simgrid::instr::PAJE_DefineVariableType << std::endl;
28   tracing_file << "%       Alias string" << std::endl;
29   if (basic){
30     tracing_file << "%       ContainerType string" << std::endl;
31   }else{
32     tracing_file << "%       Type string" << std::endl;
33   }
34   tracing_file << "%       Name string" << std::endl;
35   tracing_file << "%       Color color" << std::endl;
36   tracing_file << "%EndEventDef" << std::endl;
37 }
38
39 static void TRACE_header_PajeDefineStateType(bool basic)
40 {
41   tracing_file << "%EventDef PajeDefineStateType " << simgrid::instr::PAJE_DefineStateType << std::endl;
42   tracing_file << "%       Alias string" << std::endl;
43   if (basic){
44     tracing_file << "%       ContainerType string" << std::endl;
45   }else{
46     tracing_file << "%       Type string" << std::endl;
47   }
48   tracing_file << "%       Name string" << std::endl;
49   tracing_file << "%EndEventDef" << std::endl;
50 }
51
52 static void TRACE_header_PajeDefineEventType(bool basic)
53 {
54   tracing_file << "%EventDef PajeDefineEventType " << simgrid::instr::PAJE_DefineEventType << std::endl;
55   tracing_file << "%       Alias string" << std::endl;
56   if (basic){
57     tracing_file << "%       ContainerType string" << std::endl;
58   }else{
59     tracing_file << "%       Type string" << std::endl;
60   }
61   tracing_file << "%       Name string" << std::endl;
62   tracing_file << "%EndEventDef" << std::endl;
63 }
64
65 static void TRACE_header_PajeDefineLinkType(bool basic)
66 {
67   tracing_file << "%EventDef PajeDefineLinkType " << simgrid::instr::PAJE_DefineLinkType << std::endl;
68   tracing_file << "%       Alias string" << std::endl;
69   if (basic){
70     tracing_file << "%       ContainerType string" << std::endl;
71     tracing_file << "%       SourceContainerType string" << std::endl;
72     tracing_file << "%       DestContainerType string" << std::endl;
73   }else{
74     tracing_file << "%       Type string" << std::endl;
75     tracing_file << "%       StartContainerType string" << std::endl;
76     tracing_file << "%       EndContainerType string" << std::endl;
77   }
78   tracing_file << "%       Name string" << std::endl;
79   tracing_file << "%EndEventDef" << std::endl;
80 }
81
82 static void TRACE_header_PajeDefineEntityValue(bool basic)
83 {
84   tracing_file << "%EventDef PajeDefineEntityValue " << simgrid::instr::PAJE_DefineEntityValue << std::endl;
85   tracing_file << "%       Alias string" << std::endl;
86   if (basic){
87     tracing_file << "%       EntityType string" << std::endl;
88   }else{
89     tracing_file << "%       Type string" << std::endl;
90   }
91   tracing_file << "%       Name string" << std::endl;
92   tracing_file << "%       Color color" << std::endl;
93   tracing_file << "%EndEventDef" << std::endl;
94 }
95
96 static void TRACE_header_PajeCreateContainer()
97 {
98   tracing_file << "%EventDef PajeCreateContainer " << simgrid::instr::PAJE_CreateContainer << std::endl;
99   tracing_file << "%       Time date" << std::endl;
100   tracing_file << "%       Alias string" << std::endl;
101   tracing_file << "%       Type string" << std::endl;
102   tracing_file << "%       Container string" << std::endl;
103   tracing_file << "%       Name string" << std::endl;
104   tracing_file << "%EndEventDef" << std::endl;
105 }
106
107 static void TRACE_header_PajeDestroyContainer()
108 {
109   tracing_file << "%EventDef PajeDestroyContainer " << simgrid::instr::PAJE_DestroyContainer << std::endl;
110   tracing_file << "%       Time date" << std::endl;
111   tracing_file << "%       Type string" << std::endl;
112   tracing_file << "%       Name string" << std::endl;
113   tracing_file << "%EndEventDef" << std::endl;
114 }
115
116 static void TRACE_header_PajeSetVariable()
117 {
118   tracing_file << "%EventDef PajeSetVariable " << simgrid::instr::PAJE_SetVariable << std::endl;
119   tracing_file << "%       Time date" << std::endl;
120   tracing_file << "%       Type string" << std::endl;
121   tracing_file << "%       Container string" << std::endl;
122   tracing_file << "%       Value double" << std::endl;
123   tracing_file << "%EndEventDef" << std::endl;
124 }
125
126 static void TRACE_header_PajeAddVariable()
127 {
128   tracing_file << "%EventDef PajeAddVariable " << simgrid::instr::PAJE_AddVariable << std::endl;
129   tracing_file << "%       Time date" << std::endl;
130   tracing_file << "%       Type string" << std::endl;
131   tracing_file << "%       Container string" << std::endl;
132   tracing_file << "%       Value double" << std::endl;
133   tracing_file << "%EndEventDef" << std::endl;
134 }
135
136 static void TRACE_header_PajeSubVariable()
137 {
138   tracing_file << "%EventDef PajeSubVariable " << simgrid::instr::PAJE_SubVariable << std::endl;
139   tracing_file << "%       Time date" << std::endl;
140   tracing_file << "%       Type string" << std::endl;
141   tracing_file << "%       Container string" << std::endl;
142   tracing_file << "%       Value double" << std::endl;
143   tracing_file << "%EndEventDef" << std::endl;
144 }
145
146 static void TRACE_header_PajeSetState()
147 {
148   tracing_file << "%EventDef PajeSetState " << simgrid::instr::PAJE_SetState << std::endl;
149   tracing_file << "%       Time date" << std::endl;
150   tracing_file << "%       Type string" << std::endl;
151   tracing_file << "%       Container string" << std::endl;
152   tracing_file << "%       Value string" << std::endl;
153   tracing_file << "%EndEventDef" << std::endl;
154 }
155
156 static void TRACE_header_PajePushState(int size)
157 {
158   tracing_file << "%EventDef PajePushState " << simgrid::instr::PAJE_PushState << std::endl;
159   tracing_file << "%       Time date" << std::endl;
160   tracing_file << "%       Type string" << std::endl;
161   tracing_file << "%       Container string" << std::endl;
162   tracing_file << "%       Value string" << std::endl;
163   if (size)
164     tracing_file << "%       Size int" << std::endl;
165 #if HAVE_SMPI
166   if (simgrid::config::get_value<bool>("smpi/trace-call-location")) {
167     /**
168      * paje currently (May 2016) uses "Filename" and "Linenumber" as
169      * reserved words. We cannot use them...
170      */
171     tracing_file << "%       Fname string" << std::endl;
172     tracing_file << "%       Lnumber int" << std::endl;
173   }
174 #endif
175   tracing_file << "%EndEventDef" << std::endl;
176 }
177
178 static void TRACE_header_PajePopState()
179 {
180   tracing_file << "%EventDef PajePopState " << simgrid::instr::PAJE_PopState << std::endl;
181   tracing_file << "%       Time date" << std::endl;
182   tracing_file << "%       Type string" << std::endl;
183   tracing_file << "%       Container string" << std::endl;
184   tracing_file << "%EndEventDef" << std::endl;
185 }
186
187 static void TRACE_header_PajeResetState(bool basic)
188 {
189   if (basic)
190     return;
191
192   tracing_file << "%EventDef PajeResetState " << simgrid::instr::PAJE_ResetState << std::endl;
193   tracing_file << "%       Time date" << std::endl;
194   tracing_file << "%       Type string" << std::endl;
195   tracing_file << "%       Container string" << std::endl;
196   tracing_file << "%EndEventDef" << std::endl;
197 }
198
199 static void TRACE_header_PajeStartLink(bool basic, bool size)
200 {
201   tracing_file << "%EventDef PajeStartLink " << simgrid::instr::PAJE_StartLink << std::endl;
202   tracing_file << "%       Time date" << std::endl;
203   tracing_file << "%       Type string" << std::endl;
204   tracing_file << "%       Container string" << std::endl;
205   tracing_file << "%       Value string" << std::endl;
206   if (basic){
207     tracing_file << "%       SourceContainer string" << std::endl;
208   }else{
209     tracing_file << "%       StartContainer string" << std::endl;
210   }
211   tracing_file << "%       Key string" << std::endl;
212   if (size)
213     tracing_file << "%       Size int" << std::endl;
214   tracing_file << "%EndEventDef" << std::endl;
215 }
216
217 static void TRACE_header_PajeEndLink(bool basic)
218 {
219   tracing_file << "%EventDef PajeEndLink " << simgrid::instr::PAJE_EndLink << std::endl;
220   tracing_file << "%       Time date" << std::endl;
221   tracing_file << "%       Type string" << std::endl;
222   tracing_file << "%       Container string" << std::endl;
223   tracing_file << "%       Value string" << std::endl;
224   if (basic){
225     tracing_file << "%       DestContainer string" << std::endl;
226   }else{
227     tracing_file << "%       EndContainer string" << std::endl;
228   }
229   tracing_file << "%       Key string" << std::endl;
230   tracing_file << "%EndEventDef" << std::endl;
231 }
232
233 static void TRACE_header_PajeNewEvent()
234 {
235   tracing_file << "%EventDef PajeNewEvent " << simgrid::instr::PAJE_NewEvent << std::endl;
236   tracing_file << "%       Time date" << std::endl;
237   tracing_file << "%       Type string" << std::endl;
238   tracing_file << "%       Container string" << std::endl;
239   tracing_file << "%       Value string" << std::endl;
240   tracing_file << "%EndEventDef" << std::endl;
241 }
242
243 void TRACE_header(bool basic, bool size)
244 {
245   TRACE_header_PajeDefineContainerType(basic);
246   TRACE_header_PajeDefineVariableType(basic);
247   TRACE_header_PajeDefineStateType(basic);
248   TRACE_header_PajeDefineEventType(basic);
249   TRACE_header_PajeDefineLinkType(basic);
250   TRACE_header_PajeDefineEntityValue(basic);
251   TRACE_header_PajeCreateContainer();
252   TRACE_header_PajeDestroyContainer();
253   TRACE_header_PajeSetVariable();
254   TRACE_header_PajeAddVariable();
255   TRACE_header_PajeSubVariable();
256   TRACE_header_PajeSetState();
257   TRACE_header_PajePushState(size);
258   TRACE_header_PajePopState();
259   TRACE_header_PajeResetState(basic);
260   TRACE_header_PajeStartLink (basic, size);
261   TRACE_header_PajeEndLink(basic);
262   TRACE_header_PajeNewEvent();
263 }