From 90c25075db7fffb9a771de224159039029e20724 Mon Sep 17 00:00:00 2001 From: schnorr Date: Tue, 31 Jul 2012 23:08:09 +0200 Subject: [PATCH 1/1] [trace] only update power and bandwidth if trace subsystem is configured to trace them --- src/instr/instr_surf.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/instr/instr_surf.c b/src/instr/instr_surf.c index a79ecabb60..9faf3a89fc 100644 --- a/src/instr/instr_surf.c +++ b/src/instr/instr_surf.c @@ -24,22 +24,20 @@ void TRACE_surf_release(void) void TRACE_surf_host_set_power(double date, const char *resource, double power) { - if (!TRACE_is_enabled()) - return; - - container_t container = PJ_container_get(resource); - type_t type = PJ_type_get ("power", container->type); - new_pajeSetVariable(date, container, type, power); + if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) { + container_t container = PJ_container_get(resource); + type_t type = PJ_type_get ("power", container->type); + new_pajeSetVariable(date, container, type, power); + } } void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth) { - if (!TRACE_is_enabled()) - return; - - container_t container = PJ_container_get(resource); - type_t type = PJ_type_get ("bandwidth", container->type); - new_pajeSetVariable(date, container, type, bandwidth); + if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) { + container_t container = PJ_container_get(resource); + type_t type = PJ_type_get ("bandwidth", container->type); + new_pajeSetVariable(date, container, type, bandwidth); + } } /* to trace gtnets */ -- 2.20.1