Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] categories may have colors registered in the trace file
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 6 Dec 2010 00:55:52 +0000 (00:55 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 6 Dec 2010 00:55:52 +0000 (00:55 +0000)
details:
- specify color randomly if no color is provided

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

examples/msg/tracing/categories.c
examples/msg/tracing/ms.c
examples/msg/tracing/procmig.c
examples/msg/tracing/tasks.c
examples/msg/tracing/volume.c

index 07d03f6..8a12f81 100644 (file)
@@ -107,11 +107,11 @@ int main(int argc, char *argv[])
     exit(1);
   }
 
-  //declaring user categories
-  TRACE_category("compute");
-  TRACE_category("request");
-  TRACE_category("data");
-  TRACE_category("finalize");
+  //declaring user categories with RGB colors
+  TRACE_category_with_color ("compute", "1 0 0"); //red
+  TRACE_category_with_color ("request", "0 1 0"); //green
+  TRACE_category_with_color ("data", "0 0 1");    //blue
+  TRACE_category_with_color ("finalize", "0 0 0");//black
 
   res = test_all(argv[1], argv[2]);
   MSG_clean();
index 179e1c5..3aa6073 100644 (file)
@@ -123,9 +123,13 @@ int main(int argc, char *argv[])
   //declaring user markers
   TRACE_declare_mark("msmark");
 
-  //declaring user categories
-  TRACE_category("compute");
-  TRACE_category("finalize");
+  //declaring user categories with RGB colors (values from 0 to 1)
+  TRACE_category_with_color ("compute", "1 0 0");  //compute is red
+  TRACE_category_with_color ("finalize", "0 1 0"); //finalize is green
+  //categories without user-defined colors receive
+  //random colors generated by the tracing system
+  TRACE_category ("request");
+  TRACE_category_with_color ("report", NULL);
 
   res = test_all(argv[1], argv[2]);
   MSG_clean();
index 2a22680..edd2945 100644 (file)
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
               argv[0]);
     exit(1);
   }
-  TRACE_category("emigrant");
+  TRACE_category_with_color ("emigrant", "1 0 0");
 
   /* Simulation setting */
   MSG_create_environment(argv[1]);
index 8cac0f8..827d258 100644 (file)
@@ -112,8 +112,8 @@ int main(int argc, char *argv[])
   }
 
   //declaring user categories
-  TRACE_category("compute");
-  TRACE_category("finalize");
+  TRACE_category_with_color ("compute", "1 0 0");  //compute is red
+  TRACE_category_with_color ("finalize", "0 1 0"); //finalize is green
 
   res = test_all(argv[1], argv[2]);
   MSG_clean();
index da85069..b35e651 100644 (file)
@@ -119,14 +119,14 @@ int main(int argc, char *argv[])
   //     - the tasks sent have a category
 
   //declaring user categories (for tasks)
-  TRACE_category("compute");
-  TRACE_category("request");
-  TRACE_category("data");
-  TRACE_category("finalize");
+  TRACE_category_with_color ("compute", "1 0 0"); //red
+  TRACE_category_with_color ("request", "0 1 0"); //green
+  TRACE_category_with_color ("data", "0 0 1");    //blue
+  TRACE_category_with_color ("finalize", "0 0 0");//black
 
   //declaring user categories (for processes)
-  TRACE_category("master");
-  TRACE_category("slave");
+  TRACE_category_with_color ("master", "1 0 0");
+  TRACE_category_with_color ("slave", "0 0 1");
 
   res = test_all(argv[1], argv[2]);
   MSG_clean();