Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
don't hide the C++, deal with it
[simgrid.git] / src / surf / instr_surf.cpp
1 /* Copyright (c) 2010, 2012-2015. 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.h"
8 #include "src/surf/surf_interface.hpp"
9
10 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_surf, instr, "Tracing Surf");
11
12 void TRACE_surf_alloc()
13 {
14   TRACE_surf_resource_utilization_alloc();
15 }
16
17 void TRACE_surf_release()
18 {
19   TRACE_surf_resource_utilization_release();
20 }
21
22 void TRACE_surf_host_set_speed(double date, const char *resource, double speed)
23 {
24   if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
25     container_t container = PJ_container_get(resource);
26     type_t type = PJ_type_get ("power", container->type);
27     new_pajeSetVariable(date, container, type, speed);
28   }
29 }
30
31 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth)
32 {
33   if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
34     container_t container = PJ_container_get(resource);
35     type_t type = PJ_type_get ("bandwidth", container->type);
36     new_pajeSetVariable(date, container, type, bandwidth);
37   }
38 }
39
40 void TRACE_surf_action(surf_action_t surf_action, const char *category)
41 {
42   if (!TRACE_is_enabled())
43     return;
44   if (!TRACE_categorized ())
45     return;
46   if (!category)
47     return;
48
49   surf_action->setCategory(category);
50 }