Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
useless stuff: do not use MSG in java bindings when possible
[simgrid.git] / src / instr / instr_paje_header.cpp
1 /* Copyright (c) 2010-2020. 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_PajeTypes(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   tracing_file << "%EventDef PajeDefineVariableType " << simgrid::instr::PAJE_DefineVariableType << std::endl;
25   tracing_file << "%       Alias string" << std::endl;
26   if (basic){
27     tracing_file << "%       ContainerType string" << std::endl;
28   }else{
29     tracing_file << "%       Type string" << std::endl;
30   }
31   tracing_file << "%       Name string" << std::endl;
32   tracing_file << "%       Color color" << std::endl;
33   tracing_file << "%EndEventDef" << std::endl;
34
35   tracing_file << "%EventDef PajeDefineStateType " << simgrid::instr::PAJE_DefineStateType << std::endl;
36   tracing_file << "%       Alias string" << std::endl;
37   if (basic){
38     tracing_file << "%       ContainerType string" << std::endl;
39   }else{
40     tracing_file << "%       Type string" << std::endl;
41   }
42   tracing_file << "%       Name string" << std::endl;
43   tracing_file << "%EndEventDef" << std::endl;
44
45   tracing_file << "%EventDef PajeDefineEventType " << simgrid::instr::PAJE_DefineEventType << std::endl;
46   tracing_file << "%       Alias string" << std::endl;
47   if (basic){
48     tracing_file << "%       ContainerType string" << std::endl;
49   }else{
50     tracing_file << "%       Type string" << std::endl;
51   }
52   tracing_file << "%       Name string" << std::endl;
53   tracing_file << "%EndEventDef" << std::endl;
54
55   tracing_file << "%EventDef PajeDefineLinkType " << simgrid::instr::PAJE_DefineLinkType << std::endl;
56   tracing_file << "%       Alias string" << std::endl;
57   if (basic){
58     tracing_file << "%       ContainerType string" << std::endl;
59     tracing_file << "%       SourceContainerType string" << std::endl;
60     tracing_file << "%       DestContainerType string" << std::endl;
61   }else{
62     tracing_file << "%       Type string" << std::endl;
63     tracing_file << "%       StartContainerType string" << std::endl;
64     tracing_file << "%       EndContainerType string" << std::endl;
65   }
66   tracing_file << "%       Name string" << std::endl;
67   tracing_file << "%EndEventDef" << std::endl;
68 }
69
70 static void TRACE_header_PajeDefineEntityValue(bool basic)
71 {
72   tracing_file << "%EventDef PajeDefineEntityValue " << simgrid::instr::PAJE_DefineEntityValue << std::endl;
73   tracing_file << "%       Alias string" << std::endl;
74   if (basic){
75     tracing_file << "%       EntityType string" << std::endl;
76   }else{
77     tracing_file << "%       Type string" << std::endl;
78   }
79   tracing_file << "%       Name string" << std::endl;
80   tracing_file << "%       Color color" << std::endl;
81   tracing_file << "%EndEventDef" << std::endl;
82 }
83
84 static void TRACE_header_PajeContainer()
85 {
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;
93
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;
99 }
100
101 static void TRACE_header_PajeVariable()
102 {
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;
109
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;
116
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;
123 }
124
125 static void TRACE_header_PajeState(bool basic, int size)
126 {
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;
133
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;
139   if (size)
140     tracing_file << "%       Size int" << std::endl;
141 #if HAVE_SMPI
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;
146   }
147 #endif
148   tracing_file << "%EndEventDef" << std::endl;
149
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;
155
156   if (basic)
157     return;
158
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;
164 }
165
166 static void TRACE_header_PajeLink(bool basic, bool size)
167 {
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;
173   if (basic){
174     tracing_file << "%       SourceContainer string" << std::endl;
175   } else {
176     tracing_file << "%       StartContainer string" << std::endl;
177   }
178   tracing_file << "%       Key string" << std::endl;
179   if (size)
180     tracing_file << "%       Size int" << std::endl;
181   tracing_file << "%EndEventDef" << std::endl;
182
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;
188   if (basic){
189     tracing_file << "%       DestContainer string" << std::endl;
190   }else{
191     tracing_file << "%       EndContainer string" << std::endl;
192   }
193   tracing_file << "%       Key string" << std::endl;
194   tracing_file << "%EndEventDef" << std::endl;
195 }
196
197 static void TRACE_header_PajeNewEvent()
198 {
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;
205 }
206
207 void TRACE_header(bool basic, bool size)
208 {
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();
216 }