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"
11 static long long int counter = 0; /* to uniquely identify simix actions */
13 void TRACE_smx_host_execute(smx_action_t act)
15 if (!TRACE_is_active())
18 act->counter = counter++;
19 char *category = TRACE_category_get(SIMIX_process_self());
21 act->category = xbt_new(char, strlen(category) + 1);
22 strncpy(act->category, category, strlen(category) + 1);
24 TRACE_surf_resource_utilization_start(act);
27 void TRACE_smx_action_communicate(smx_action_t act, smx_process_t proc)
29 if (!TRACE_is_active())
32 act->counter = counter++;
33 char *category = TRACE_category_get(proc);
35 act->category = xbt_strdup(category);
37 TRACE_surf_resource_utilization_start(act);
40 void TRACE_smx_action_destroy(smx_action_t act)
42 if (!TRACE_is_active())
46 xbt_free(act->category);
48 TRACE_surf_resource_utilization_end(act);
51 #endif /* HAVE_TRACING */