Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] renaming instrumentation source file
[simgrid.git] / src / instr / instr_routing.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 #include "surf/surf_private.h"
11 #include "surf/network_private.h"
12
13 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_routing, instr, "Tracing platform hierarchy");
14
15 extern xbt_dict_t defined_types; /* from instr_interface.c */
16
17 static int platform_created = 0;            /* indicate whether the platform file has been traced */
18 static type_t rootType = NULL;              /* the root type */
19 static container_t rootContainer = NULL;    /* the root container */
20 static xbt_dynar_t currentContainer = NULL; /* push and pop, used only in creation */
21 static xbt_dict_t allContainers = NULL;     /* all created containers indexed by name */
22 xbt_dynar_t allLinkTypes = NULL;     /* all link types defined */
23 xbt_dynar_t allHostTypes = NULL;     /* all host types defined */
24
25 static void instr_routing_parse_start_AS (void);
26 static void instr_routing_parse_end_AS (void);
27 static void instr_routing_parse_start_link (void);
28 static void instr_routing_parse_end_link (void);
29 static void instr_routing_parse_start_host (void);
30 static void instr_routing_parse_end_host (void);
31 static void instr_routing_parse_start_router (void);
32 static void instr_routing_parse_end_router (void);
33 static void instr_routing_parse_end_platform (void);
34
35 static long long int newTypeId ()
36 {
37   static long long int counter = 0;
38   return counter++;
39 }
40
41 static type_t newType (const char *typename, const char *key, e_entity_types kind, type_t father)
42 {
43   type_t ret = xbt_new0(s_type_t, 1);
44   ret->name = xbt_strdup (typename);
45   ret->father = father;
46   ret->kind = kind;
47   ret->children = xbt_dict_new ();
48
49   long long int id = newTypeId();
50   char str_id[INSTR_DEFAULT_STR_SIZE];
51   snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", id);
52   ret->id = xbt_strdup (str_id);
53
54   if (father != NULL){
55     xbt_dict_set (father->children, key, ret, NULL);
56   }
57   return ret;
58 }
59
60 type_t getContainerType (const char *typename, type_t father)
61 {
62   type_t ret;
63   if (father == NULL){
64     ret = newType (typename, typename, TYPE_CONTAINER, father);
65     if (father) pajeDefineContainerType(ret->id, ret->father->id, ret->name);
66     rootType = ret;
67   }else{
68     //check if my father type already has my typename
69     ret = (type_t)xbt_dict_get_or_null (father->children, typename);
70     if (ret == NULL){
71       ret = newType (typename, typename, TYPE_CONTAINER, father);
72       pajeDefineContainerType(ret->id, ret->father->id, ret->name);
73     }
74   }
75   return ret;
76 }
77
78 type_t getEventType (const char *typename, const char *color, type_t father)
79 {
80   type_t ret = xbt_dict_get_or_null (father->children, typename);
81   if (ret == NULL){
82     ret = newType (typename, typename, TYPE_EVENT, father);
83     //INFO4("EventType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
84     if (color){
85       pajeDefineEventTypeWithColor (ret->id, ret->father->id, ret->name, color);
86     }else{
87       pajeDefineEventType(ret->id, ret->father->id, ret->name);
88     }
89   }
90   return ret;
91 }
92
93 type_t getVariableType (const char *typename, const char *color, type_t father)
94 {
95   type_t ret = xbt_dict_get_or_null (father->children, typename);
96   if (ret == NULL){
97     ret = newType (typename, typename, TYPE_VARIABLE, father);
98     //INFO4("VariableType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
99     if (color){
100       pajeDefineVariableTypeWithColor(ret->id, ret->father->id, ret->name, color);
101     }else{
102       pajeDefineVariableType(ret->id, ret->father->id, ret->name);
103     }
104   }
105   return ret;
106 }
107
108 type_t getLinkType (const char *typename, type_t father, type_t source, type_t dest)
109 {
110   //FIXME should check using source and dest here and not by the typename (g5k example)
111   char key[INSTR_DEFAULT_STR_SIZE];
112   snprintf (key, INSTR_DEFAULT_STR_SIZE, "%s-%s-%s", typename, source->id, dest->id);
113   type_t ret = xbt_dict_get_or_null (father->children, key);
114   if (ret == NULL){
115     ret = newType (typename, key, TYPE_LINK, father);
116     //INFO8("LinkType %s(%s), child of %s(%s)  %s(%s)->%s(%s)", ret->name, ret->id, father->name, father->id, source->name, source->id, dest->name, dest->id);
117     pajeDefineLinkType(ret->id, ret->father->id, source->id, dest->id, ret->name);
118   }
119   return ret;
120 }
121
122 type_t getStateType (const char *typename, type_t father)
123 {
124   type_t ret = xbt_dict_get_or_null (father->children, typename);
125   if (ret == NULL){
126     ret = newType (typename, typename, TYPE_STATE, father);
127     //INFO4("StateType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
128     pajeDefineStateType(ret->id, ret->father->id, ret->name);
129   }
130   return ret;
131 }
132
133 void instr_routing_define_callbacks ()
134 {
135   if (!TRACE_is_active())
136     return;
137   surfxml_add_callback(STag_surfxml_AS_cb_list, &instr_routing_parse_start_AS);
138   surfxml_add_callback(ETag_surfxml_AS_cb_list, &instr_routing_parse_end_AS);
139   surfxml_add_callback(STag_surfxml_link_cb_list, &instr_routing_parse_start_link);
140   surfxml_add_callback(ETag_surfxml_link_cb_list, &instr_routing_parse_end_link);
141   surfxml_add_callback(STag_surfxml_host_cb_list, &instr_routing_parse_start_host);
142   surfxml_add_callback(ETag_surfxml_host_cb_list, &instr_routing_parse_end_host);
143   surfxml_add_callback(STag_surfxml_router_cb_list, &instr_routing_parse_start_router);
144   surfxml_add_callback(ETag_surfxml_router_cb_list, &instr_routing_parse_end_router);
145   surfxml_add_callback(ETag_surfxml_platform_cb_list, &instr_routing_parse_end_platform);
146 }
147
148 static long long int newContainedId ()
149 {
150   static long long counter = 0;
151   return counter++;
152 }
153
154 container_t newContainer (const char *name, e_container_types kind, container_t father)
155 {
156   long long int counter = newContainedId();
157   char id_str[INSTR_DEFAULT_STR_SIZE];
158   snprintf (id_str, INSTR_DEFAULT_STR_SIZE, "%lld", counter);
159
160   container_t new = xbt_new0(s_container_t, 1);
161   new->name = xbt_strdup (name); // name of the container
162   new->id = xbt_strdup (id_str); // id (or alias) of the container
163   new->father = father;
164   // level depends on level of father
165   if (new->father){
166     new->level = new->father->level+1;
167   }else{
168     new->level = 0;
169   }
170   // type definition (method depends on kind of this new container)
171   new->kind = kind;
172   if (new->kind == INSTR_AS){
173     //if this container is of an AS, its type name depends on its level
174     char as_typename[INSTR_DEFAULT_STR_SIZE];
175     snprintf (as_typename, INSTR_DEFAULT_STR_SIZE, "L%d", new->level);
176     if (new->father){
177       new->type = getContainerType (as_typename, new->father->type);
178     }else{
179       new->type = getContainerType ("0", NULL);
180     }
181   }else{
182     //otherwise, the name is its kind
183     switch (new->kind){
184       case INSTR_HOST: new->type = getContainerType ("HOST", new->father->type); break;
185       case INSTR_LINK: new->type = getContainerType ("LINK", new->father->type); break;
186       case INSTR_ROUTER: new->type = getContainerType ("ROUTER", new->father->type); break;
187       case INSTR_SMPI: new->type = getContainerType ("MPI", new->father->type); break;
188       case INSTR_MSG_PROCESS: new->type = getContainerType ("MSG_PROCESS", new->father->type); break;
189       case INSTR_MSG_TASK: new->type = getContainerType ("MSG_TASK", new->father->type); break;
190       default: xbt_die ("Congratulations, you have found a bug on newContainer function of instr_routing.c"); break;
191     }
192   }
193   new->children = xbt_dict_new();
194   if (new->father){
195     xbt_dict_set(new->father->children, new->name, new, NULL);
196     pajeCreateContainer (SIMIX_get_clock(), new->id, new->type->id, new->father->id, new->name);
197   }
198
199   //register hosts, routers, links containers
200   if (new->kind == INSTR_HOST || new->kind == INSTR_LINK || new->kind == INSTR_ROUTER) {
201     xbt_dict_set (allContainers, new->name, new, NULL);
202   }
203
204   //register the host container types
205   if (new->kind == INSTR_HOST){
206     xbt_dynar_push_as (allHostTypes, type_t, new->type);
207   }
208
209   //register the link container types
210   if (new->kind == INSTR_LINK){
211     xbt_dynar_push_as(allLinkTypes, type_t, new->type);
212   }
213   return new;
214 }
215
216 static container_t recursiveGetContainer (const char *name, container_t root)
217 {
218   if (strcmp (root->name, name) == 0) return root;
219
220   xbt_dict_cursor_t cursor = NULL;
221   container_t child;
222   char *child_name;
223   xbt_dict_foreach(root->children, cursor, child_name, child) {
224     container_t ret = recursiveGetContainer(name, child);
225     if (ret) return ret;
226   }
227   return NULL;
228 }
229
230 container_t getContainer (const char *name)
231 {
232   return recursiveGetContainer(name, rootContainer);
233 }
234
235 static type_t recursiveGetType (const char *name, type_t root)
236 {
237   if (strcmp (root->name, name) == 0) return root;
238
239   xbt_dict_cursor_t cursor = NULL;
240   type_t child;
241   char *child_name;
242   xbt_dict_foreach(root->children, cursor, child_name, child) {
243     type_t ret = recursiveGetType(name, child);
244     if (ret) return ret;
245   }
246   return NULL;
247 }
248
249 type_t getType (const char *name)
250 {
251   return recursiveGetType (name, rootType);
252 }
253
254 void destroyContainer (container_t container)
255 {
256   //remove me from my father
257   if (container->father){
258     xbt_dict_remove(container->father->children, container->name);
259   }
260
261   //trace my destruction
262   pajeDestroyContainer(SIMIX_get_clock(), container->type->id, container->id);
263
264   //free
265   xbt_free (container->name);
266   xbt_free (container->id);
267   xbt_free (container->children);
268   xbt_free (container);
269   container = NULL;
270 }
271
272 static container_t findChild (container_t root, container_t a1)
273 {
274   if (root == a1) return root;
275
276   xbt_dict_cursor_t cursor = NULL;
277   container_t child;
278   char *child_name;
279   xbt_dict_foreach(root->children, cursor, child_name, child) {
280     if (findChild (child, a1)) return child;
281   }
282   return NULL;
283 }
284
285 static container_t findCommonFather (container_t root, container_t a1, container_t a2)
286 {
287   if (a1->father == a2->father) return a1->father;
288
289   xbt_dict_cursor_t cursor = NULL;
290   container_t child;
291   char *child_name;
292   container_t a1_try = NULL;
293   container_t a2_try = NULL;
294   xbt_dict_foreach(root->children, cursor, child_name, child) {
295     a1_try = findChild (child, a1);
296     a2_try = findChild (child, a2);
297     if (a1_try && a2_try) return child;
298   }
299   return NULL;
300 }
301
302 static void linkContainers (const char *a1, const char *a2)
303 {
304   //ignore loopback
305   if (strcmp (a1, "__loopback__") == 0 || strcmp (a2, "__loopback__") == 0)
306     return;
307
308   container_t a1_container = ((container_t)xbt_dict_get (allContainers, a1));
309   type_t a1_type = a1_container->type;
310
311   container_t a2_container = ((container_t)xbt_dict_get (allContainers, a2));
312   type_t a2_type = a2_container->type;
313
314   container_t container = findCommonFather (rootContainer, a1_container, a2_container);
315   xbt_assert0 (container != NULL, "common father not found");
316
317   //declare type
318   char link_typename[INSTR_DEFAULT_STR_SIZE];
319   snprintf (link_typename, INSTR_DEFAULT_STR_SIZE, "%s-%s", a1_type->name, a2_type->name);
320   type_t link_type = getLinkType (link_typename, container->type, a1_type, a2_type);
321
322   //create the link
323   static long long counter = 0;
324   char key[INSTR_DEFAULT_STR_SIZE];
325   snprintf (key, INSTR_DEFAULT_STR_SIZE, "%lld", counter++);
326   pajeStartLink(SIMIX_get_clock(), link_type->id, container->id, "G", a1_container->id, key);
327   pajeEndLink(SIMIX_get_clock(), link_type->id, container->id, "G", a2_container->id, key);
328 }
329
330 static void recursiveGraphExtraction (container_t container)
331 {
332   if (xbt_dict_length(container->children)){
333     xbt_dict_cursor_t cursor = NULL;
334     container_t child;
335     char *child_name;
336     //bottom-up recursion
337     xbt_dict_foreach(container->children, cursor, child_name, child) {
338       recursiveGraphExtraction (child);
339     }
340
341     //let's get routes
342     xbt_dict_cursor_t cursor1 = NULL, cursor2 = NULL;
343     container_t child1, child2;
344     const char *child_name1, *child_name2;
345
346     xbt_dict_t filter = xbt_dict_new ();
347
348     xbt_dict_foreach(container->children, cursor1, child_name1, child1) {
349       xbt_dict_foreach(container->children, cursor2, child_name2, child2) {
350         //check if we already register this pair (we only need one direction)
351         char aux1[INSTR_DEFAULT_STR_SIZE], aux2[INSTR_DEFAULT_STR_SIZE];
352         snprintf (aux1, INSTR_DEFAULT_STR_SIZE, "%s%s", child_name1, child_name2);
353         snprintf (aux2, INSTR_DEFAULT_STR_SIZE, "%s%s", child_name2, child_name1);
354         if (xbt_dict_get_or_null (filter, aux1)) continue;
355         if (xbt_dict_get_or_null (filter, aux2)) continue;
356
357         //ok, not found, register it
358         xbt_dict_set (filter, aux1, xbt_strdup ("1"), xbt_free);
359         xbt_dict_set (filter, aux2, xbt_strdup ("1"), xbt_free);
360
361         if ((child1->kind == INSTR_HOST || child1->kind == INSTR_ROUTER) &&
362             (child2->kind == INSTR_HOST  || child2->kind == INSTR_ROUTER)){
363
364           //getting route
365           xbt_dynar_t route = NULL;
366           xbt_ex_t exception;
367           TRY {
368             route = global_routing->get_route (child_name1, child_name2);
369           }CATCH(exception) {
370             //no route between them, that's possible
371             continue;
372           }
373
374           //link the route members
375           unsigned int cpt;
376           void *link;
377           char *previous_entity_name = (char*)child_name1;
378           xbt_dynar_foreach (route, cpt, link) {
379             char *link_name = ((link_CM02_t)link)->lmm_resource.generic_resource.name;
380             linkContainers (previous_entity_name, link_name);
381             previous_entity_name = link_name;
382           }
383           linkContainers (previous_entity_name, child_name2);
384         }else if (child1->kind == INSTR_AS &&
385                   child2->kind == INSTR_AS &&
386                   strcmp(child_name1, child_name2) != 0){
387
388           //getting route
389           routing_component_t root = global_routing->root;
390           route_extended_t route = NULL;
391           xbt_ex_t exception;
392           TRY {
393             route = root->get_route (root, child_name1, child_name2);
394           }CATCH(exception) {
395             //no route between them, that's possible
396             continue;
397           }
398           xbt_assert2(route!=NULL,
399               "there is no ASroute between %s and %s", child_name1, child_name2);
400           unsigned int cpt;
401           void *link;
402           char *previous_entity_name = route->src_gateway;
403           xbt_dynar_foreach (route->generic_route.link_list, cpt, link) {
404             char *link_name = ((link_CM02_t)link)->lmm_resource.generic_resource.name;
405             linkContainers (previous_entity_name, link_name);
406             previous_entity_name = link_name;
407           }
408           linkContainers (previous_entity_name, route->dst_gateway);
409         }
410       }
411     }
412     xbt_dict_free(&filter);
413   }
414 }
415
416 /*
417  * Callbacks
418  */
419 static void instr_routing_parse_start_AS ()
420 {
421   if (rootContainer == NULL){
422     currentContainer = xbt_dynar_new (sizeof(container_t), NULL);
423     allContainers = xbt_dict_new ();
424     allLinkTypes = xbt_dynar_new (sizeof(s_type_t), NULL);
425     allHostTypes = xbt_dynar_new (sizeof(s_type_t), NULL);
426
427     rootContainer = newContainer ("0", INSTR_AS, NULL);
428     xbt_dynar_push (currentContainer, &rootContainer);
429
430     if (TRACE_smpi_is_enabled()) {
431       if (!TRACE_smpi_is_grouped()){
432         container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
433         type_t mpi = getContainerType("MPI", father->type);
434         getStateType ("MPI_STATE", mpi);
435         getLinkType ("MPI_LINK", rootType, mpi, mpi);
436       }
437     }
438   }
439   container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
440   container_t new = newContainer (A_surfxml_AS_id, INSTR_AS, father);
441
442   //push
443   xbt_dynar_push (currentContainer, &new);
444 }
445
446 static void instr_routing_parse_end_AS ()
447 {
448   xbt_dynar_pop_ptr (currentContainer);
449 }
450
451 static void instr_routing_parse_start_link ()
452 {
453   container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
454   container_t new = newContainer (A_surfxml_link_id, INSTR_LINK, father);
455
456   type_t bandwidth = getVariableType ("bandwidth", NULL, new->type);
457   type_t latency = getVariableType ("latency", NULL, new->type);
458   pajeSetVariable (0, bandwidth->id, new->id, A_surfxml_link_bandwidth);
459   pajeSetVariable (0, latency->id, new->id, A_surfxml_link_latency);
460   if (TRACE_uncategorized()){
461     getVariableType ("bandwidth_used", "0.5 0.5 0.5", new->type);
462   }
463 }
464
465 static void instr_routing_parse_end_link ()
466 {
467 }
468
469 static void instr_routing_parse_start_host ()
470 {
471   container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
472   container_t new = newContainer (A_surfxml_host_id, INSTR_HOST, father);
473
474   type_t power = getVariableType ("power", NULL, new->type);
475   pajeSetVariable (0, power->id, new->id, A_surfxml_host_power);
476   if (TRACE_uncategorized()){
477     getVariableType ("power_used", "0.5 0.5 0.5", new->type);
478   }
479
480   if (TRACE_smpi_is_enabled()) {
481     if (TRACE_smpi_is_grouped()){
482       type_t mpi = getContainerType("MPI", new->type);
483       getStateType ("MPI_STATE", mpi);
484       getLinkType ("MPI_LINK", rootType, mpi, mpi);
485     }
486   }
487
488   if (TRACE_msg_process_is_enabled()) {
489     type_t msg_process = getContainerType("MSG_PROCESS", new->type);
490     getStateType ("MSG_PROCESS_STATE", msg_process);
491     getLinkType ("MSG_PROCESS_LINK", rootType, msg_process, msg_process);
492   }
493
494   if (TRACE_msg_task_is_enabled()) {
495     type_t msg_task = getContainerType ("MSG_TASK", new->type);
496     getStateType ("MSG_TASK_STATE", msg_task);
497     getLinkType ("MSG_TASK_LINK", rootType, msg_task, msg_task);
498   }
499 }
500
501 static void instr_routing_parse_end_host ()
502 {
503 }
504
505 static void instr_routing_parse_start_router ()
506 {
507   container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
508   newContainer (A_surfxml_router_id, INSTR_ROUTER, father);
509 }
510
511 static void instr_routing_parse_end_router ()
512 {
513 }
514
515 static void instr_routing_parse_end_platform ()
516 {
517   xbt_dynar_free(&currentContainer);
518   currentContainer = NULL;
519   recursiveGraphExtraction (rootContainer);
520   platform_created = 1;
521 }
522
523 /*
524  * Support functions
525  */
526 int instr_link_is_traced (const char *name)
527 {
528   if (((container_t)xbt_dict_get_or_null (allContainers, name))){
529     return 1;
530   } else {
531     return 0;
532   }
533 }
534
535 char *instr_variable_type (const char *name, const char *resource)
536 {
537   container_t container = (container_t)xbt_dict_get (allContainers, resource);
538   xbt_dict_cursor_t cursor = NULL;
539   type_t type;
540   char *type_name;
541   xbt_dict_foreach(container->type->children, cursor, type_name, type) {
542     if (strcmp (name, type->name) == 0) return type->id;
543   }
544   return NULL;
545 }
546
547 char *instr_resource_type (const char *resource_name)
548 {
549   return ((container_t)xbt_dict_get_or_null (allContainers, resource_name))->id;
550 }
551
552 static void recursiveDestroyContainer (container_t container)
553 {
554   xbt_dict_cursor_t cursor = NULL;
555   container_t child;
556   char *child_name;
557   xbt_dict_foreach(container->children, cursor, child_name, child) {
558     recursiveDestroyContainer (child);
559   }
560   destroyContainer (container);
561 }
562
563 static void recursiveDestroyType (type_t type)
564 {
565   xbt_dict_cursor_t cursor = NULL;
566   type_t child;
567   char *child_name;
568   xbt_dict_foreach(type->children, cursor, child_name, child) {
569     recursiveDestroyType (child);
570   }
571   xbt_free (type->name);
572   xbt_free (type->id);
573   xbt_free (type->children);
574   xbt_free (type);
575   type = NULL;
576 }
577
578 void instr_destroy_platform ()
579 {
580   if (rootContainer) recursiveDestroyContainer (rootContainer);
581   if (rootType) recursiveDestroyType (rootType);
582 }
583
584 /*
585  * user categories support
586  */
587 static void recursiveNewUserVariableType (const char *new_typename, const char *color, type_t root)
588 {
589   if (!strcmp (root->name, "HOST") || !strcmp (root->name, "LINK")){
590     getVariableType(new_typename, color, root);
591   }
592   xbt_dict_cursor_t cursor = NULL;
593   type_t child_type;
594   char *name;
595   xbt_dict_foreach(root->children, cursor, name, child_type) {
596     recursiveNewUserVariableType (new_typename, color, child_type);
597   }
598 }
599
600 void instr_new_user_variable_type (const char *new_typename, const char *color)
601 {
602   recursiveNewUserVariableType (new_typename, color, rootType);
603 }
604
605 static void recursiveNewUserLinkVariableType (const char *new_typename, const char *color, type_t root)
606 {
607   if (!strcmp (root->name, "LINK")){
608     getVariableType(new_typename, color, root);
609   }
610   xbt_dict_cursor_t cursor = NULL;
611   type_t child_type;
612   char *name;
613   xbt_dict_foreach(root->children, cursor, name, child_type) {
614     recursiveNewUserLinkVariableType (new_typename, color, child_type);
615   }
616 }
617
618 void instr_new_user_link_variable_type  (const char *new_typename, const char *color)
619 {
620   recursiveNewUserLinkVariableType (new_typename, color, rootType);
621 }
622
623
624 static void recursiveNewUserHostVariableType (const char *new_typename, const char *color, type_t root)
625 {
626   if (!strcmp (root->name, "HOST")){
627     getVariableType(new_typename, color, root);
628   }
629   xbt_dict_cursor_t cursor = NULL;
630   type_t child_type;
631   char *name;
632   xbt_dict_foreach(root->children, cursor, name, child_type) {
633     recursiveNewUserHostVariableType (new_typename, color, child_type);
634   }
635 }
636
637 void instr_new_user_host_variable_type  (const char *new_typename, const char *color)
638 {
639   recursiveNewUserHostVariableType (new_typename, color, rootType);
640 }
641
642 int instr_platform_traced ()
643 {
644   return platform_created;
645 }
646
647 #endif /* HAVE_TRACING */
648