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 container_t container = simgrid::instr::Container::byName(resource);
16 simgrid::instr::VariableType* variable =
17 static_cast<simgrid::instr::VariableType*>(container->type_->byName("power"));
18 variable->setEvent(date, container, speed);
22 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth)
24 if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
25 container_t container = simgrid::instr::Container::byName(resource);
26 simgrid::instr::VariableType* variable =
27 static_cast<simgrid::instr::VariableType*>(container->type_->byName("bandwidth"));
28 variable->setEvent(date, container, bandwidth);
32 void TRACE_surf_action(surf_action_t surf_action, const char *category)
34 if (not TRACE_is_enabled())
36 if (not TRACE_categorized())
41 surf_action->setCategory(category);