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/private.h"
11 static long long int counter = 0; /* to uniquely identify simix actions */
13 void TRACE_smx_action_execute (smx_action_t act)
15 if (!IS_TRACING) return;
17 act->counter = counter++;
18 char *category = __TRACE_current_category_get (SIMIX_process_self());
20 act->category = xbt_new (char, strlen (category)+1);
21 strncpy (act->category, category, strlen(category)+1);
25 void TRACE_smx_action_communicate (smx_action_t act, smx_process_t proc)
27 if (!IS_TRACING) return;
29 act->counter = counter++;
30 char *category = __TRACE_current_category_get (proc);
32 act->category = xbt_strdup (category);
36 void TRACE_smx_action_destroy (smx_action_t act)
38 if (!IS_TRACING || !IS_TRACED(act)) return;
41 xbt_free (act->category);