Logo AND Algorithmique Numérique Distribuée

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