1 /* Copyright (c) 2010-2020. 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_PajeTypes(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;
24 tracing_file << "%EventDef PajeDefineVariableType " << simgrid::instr::PAJE_DefineVariableType << std::endl;
25 tracing_file << "% Alias string" << std::endl;
27 tracing_file << "% ContainerType string" << std::endl;
29 tracing_file << "% Type string" << std::endl;
31 tracing_file << "% Name string" << std::endl;
32 tracing_file << "% Color color" << std::endl;
33 tracing_file << "%EndEventDef" << std::endl;
35 tracing_file << "%EventDef PajeDefineStateType " << simgrid::instr::PAJE_DefineStateType << std::endl;
36 tracing_file << "% Alias string" << std::endl;
38 tracing_file << "% ContainerType string" << std::endl;
40 tracing_file << "% Type string" << std::endl;
42 tracing_file << "% Name string" << std::endl;
43 tracing_file << "%EndEventDef" << std::endl;
45 tracing_file << "%EventDef PajeDefineEventType " << simgrid::instr::PAJE_DefineEventType << std::endl;
46 tracing_file << "% Alias string" << std::endl;
48 tracing_file << "% ContainerType string" << std::endl;
50 tracing_file << "% Type string" << std::endl;
52 tracing_file << "% Name string" << std::endl;
53 tracing_file << "%EndEventDef" << std::endl;
55 tracing_file << "%EventDef PajeDefineLinkType " << simgrid::instr::PAJE_DefineLinkType << std::endl;
56 tracing_file << "% Alias string" << std::endl;
58 tracing_file << "% ContainerType string" << std::endl;
59 tracing_file << "% SourceContainerType string" << std::endl;
60 tracing_file << "% DestContainerType string" << std::endl;
62 tracing_file << "% Type string" << std::endl;
63 tracing_file << "% StartContainerType string" << std::endl;
64 tracing_file << "% EndContainerType string" << std::endl;
66 tracing_file << "% Name string" << std::endl;
67 tracing_file << "%EndEventDef" << std::endl;
70 static void TRACE_header_PajeDefineEntityValue(bool basic)
72 tracing_file << "%EventDef PajeDefineEntityValue " << simgrid::instr::PAJE_DefineEntityValue << std::endl;
73 tracing_file << "% Alias string" << std::endl;
75 tracing_file << "% EntityType string" << std::endl;
77 tracing_file << "% Type string" << std::endl;
79 tracing_file << "% Name string" << std::endl;
80 tracing_file << "% Color color" << std::endl;
81 tracing_file << "%EndEventDef" << std::endl;
84 static void TRACE_header_PajeContainer()
86 tracing_file << "%EventDef PajeCreateContainer " << simgrid::instr::PAJE_CreateContainer << std::endl;
87 tracing_file << "% Time date" << std::endl;
88 tracing_file << "% Alias string" << std::endl;
89 tracing_file << "% Type string" << std::endl;
90 tracing_file << "% Container string" << std::endl;
91 tracing_file << "% Name string" << std::endl;
92 tracing_file << "%EndEventDef" << std::endl;
94 tracing_file << "%EventDef PajeDestroyContainer " << simgrid::instr::PAJE_DestroyContainer << std::endl;
95 tracing_file << "% Time date" << std::endl;
96 tracing_file << "% Type string" << std::endl;
97 tracing_file << "% Name string" << std::endl;
98 tracing_file << "%EndEventDef" << std::endl;
101 static void TRACE_header_PajeVariable()
103 tracing_file << "%EventDef PajeSetVariable " << simgrid::instr::PAJE_SetVariable << std::endl;
104 tracing_file << "% Time date" << std::endl;
105 tracing_file << "% Type string" << std::endl;
106 tracing_file << "% Container string" << std::endl;
107 tracing_file << "% Value double" << std::endl;
108 tracing_file << "%EndEventDef" << std::endl;
110 tracing_file << "%EventDef PajeAddVariable " << simgrid::instr::PAJE_AddVariable << std::endl;
111 tracing_file << "% Time date" << std::endl;
112 tracing_file << "% Type string" << std::endl;
113 tracing_file << "% Container string" << std::endl;
114 tracing_file << "% Value double" << std::endl;
115 tracing_file << "%EndEventDef" << std::endl;
117 tracing_file << "%EventDef PajeSubVariable " << simgrid::instr::PAJE_SubVariable << std::endl;
118 tracing_file << "% Time date" << std::endl;
119 tracing_file << "% Type string" << std::endl;
120 tracing_file << "% Container string" << std::endl;
121 tracing_file << "% Value double" << std::endl;
122 tracing_file << "%EndEventDef" << std::endl;
125 static void TRACE_header_PajeState(bool basic, int size)
127 tracing_file << "%EventDef PajeSetState " << simgrid::instr::PAJE_SetState << std::endl;
128 tracing_file << "% Time date" << std::endl;
129 tracing_file << "% Type string" << std::endl;
130 tracing_file << "% Container string" << std::endl;
131 tracing_file << "% Value string" << std::endl;
132 tracing_file << "%EndEventDef" << std::endl;
134 tracing_file << "%EventDef PajePushState " << simgrid::instr::PAJE_PushState << std::endl;
135 tracing_file << "% Time date" << std::endl;
136 tracing_file << "% Type string" << std::endl;
137 tracing_file << "% Container string" << std::endl;
138 tracing_file << "% Value string" << std::endl;
140 tracing_file << "% Size int" << std::endl;
142 if (simgrid::config::get_value<bool>("smpi/trace-call-location")) {
143 /* paje currently (May 2016) uses "Filename" and "Linenumber" as reserved words. We cannot use them... */
144 tracing_file << "% Fname string" << std::endl;
145 tracing_file << "% Lnumber int" << std::endl;
148 tracing_file << "%EndEventDef" << std::endl;
150 tracing_file << "%EventDef PajePopState " << simgrid::instr::PAJE_PopState << std::endl;
151 tracing_file << "% Time date" << std::endl;
152 tracing_file << "% Type string" << std::endl;
153 tracing_file << "% Container string" << std::endl;
154 tracing_file << "%EndEventDef" << std::endl;
159 tracing_file << "%EventDef PajeResetState " << simgrid::instr::PAJE_ResetState << std::endl;
160 tracing_file << "% Time date" << std::endl;
161 tracing_file << "% Type string" << std::endl;
162 tracing_file << "% Container string" << std::endl;
163 tracing_file << "%EndEventDef" << std::endl;
166 static void TRACE_header_PajeLink(bool basic, bool size)
168 tracing_file << "%EventDef PajeStartLink " << simgrid::instr::PAJE_StartLink << std::endl;
169 tracing_file << "% Time date" << std::endl;
170 tracing_file << "% Type string" << std::endl;
171 tracing_file << "% Container string" << std::endl;
172 tracing_file << "% Value string" << std::endl;
174 tracing_file << "% SourceContainer string" << std::endl;
176 tracing_file << "% StartContainer string" << std::endl;
178 tracing_file << "% Key string" << std::endl;
180 tracing_file << "% Size int" << std::endl;
181 tracing_file << "%EndEventDef" << std::endl;
183 tracing_file << "%EventDef PajeEndLink " << simgrid::instr::PAJE_EndLink << std::endl;
184 tracing_file << "% Time date" << std::endl;
185 tracing_file << "% Type string" << std::endl;
186 tracing_file << "% Container string" << std::endl;
187 tracing_file << "% Value string" << std::endl;
189 tracing_file << "% DestContainer string" << std::endl;
191 tracing_file << "% EndContainer string" << std::endl;
193 tracing_file << "% Key string" << std::endl;
194 tracing_file << "%EndEventDef" << std::endl;
197 static void TRACE_header_PajeNewEvent()
199 tracing_file << "%EventDef PajeNewEvent " << simgrid::instr::PAJE_NewEvent << std::endl;
200 tracing_file << "% Time date" << std::endl;
201 tracing_file << "% Type string" << std::endl;
202 tracing_file << "% Container string" << std::endl;
203 tracing_file << "% Value string" << std::endl;
204 tracing_file << "%EndEventDef" << std::endl;
207 void TRACE_header(bool basic, bool size)
209 TRACE_header_PajeTypes(basic);
210 TRACE_header_PajeDefineEntityValue(basic);
211 TRACE_header_PajeContainer();
212 TRACE_header_PajeVariable();
213 TRACE_header_PajeState(basic, size);
214 TRACE_header_PajeLink(basic, size);
215 TRACE_header_PajeNewEvent();