Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] use xbt_strdup to copy category
[simgrid.git] / src / instr / instr_simdag.c
1 /* Copyright (c) 2010. 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
9 #ifdef HAVE_TRACING
10
11 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_simdag, instr, "Tracing SimDAG");
12
13 void TRACE_sd_task_create(SD_task_t task)
14 {
15   task->category = NULL;
16 }
17
18 void TRACE_sd_task_destroy(SD_task_t task)
19 {
20   xbt_free(task->category);
21 }
22
23 void TRACE_sd_set_task_category(SD_task_t task, const char *category)
24 {
25   if (!TRACE_is_active())
26     return;
27   task->category = xbt_strdup (category);
28 }
29
30 #endif /* HAVE_TRACING */