Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
pre version hierarchical routing, fix memory leak
[simgrid.git] / src / instr / paje.c
index ee2f22c..b86e138 100644 (file)
@@ -1,17 +1,10 @@
-/*
- * general.c
- *
- *  Created on: Oct 7, 2009
- *      Author: Lucas Schnorr
- *     License: 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.
- *
- *     Copyright (c) 2009 The SimGrid team.
- */
+/* 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/private.h"
-#include "instr/config.h"
 
 #ifdef HAVE_TRACING
 
@@ -44,6 +37,8 @@ static int pajeSetVariableId = 22;
 static int pajeAddVariableId = 23;
 static int pajeSubVariableId = 24;
 static int pajeDefineVariableTypeId = 25;
+static int pajeStartLinkWithVolumeId = 26;
+static int pajeNewEventId = 27;
 
 #define TRACE_LINE_SIZE 1000
 
@@ -242,7 +237,22 @@ void TRACE_paje_create_header(void) {
 %%       Alias string \n\
 %%       ContainerType string \n\
 %%       Name string \n\
-%%EndEventDef \n",
+%%EndEventDef \n\
+%%EventDef PajeStartLink %d \n\
+%%       Time date \n\
+%%       EntityType string \n\
+%%       Container string \n\
+%%       Value string \n\
+%%       SourceContainer string \n\
+%%       Key string \n\
+%%       Volume string \n\
+%%EndEventDef\n\
+%%EventDef PajeNewEvent %d \n\
+%%       Time date \n\
+%%       EntityType string \n\
+%%       Container string \n\
+%%       Value string \n\
+%%EndEventDef\n",
       pajeDefineContainerTypeId, pajeDefineStateTypeId, pajeDefineEntityValueId,
       pajeDefineEventTypeId, pajeDefineLinkTypeId, pajeCreateContainerId,
       pajeDestroyContainerId, pajeSetStateId, pajeSetStateWithHostId,
@@ -255,7 +265,9 @@ void TRACE_paje_create_header(void) {
       pajeSetVariableId,
       pajeAddVariableId,
       pajeSubVariableId,
-      pajeDefineVariableTypeId);
+      pajeDefineVariableTypeId,
+      pajeStartLinkWithVolumeId,
+      pajeNewEventId);
 }
 
 /* internal to this file */
@@ -413,6 +425,14 @@ void pajeStartLinkWithBandwidthLatency (double time, const char *entityType, con
   fprintf (tracing_file, "%s %f %f\n", line, bw, lat);
 }
 
+void pajeStartLinkWithVolume (double time, const char *entityType, const char *container, const char *value,
+    const char *sourceContainer, const char *key, double volume)
+{
+  char line[TRACE_LINE_SIZE];
+  __pajeStartLink (line, TRACE_LINE_SIZE, pajeStartLinkWithVolumeId, time, entityType, container, value, sourceContainer, key);
+  fprintf (tracing_file, "%s %f\n", line, volume);
+}
+
 void pajeEndLink (double time, const char *entityType, const char *container, const char *value,
     const char *destContainer, const char *key)
 {
@@ -445,4 +465,9 @@ void pajeSubVariable (double time, const char *entityType, const char *container
   fprintf(tracing_file, "%s\n", line);
 }
 
+void pajeNewEvent (double time, const char *entityType, const char *container, const char *value)
+{
+  fprintf(tracing_file, "%d %.15lf %s %s %s\n", pajeNewEventId, time, entityType, container, value);
+}
+
 #endif