Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] dictionary for holding smx_process_t -> categories no longer necessary with...
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2010 09:56:16 +0000 (09:56 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2010 09:56:16 +0000 (09:56 +0000)
details:
- counter to uniquely identify simix actions removed, since it is not used anymore

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9030 48e7efb5-ca39-0410-a469-dd3cf9ba447f

buildtools/Cmake/DefinePackages.cmake
src/instr/instr_categories.c [deleted file]
src/instr/instr_config.c
src/instr/instr_msg_task.c
src/instr/instr_private.h
src/instr/instr_smx.c
src/simix/private.h

index fd5b800..1c8f54c 100644 (file)
@@ -299,7 +299,6 @@ set(LUA_SRC
 
 set(TRACING_SRC
        src/instr/instr_config.c
-       src/instr/instr_categories.c
        src/instr/instr_interface.c
        src/instr/instr_paje.c
        src/instr/instr_msg_task.c
diff --git a/src/instr/instr_categories.c b/src/instr/instr_categories.c
deleted file mode 100644 (file)
index 1f87812..0000000
+++ /dev/null
@@ -1,55 +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_category, instr, "Tracing category set/get/del of SMX processes");
-
-static xbt_dict_t current_task_category = NULL;
-
-void TRACE_category_alloc()
-{
-  current_task_category = xbt_dict_new();
-}
-
-void TRACE_category_release()
-{
-  xbt_dict_free(&current_task_category);
-}
-
-void TRACE_category_set(smx_process_t proc, const char *category)
-{
-  char processid[100];
-  char *var_cpy = NULL;
-  snprintf(processid, 100, "%p", proc);
-  var_cpy = xbt_strdup(category);
-  DEBUG2("SET process %p, category %s", proc, category);
-  xbt_dict_set(current_task_category, processid, var_cpy, xbt_free);
-}
-
-char *TRACE_category_get(smx_process_t proc)
-{
-  char processid[100];
-  snprintf(processid, 100, "%p", proc);
-  char *ret = xbt_dict_get_or_null(current_task_category, processid);
-  DEBUG2("GET process %p, category %s", proc, ret);
-  return ret;
-}
-
-void TRACE_category_unset(smx_process_t proc)
-{
-  char processid[100];
-  snprintf(processid, 100, "%p", proc);
-  char *category = xbt_dict_get_or_null(current_task_category, processid);
-  if (category != NULL) {
-    DEBUG2("DEL process %p, category %s", proc, category);
-    xbt_dict_remove(current_task_category, processid);
-  }
-}
-
-#endif /* HAVE_TRACING */
index 53b4ec8..a8a5074 100644 (file)
@@ -119,7 +119,6 @@ int TRACE_start()
   defined_types = xbt_dict_new();
   created_categories = xbt_dict_new();
   TRACE_msg_task_alloc();
-  TRACE_category_alloc();
   TRACE_surf_alloc();
   TRACE_msg_process_alloc();
   TRACE_smpi_alloc();
index 4bbae37..a2d8f6c 100644 (file)
@@ -255,9 +255,6 @@ int TRACE_msg_task_put_start(m_task_t task)
 
   //trace task location grouped by host
   TRACE_task_location_not_present(task);
-
-  //set current category
-  TRACE_category_set(SIMIX_process_self(), task->category);
   return 1;
 }
 
@@ -265,9 +262,6 @@ void TRACE_msg_task_put_end(void)
 {
   if (!TRACE_is_active())
     return;
-
-  TRACE_category_unset(SIMIX_process_self());
-
   DEBUG0("PUT,in");
 }
 
index f175add..49e5aa9 100644 (file)
@@ -64,13 +64,6 @@ void pajeSubVariable(double time, const char *entityType,
 void pajeNewEvent(double time, const char *entityType,
                   const char *container, const char *value);
 
-/* from categories.c */
-void TRACE_category_alloc(void);
-void TRACE_category_release(void);
-void TRACE_category_set(smx_process_t proc, const char *category);
-char *TRACE_category_get(smx_process_t proc);
-void TRACE_category_unset(smx_process_t proc);
-
 /* declaration of instrumentation functions from msg_task_instr.c */
 char *TRACE_task_container(m_task_t task, char *output, int len);
 void TRACE_msg_task_alloc(void);
index c14497c..9ead4a2 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_simix, instr, "Tracing Simix");
 
-static long long int counter = 0;       /* to uniquely identify simix actions */
-
 void TRACE_smx_host_execute(smx_action_t act)
 {
-  if (!TRACE_is_active())
-    return;
-
-  act->counter = counter++;
-  char *category = TRACE_category_get(SIMIX_process_self());
-  if (category) {
-    act->category = xbt_strdup(category);
-    DEBUG2("Create Execute SMX action %p, category %s", act, act->category);
-  }
+  if (!TRACE_is_active()) return;
   TRACE_surf_resource_utilization_start(act);
+  return;
 }
 
 void TRACE_smx_action_communicate(smx_action_t act, smx_process_t proc)
 {
-  if (!TRACE_is_active())
-    return;
-
-  act->counter = counter++;
-  char *category = TRACE_category_get(proc);
-  if (category) {
-    act->category = xbt_strdup(category);
-    DEBUG2("Create Communicate SMX action %p, category %s", act, act->category);
-  }
+  if (!TRACE_is_active()) return;
   TRACE_surf_resource_utilization_start(act);
+  return;
 }
 
 void TRACE_smx_action_destroy(smx_action_t act)
 {
-  if (!TRACE_is_active())
-    return;
-
-  if (act->category) {
-    DEBUG2("Destroy SMX action %p, category %s", act, act->category);
-    xbt_free(act->category);
-  }
+  if (!TRACE_is_active()) return;
   TRACE_surf_resource_utilization_end(act);
+  return;
 }
 
 #endif /* HAVE_TRACING */
index e3fc539..475208e 100644 (file)
@@ -124,7 +124,6 @@ typedef struct s_smx_action {
   };
 
 #ifdef HAVE_TRACING
-  long long int counter;              /* simix action unique identifier for instrumentation */
   char *category;                     /* simix action category for instrumentation */
 #endif
 } s_smx_action_t;