Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Indent include and src using this command:
[simgrid.git] / src / instr / sd_instr.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/private.h"
8
9 #ifdef HAVE_TRACING
10
11 void TRACE_sd_task_create(SD_task_t task)
12 {
13   if (!IS_TRACING)
14     return;
15   task->category = NULL;
16 }
17
18 void TRACE_sd_task_destroy(SD_task_t task)
19 {
20   if (!IS_TRACING)
21     return;
22   if (task->category)
23     xbt_free(task->category);
24 }
25
26 void TRACE_sd_set_task_category(SD_task_t task, const char *category)
27 {
28   if (!IS_TRACING)
29     return;
30   task->category = xbt_new(char, strlen(category) + 1);
31   strncpy(task->category, category, strlen(category) + 1);
32 }
33
34 #endif