Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sort include lists according to clang-format.
[simgrid.git] / src / surf / instr_surf.cpp
1 /* Copyright (c) 2010, 2012-2017. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #include "src/instr/instr_private.hpp"
8 #include "src/surf/surf_interface.hpp"
9
10 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_surf, instr, "Tracing Surf");
11
12 void TRACE_surf_host_set_speed(double date, const char *resource, double speed)
13 {
14   if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
15     container_t container = PJ_container_get(resource);
16     simgrid::instr::Type* type = container->type_->getChild("power");
17     new simgrid::instr::SetVariableEvent(date, container, type, speed);
18   }
19 }
20
21 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth)
22 {
23   if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
24     container_t container = PJ_container_get(resource);
25     simgrid::instr::Type* type = container->type_->getChild("bandwidth");
26     new simgrid::instr::SetVariableEvent(date, container, type, bandwidth);
27   }
28 }
29
30 void TRACE_surf_action(surf_action_t surf_action, const char *category)
31 {
32   if (not TRACE_is_enabled())
33     return;
34   if (not TRACE_categorized())
35     return;
36   if (not category)
37     return;
38
39   surf_action->setCategory(category);
40 }