Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] using parser callbacks to trace the platform hierarchy
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 13 Dec 2010 16:44:16 +0000 (16:44 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 13 Dec 2010 16:44:16 +0000 (16:44 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9155 48e7efb5-ca39-0410-a469-dd3cf9ba447f

buildtools/Cmake/DefinePackages.cmake
src/instr/instr_private.h
src/instr/instr_routing.c [new file with mode: 0644]
src/surf/surf_routing.c

index e8726bf..c67866d 100644 (file)
@@ -301,6 +301,7 @@ set(LUA_SRC
 )
 
 set(TRACING_SRC
 )
 
 set(TRACING_SRC
+       src/instr/instr_routing.c
        src/instr/instr_config.c
        src/instr/instr_interface.c
        src/instr/instr_paje.c
        src/instr/instr_config.c
        src/instr/instr_interface.c
        src/instr/instr_paje.c
index c6e1479..18aa963 100644 (file)
@@ -188,5 +188,8 @@ void TRACE_surf_resource_utilization_release(void);
 void TRACE_sd_task_create(SD_task_t task);
 void TRACE_sd_task_destroy(SD_task_t task);
 
 void TRACE_sd_task_create(SD_task_t task);
 void TRACE_sd_task_destroy(SD_task_t task);
 
+/* instr_routing.c */
+void instr_routing_define_callbacks (void);
+
 #endif /* HAVE_TRACING */
 #endif /* INSTR_PRIVATE_H_ */
 #endif /* HAVE_TRACING */
 #endif /* INSTR_PRIVATE_H_ */
diff --git a/src/instr/instr_routing.c b/src/instr/instr_routing.c
new file mode 100644 (file)
index 0000000..586c82c
--- /dev/null
@@ -0,0 +1,66 @@
+/* Copyright (c) 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+  * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "instr/instr_private.h"
+
+#ifdef HAVE_TRACING
+#include "surf/surfxml_parse_private.h"
+
+static void instr_routing_parse_start_AS (void);
+static void instr_routing_parse_end_AS (void);
+static void instr_routing_parse_start_link (void);
+static void instr_routing_parse_end_link (void);
+static void instr_routing_parse_start_host (void);
+static void instr_routing_parse_end_host (void);
+static void instr_routing_parse_start_router (void);
+static void instr_routing_parse_end_router (void);
+
+void instr_routing_define_callbacks ()
+{
+  surfxml_add_callback(STag_surfxml_AS_cb_list, &instr_routing_parse_start_AS);
+  surfxml_add_callback(ETag_surfxml_AS_cb_list, &instr_routing_parse_end_AS);
+  surfxml_add_callback(STag_surfxml_link_cb_list, &instr_routing_parse_start_link);
+  surfxml_add_callback(ETag_surfxml_link_cb_list, &instr_routing_parse_end_link);
+  surfxml_add_callback(STag_surfxml_host_cb_list, &instr_routing_parse_start_host);
+  surfxml_add_callback(ETag_surfxml_host_cb_list, &instr_routing_parse_end_host);
+  surfxml_add_callback(STag_surfxml_router_cb_list, &instr_routing_parse_start_router);
+  surfxml_add_callback(ETag_surfxml_router_cb_list, &instr_routing_parse_end_router);
+}
+
+static void instr_routing_parse_start_AS ()
+{
+}
+
+static void instr_routing_parse_end_AS ()
+{
+}
+
+static void instr_routing_parse_start_link ()
+{
+}
+
+static void instr_routing_parse_end_link ()
+{
+}
+
+static void instr_routing_parse_start_host ()
+{
+}
+
+static void instr_routing_parse_end_host ()
+{
+}
+
+static void instr_routing_parse_start_router ()
+{
+}
+
+static void instr_routing_parse_end_router ()
+{
+}
+
+#endif
+
index 59d95b4..387c0dd 100644 (file)
@@ -1111,6 +1111,10 @@ void routing_model_create(size_t size_of_links, void *loopback, double_f_cpvoid_
                                           &routing_parse_Sconfig);
   surfxml_add_callback(ETag_surfxml_config_cb_list,
                                           &routing_parse_Econfig);
                                           &routing_parse_Sconfig);
   surfxml_add_callback(ETag_surfxml_config_cb_list,
                                           &routing_parse_Econfig);
+
+#ifdef HAVE_TRACING
+  instr_routing_define_callbacks();
+#endif
 }
 
 /* ************************************************************************** */
 }
 
 /* ************************************************************************** */