1 /* Copyright (c) 2010-2019. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #include "simgrid/sg_config.hpp"
8 #include "src/instr/instr_private.hpp"
10 extern std::ofstream tracing_file;
12 static void TRACE_header_PajeDefineContainerType(bool basic)
14 tracing_file << "%EventDef PajeDefineContainerType " << simgrid::instr::PAJE_DefineContainerType << std::endl;
15 tracing_file << "% Alias string" << std::endl;
17 tracing_file << "% ContainerType string" << std::endl;
19 tracing_file << "% Type string" << std::endl;
21 tracing_file << "% Name string" << std::endl;
22 tracing_file << "%EndEventDef" << std::endl;
25 static void TRACE_header_PajeDefineVariableType(bool basic)
27 tracing_file << "%EventDef PajeDefineVariableType " << simgrid::instr::PAJE_DefineVariableType << std::endl;
28 tracing_file << "% Alias string" << std::endl;
30 tracing_file << "% ContainerType string" << std::endl;
32 tracing_file << "% Type string" << std::endl;
34 tracing_file << "% Name string" << std::endl;
35 tracing_file << "% Color color" << std::endl;
36 tracing_file << "%EndEventDef" << std::endl;
39 static void TRACE_header_PajeDefineStateType(bool basic)
41 tracing_file << "%EventDef PajeDefineStateType " << simgrid::instr::PAJE_DefineStateType << std::endl;
42 tracing_file << "% Alias string" << std::endl;
44 tracing_file << "% ContainerType string" << std::endl;
46 tracing_file << "% Type string" << std::endl;
48 tracing_file << "% Name string" << std::endl;
49 tracing_file << "%EndEventDef" << std::endl;
52 static void TRACE_header_PajeDefineEventType(bool basic)
54 tracing_file << "%EventDef PajeDefineEventType " << simgrid::instr::PAJE_DefineEventType << std::endl;
55 tracing_file << "% Alias string" << std::endl;
57 tracing_file << "% ContainerType string" << std::endl;
59 tracing_file << "% Type string" << std::endl;
61 tracing_file << "% Name string" << std::endl;
62 tracing_file << "%EndEventDef" << std::endl;
65 static void TRACE_header_PajeDefineLinkType(bool basic)
67 tracing_file << "%EventDef PajeDefineLinkType " << simgrid::instr::PAJE_DefineLinkType << std::endl;
68 tracing_file << "% Alias string" << std::endl;
70 tracing_file << "% ContainerType string" << std::endl;
71 tracing_file << "% SourceContainerType string" << std::endl;
72 tracing_file << "% DestContainerType string" << std::endl;
74 tracing_file << "% Type string" << std::endl;
75 tracing_file << "% StartContainerType string" << std::endl;
76 tracing_file << "% EndContainerType string" << std::endl;
78 tracing_file << "% Name string" << std::endl;
79 tracing_file << "%EndEventDef" << std::endl;
82 static void TRACE_header_PajeDefineEntityValue(bool basic)
84 tracing_file << "%EventDef PajeDefineEntityValue " << simgrid::instr::PAJE_DefineEntityValue << std::endl;
85 tracing_file << "% Alias string" << std::endl;
87 tracing_file << "% EntityType string" << std::endl;
89 tracing_file << "% Type string" << std::endl;
91 tracing_file << "% Name string" << std::endl;
92 tracing_file << "% Color color" << std::endl;
93 tracing_file << "%EndEventDef" << std::endl;
96 static void TRACE_header_PajeCreateContainer()
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;
107 static void TRACE_header_PajeDestroyContainer()
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;
116 static void TRACE_header_PajeSetVariable()
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;
126 static void TRACE_header_PajeAddVariable()
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;
136 static void TRACE_header_PajeSubVariable()
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;
146 static void TRACE_header_PajeSetState()
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;
156 static void TRACE_header_PajePushState(int size)
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;
164 tracing_file << "% Size int" << std::endl;
166 if (simgrid::config::get_value<bool>("smpi/trace-call-location")) {
168 * paje currently (May 2016) uses "Filename" and "Linenumber" as
169 * reserved words. We cannot use them...
171 tracing_file << "% Fname string" << std::endl;
172 tracing_file << "% Lnumber int" << std::endl;
175 tracing_file << "%EndEventDef" << std::endl;
178 static void TRACE_header_PajePopState()
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;
187 static void TRACE_header_PajeResetState(bool basic)
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;
199 static void TRACE_header_PajeStartLink(bool basic, bool size)
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;
207 tracing_file << "% SourceContainer string" << std::endl;
209 tracing_file << "% StartContainer string" << std::endl;
211 tracing_file << "% Key string" << std::endl;
213 tracing_file << "% Size int" << std::endl;
214 tracing_file << "%EndEventDef" << std::endl;
217 static void TRACE_header_PajeEndLink(bool basic)
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;
225 tracing_file << "% DestContainer string" << std::endl;
227 tracing_file << "% EndContainer string" << std::endl;
229 tracing_file << "% Key string" << std::endl;
230 tracing_file << "%EndEventDef" << std::endl;
233 static void TRACE_header_PajeNewEvent()
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;
243 void TRACE_header(bool basic, bool size)
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();