Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] better checks on setting cats, if NULL is provided, task is no longer traced
authorschnorr <Lucas.Schnorr@imag.fr>
Sun, 25 Mar 2012 20:57:06 +0000 (22:57 +0200)
committerschnorr <Lucas.Schnorr@imag.fr>
Sun, 25 Mar 2012 20:57:06 +0000 (22:57 +0200)
buildtools/Cmake/DefinePackages.cmake
src/instr/instr_simdag.c [deleted file]
src/simdag/sd_task.c

index 9efdaf8..c93a7fc 100644 (file)
@@ -354,7 +354,6 @@ set(TRACING_SRC
        src/instr/instr_msg_process.c
        src/instr/instr_surf.c
        src/instr/instr_smpi.c
-       src/instr/instr_simdag.c
        src/instr/instr_resource_utilization.c
        src/instr/instr_private.h
 )
diff --git a/src/instr/instr_simdag.c b/src/instr/instr_simdag.c
deleted file mode 100644 (file)
index 668b3a7..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2010. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
-  * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "instr/instr_private.h"
-
-#ifdef HAVE_TRACING
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_simdag, instr, "Tracing SimDAG");
-
-void TRACE_sd_set_task_category(SD_task_t task, const char *category)
-{
-  if (!TRACE_is_enabled())
-    return;
-  task->category = xbt_strdup (category);
-}
-
-#endif /* HAVE_TRACING */
index 4070449..9fd8b60 100644 (file)
@@ -1420,7 +1420,14 @@ void SD_task_schedulel(SD_task_t task, int count, ...)
 void SD_task_set_category (SD_task_t task, const char *category)
 {
 #ifdef HAVE_TRACING
-  TRACE_sd_set_task_category (task, category);
+  if (!TRACE_is_enabled()) return;
+  if (task == NULL) return;
+  if (category == NULL){
+    if (task->category) xbt_free (task->category);
+    task->category = NULL;
+  }else{
+    task->category = xbt_strdup (category);
+  }
 #endif
 }