X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/96cedde3cdbc0b8ffc3f096a1b65d021b0226f99..HEAD:/src/instr/instr_resource_utilization.cpp diff --git a/src/instr/instr_resource_utilization.cpp b/src/instr/instr_resource_utilization.cpp index f41fc2d2c5..8af9cc2dbb 100644 --- a/src/instr/instr_resource_utilization.cpp +++ b/src/instr/instr_resource_utilization.cpp @@ -1,25 +1,27 @@ -/* Copyright (c) 2010-2019. The SimGrid Team. +/* Copyright (c) 2010-2023. 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 "src/instr/instr_private.hpp" +#include "xbt/log.h" #include XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_resource, instr, "tracing (un)-categorized resource utilization"); -void TRACE_surf_resource_set_utilization(const char* type, const char* name, const char* resource, std::string category, - double value, double now, double delta) +namespace simgrid::instr { +void resource_set_utilization(const char* type, const char* name, const char* resource, const std::string& category, + double value, double now, double delta) { // only trace resource utilization if resource is known by tracing mechanism - container_t container = simgrid::instr::Container::by_name_or_null(resource); - if (not container || not value) + Container* container = Container::by_name_or_null(resource); + if (container == nullptr || value == 0.0) return; // trace uncategorized resource utilization if (TRACE_uncategorized()){ - XBT_DEBUG("UNCAT %s [%f - %f] %s %s %f", type, now, now + delta, resource, name, value); + XBT_VERB("UNCAT %s [%f - %f] %s %s %f", type, now, now + delta, resource, name, value); container->get_variable(name)->instr_event(now, delta, resource, value); } @@ -30,3 +32,4 @@ void TRACE_surf_resource_set_utilization(const char* type, const char* name, con container->get_variable(name)->instr_event(now, delta, resource, value); } } +} // namespace simgrid::instr