From 39b9e5b7c5a9642f2cf286a8b1a4e5a089741242 Mon Sep 17 00:00:00 2001 From: schnorr Date: Mon, 13 Dec 2010 16:44:16 +0000 Subject: [PATCH] [trace] using parser callbacks to trace the platform hierarchy git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9155 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- buildtools/Cmake/DefinePackages.cmake | 1 + src/instr/instr_private.h | 3 ++ src/instr/instr_routing.c | 66 +++++++++++++++++++++++++++ src/surf/surf_routing.c | 4 ++ 4 files changed, 74 insertions(+) create mode 100644 src/instr/instr_routing.c diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index e8726bfc49..c67866d2ad 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -301,6 +301,7 @@ set(LUA_SRC ) set(TRACING_SRC + src/instr/instr_routing.c src/instr/instr_config.c src/instr/instr_interface.c src/instr/instr_paje.c diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index c6e1479ae7..18aa963351 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -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); +/* instr_routing.c */ +void instr_routing_define_callbacks (void); + #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 index 0000000000..586c82c043 --- /dev/null +++ b/src/instr/instr_routing.c @@ -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 + diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 59d95b4fad..387c0ddd8e 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -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); + +#ifdef HAVE_TRACING + instr_routing_define_callbacks(); +#endif } /* ************************************************************************** */ -- 2.20.1