1 /* Copyright (c) 2010, 2012-2017. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #include "src/instr/instr_private.hpp"
8 #include "src/surf/surf_interface.hpp"
10 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_surf, instr, "Tracing Surf");
12 void TRACE_surf_host_set_speed(double date, const char *resource, double speed)
14 if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
15 simgrid::instr::Container::byName(resource)->getVariable("power")->setEvent(date, speed);
19 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth)
21 if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
22 simgrid::instr::Container::byName(resource)->getVariable("bandwidth")->setEvent(date, bandwidth);
26 void TRACE_surf_action(surf_action_t surf_action, const char *category)
28 if (not TRACE_is_enabled() || not TRACE_categorized() || not category)
31 surf_action->setCategory(category);