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"
9 #include "surf/network_gtnets_private.h"
13 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_surf, instr, "Tracing Surf");
15 void TRACE_surf_alloc(void)
17 TRACE_surf_resource_utilization_alloc();
20 void TRACE_surf_release(void)
22 TRACE_surf_resource_utilization_release();
25 void TRACE_surf_host_set_power(double date, const char *resource, double power)
27 if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
28 container_t container = PJ_container_get(resource);
29 type_t type = PJ_type_get ("power", container->type);
30 new_pajeSetVariable(date, container, type, power);
34 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth)
36 if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
37 container_t container = PJ_container_get(resource);
38 type_t type = PJ_type_get ("bandwidth", container->type);
39 new_pajeSetVariable(date, container, type, bandwidth);
44 void TRACE_surf_gtnets_communicate(void *action, void *src, void *dst)
46 surf_action_network_GTNETS_t gtnets_action = (surf_action_network_GTNETS_t)action;
47 gtnets_action->src = src;
48 gtnets_action->dst = dst;
51 void TRACE_surf_action(surf_action_t surf_action, const char *category)
53 if (!TRACE_is_enabled())
55 if (!TRACE_categorized ())
60 surf_action->category = xbt_strdup(category);
62 #endif /* HAVE_TRACING */