Logo AND Algorithmique Numérique Distribuée

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