Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove XBT_INFO call
[simgrid.git] / src / surf / instr_surf.c
1 /* Copyright (c) 2010, 2012-2014. 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 "instr/instr_private.h"
8 #include "surf/surf_private.h"
9
10 #ifdef HAVE_TRACING
11
12 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_surf, instr, "Tracing Surf");
13
14 void TRACE_surf_alloc(void)
15 {
16   TRACE_surf_resource_utilization_alloc();
17 }
18
19 void TRACE_surf_release(void)
20 {
21   TRACE_surf_resource_utilization_release();
22 }
23
24 void TRACE_surf_host_set_power(double date, const char *resource, double power)
25 {
26   if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
27     container_t container = PJ_container_get(resource);
28     type_t type = PJ_type_get ("power", container->type);
29     new_pajeSetVariable(date, container, type, power);
30   }
31 }
32
33 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth)
34 {
35   if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
36     container_t container = PJ_container_get(resource);
37     type_t type = PJ_type_get ("bandwidth", container->type);
38     new_pajeSetVariable(date, container, type, bandwidth);
39   }
40 }
41
42 /* to trace gtnets */
43 void TRACE_surf_gtnets_communicate(void *action, void *src, void *dst)
44 {
45   /*FIXME:surf_action_network_GTNETS_t gtnets_action = (surf_action_network_GTNETS_t)action;
46   gtnets_action->src = src;
47   gtnets_action->dst = dst;*/
48 }
49
50 void TRACE_surf_action(surf_action_t surf_action, const char *category)
51 {
52   if (!TRACE_is_enabled())
53     return;
54   if (!TRACE_categorized ())
55     return;
56   if (!category)
57     return;
58
59   surf_action_set_category(surf_action, category);
60 }
61 #endif /* HAVE_TRACING */