1 /* Copyright (c) 2010. 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 "instr/instr_private.h"
8 #include "surf/surf_private.h"
12 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_surf, instr, "Tracing Surf");
14 void TRACE_surf_alloc(void)
16 TRACE_surf_resource_utilization_alloc();
19 void TRACE_surf_release(void)
21 TRACE_surf_resource_utilization_release();
24 static void TRACE_surf_set_resource_variable(double date,
29 char value_str[INSTR_DEFAULT_STR_SIZE];
30 snprintf(value_str, 100, "%f", value);
31 char *variable_type = getVariableTypeIdByName(variable, getContainerByName(resource)->type);
32 pajeSetVariable(date, variable, variable_type, value_str);
35 void TRACE_surf_host_set_power(double date, const char *resource, double power)
37 if (!TRACE_is_active())
40 char *variable_type = getVariableTypeIdByName("power", getContainerByName(resource)->type);
41 TRACE_surf_set_resource_variable(date, variable_type, resource, power);
44 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth)
46 if (!TRACE_is_active())
49 char *variable_type = getVariableTypeIdByName("bandwidth", getContainerByName(resource)->type);
50 TRACE_surf_set_resource_variable(date, variable_type, resource, bandwidth);
53 //FIXME: this function is not used (latency availability traces support exists in surf network models?)
54 void TRACE_surf_link_set_latency(double date, const char *resource, double latency)
56 if (!TRACE_is_active())
59 char *variable_type = getVariableTypeIdByName("latency", getContainerByName(resource)->type);
60 TRACE_surf_set_resource_variable(date, variable_type, resource, latency);
64 void TRACE_surf_gtnets_communicate(void *action, int src, int dst)
68 int TRACE_surf_gtnets_get_src(void *action)
73 int TRACE_surf_gtnets_get_dst(void *action)
78 void TRACE_surf_gtnets_destroy(void *action)
82 void TRACE_surf_action(surf_action_t surf_action, const char *category)
84 if (!TRACE_is_active())
86 if (!TRACE_categorized ())
91 surf_action->category = xbt_strdup(category);
93 #endif /* HAVE_TRACING */