X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/518bd26c68915a241ed8b7b90347a0d5f14be4b8..eb458edefa0962215cc62c304bc44588308aecc4:/src/instr/paje.c diff --git a/src/instr/paje.c b/src/instr/paje.c index b86e138694..d2d211cd1c 100644 --- a/src/instr/paje.c +++ b/src/instr/paje.c @@ -18,21 +18,21 @@ static int pajeDefineEventTypeId = 3; static int pajeDefineLinkTypeId = 4; static int pajeCreateContainerId = 5; static int pajeSetStateId = 6; -static int pajePushStateWithHostId = 7; +#define UNUSED007 7 static int pajePopStateId = 8; static int pajeDestroyContainerId = 9; -static int pajeSetStateWithHostId = 10; -static int pajeSetStateWithHostCommCompId = 11; +#define UNUSED006 10 +#define UNUSED003 11 static int pajeStartLinkId = 12; static int pajeEndLinkId = 13; -static int pajeCreateContainerWithPowerId = 14; -static int pajeStartLinkWithBandwidthLatencyId = 15; -static int pajePushStateWithPowerUsedId = 16; -static int pajePushStateWithBandwidthUsedId = 17; -static int pajeSetStateWithPowerUsedId = 18; +#define UNUSED000 14 +#define UNUSED004 15 +#define UNUSED008 16 +#define UNUSED009 17 +#define UNUSED005 18 static int pajePushStateId = 19; -static int pajeCreateContainerWithBandwidthLatencyId = 20; -static int pajeCreateContainerWithBandwidthLatencySrcDstId = 21; +#define UNUSED001 20 +static int pajeDefineVariableTypeWithColorId = 21; static int pajeSetVariableId = 22; static int pajeAddVariableId = 23; static int pajeSubVariableId = 24; @@ -42,25 +42,24 @@ static int pajeNewEventId = 27; #define TRACE_LINE_SIZE 1000 -void TRACE_paje_start (FILE *file) +void TRACE_paje_start(FILE * file) { tracing_file = file; tracing_active = 1; } -FILE *TRACE_paje_end (void) +FILE *TRACE_paje_end(void) { tracing_active = 0; return tracing_file; } -void TRACE_paje_create_header(void) { +void TRACE_paje_create_header(void) +{ if (!tracing_active) return; - fprintf( - tracing_file, - " \ + fprintf(tracing_file, "\ %%EventDef PajeDefineContainerType %d \n\ %% Alias string \n\ %% ContainerType string \n\ @@ -106,34 +105,11 @@ void TRACE_paje_create_header(void) { %% Container string \n\ %% Value string \n\ %%EndEventDef\n\ -%%EventDef PajeSetState %d \n\ -%% Time date \n\ -%% EntityType string \n\ -%% Container string \n\ -%% Value string \n\ -%% Host string\n\ -%%EndEventDef\n\ -%%EventDef PajePushState %d \n\ -%% Time date \n\ -%% EntityType string \n\ -%% Container string \n\ -%% Value string \n\ -%% Host string \n\ -%%EndEventDef\n\ %%EventDef PajePopState %d \n\ %% Time date \n\ %% EntityType string \n\ %% Container string \n\ %%EndEventDef\n\ -%%EventDef PajeSetState %d \n\ -%% Time date \n\ -%% EntityType string \n\ -%% Container string \n\ -%% Value string \n\ -%% Host string\n\ -%% Comm string\n\ -%% Comp string\n\ -%%EndEventDef\n\ %%EventDef PajeStartLink %d \n\ %% Time date \n\ %% EntityType string \n\ @@ -150,71 +126,12 @@ void TRACE_paje_create_header(void) { %% DestContainer string \n\ %% Key string \n\ %%EndEventDef\n\ -%%EventDef PajeCreateContainer %d \n\ -%% Time date \n\ -%% Alias string \n\ -%% Type string \n\ -%% Container string \n\ -%% Name string \n\ -%% Power string \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\ -%% Bandwidth string \n\ -%% Latency string \n\ -%%EndEventDef\n\ -%%EventDef PajePushState %d \n\ -%% Time date \n\ -%% EntityType string \n\ -%% Container string \n\ -%% Value string \n\ -%% PowerUsed string \n\ -%%EndEventDef\n\ -%%EventDef PajePushState %d \n\ -%% Time date \n\ -%% EntityType string \n\ -%% Container string \n\ -%% Value string \n\ -%% BandwidthUsed string \n\ -%%EndEventDef\n\ -%%EventDef PajeSetState %d \n\ -%% Time date \n\ -%% EntityType string \n\ -%% Container string \n\ -%% Value string \n\ -%% PowerUsed string \n\ -%%EndEventDef\n\ %%EventDef PajePushState %d \n\ %% Time date \n\ %% EntityType string \n\ %% Container string \n\ %% Value string \n\ %%EndEventDef\n\ -%%EventDef PajeCreateContainer %d \n\ -%% Time date \n\ -%% Alias string \n\ -%% Type string \n\ -%% Container string \n\ -%% Name string \n\ -%% Bandwidth string \n\ -%% Latency string \n\ -%%EndEventDef \n\ -%%EventDef PajeCreateContainer %d \n\ -%% Time date \n\ -%% Alias string \n\ -%% Type string \n\ -%% Container string \n\ -%% Name string \n\ -%% Bandwidth string \n\ -%% Latency string \n\ -%% SrcHost string \n\ -%% DstHost string \n\ -%%EndEventDef \n\ %%EventDef PajeSetVariable %d \n\ %% Time date \n\ %% EntityType string \n\ @@ -238,6 +155,12 @@ void TRACE_paje_create_header(void) { %% ContainerType string \n\ %% Name string \n\ %%EndEventDef \n\ +%%EventDef PajeDefineVariableType %d \n\ +%% Alias string \n\ +%% ContainerType string \n\ +%% Name string \n\ +%% Color color \n\ +%%EndEventDef \n\ %%EventDef PajeStartLink %d \n\ %% Time date \n\ %% EntityType string \n\ @@ -252,222 +175,190 @@ void TRACE_paje_create_header(void) { %% EntityType string \n\ %% Container string \n\ %% Value string \n\ -%%EndEventDef\n", - pajeDefineContainerTypeId, pajeDefineStateTypeId, pajeDefineEntityValueId, - pajeDefineEventTypeId, pajeDefineLinkTypeId, pajeCreateContainerId, - pajeDestroyContainerId, pajeSetStateId, pajeSetStateWithHostId, - pajePushStateWithHostId, pajePopStateId, pajeSetStateWithHostCommCompId, - pajeStartLinkId, pajeEndLinkId, pajeCreateContainerWithPowerId, - pajeStartLinkWithBandwidthLatencyId, pajePushStateWithPowerUsedId, - pajePushStateWithBandwidthUsedId, pajeSetStateWithPowerUsedId, - pajePushStateId, pajeCreateContainerWithBandwidthLatencyId, - pajeCreateContainerWithBandwidthLatencySrcDstId, - pajeSetVariableId, - pajeAddVariableId, - pajeSubVariableId, - pajeDefineVariableTypeId, - pajeStartLinkWithVolumeId, - pajeNewEventId); +%%EndEventDef\n", pajeDefineContainerTypeId, pajeDefineStateTypeId, pajeDefineEntityValueId, pajeDefineEventTypeId, pajeDefineLinkTypeId, pajeCreateContainerId, pajeDestroyContainerId, pajeSetStateId, pajePopStateId, pajeStartLinkId, pajeEndLinkId, pajePushStateId, pajeSetVariableId, pajeAddVariableId, pajeSubVariableId, pajeDefineVariableTypeId, pajeDefineVariableTypeWithColorId, pajeStartLinkWithVolumeId, pajeNewEventId); } /* internal to this file */ -static void __pajeCreateContainer (char *output, int len, int eventid, double time, const char *alias, const char *type, - const char *container, const char *name) +static void __pajeCreateContainer(char *output, int len, int eventid, + double time, const char *alias, + const char *type, const char *container, + const char *name) { - snprintf (output, len, "%d %.15lf %s %s %s %s", eventid, time, - alias, type, container, name); + snprintf(output, len, "%d %lf %s %s %s %s", eventid, time, + alias, type, container, name); } -static void __pajeSetState (char *output, int len, int eventid, double time, const char *entityType, const char *container, const char *value) +static void __pajeSetState(char *output, int len, int eventid, double time, + const char *entityType, const char *container, + const char *value) { - snprintf (output, len, "%d %.15lf %s %s %s", eventid, time, entityType, container, value); + snprintf(output, len, "%d %lf %s %s %s", eventid, time, entityType, + container, value); } -static void __pajeSetVariable (char *output, int len, int eventid, double time, const char *entityType, const char *container, const char *value) +static void __pajeSetVariable(char *output, int len, int eventid, + double time, const char *entityType, + const char *container, const char *value) { - snprintf (output, len, "%d %.15lf %s %s %s", eventid, time, entityType, container, value); + snprintf(output, len, "%d %lf %s %s %s", eventid, time, entityType, + container, value); } -static void __pajeStartLink (char *output, int len, int eventid, double time, const char *entityType, const char *container, const char *value, -const char *sourceContainer, const char *key) +static void __pajeStartLink(char *output, int len, int eventid, + double time, const char *entityType, + const char *container, const char *value, + const char *sourceContainer, const char *key) { - snprintf(output, len, "%d %.15lf %s %s %s %s %s", eventid, time, entityType, container, value, sourceContainer, key); + snprintf(output, len, "%d %lf %s %s %s %s %s", eventid, time, entityType, + container, value, sourceContainer, key); } - /* internal do the instrumentation module */ void pajeDefineContainerType(const char *alias, const char *containerType, - const char *name) { + const char *name) +{ fprintf(tracing_file, "%d %s %s %s\n", pajeDefineContainerTypeId, alias, - containerType, name); + containerType, name); } void pajeDefineStateType(const char *alias, const char *containerType, - const char *name) { + const char *name) +{ fprintf(tracing_file, "%d %s %s %s\n", pajeDefineStateTypeId, alias, - containerType, name); + containerType, name); } void pajeDefineEventType(const char *alias, const char *containerType, - const char *name) { + const char *name) +{ fprintf(tracing_file, "%d %s %s %s\n", pajeDefineEventTypeId, alias, - containerType, name); + containerType, name); } void pajeDefineLinkType(const char *alias, const char *containerType, - const char *sourceContainerType, const char *destContainerType, - const char *name) { - fprintf(tracing_file, "%d %s %s %s %s %s\n", pajeDefineLinkTypeId, alias, - containerType, sourceContainerType, destContainerType, name); -} - -void pajeCreateContainer(double time, const char *alias, const char *type, const char *container, const char *name) { - char line[TRACE_LINE_SIZE]; - __pajeCreateContainer (line, TRACE_LINE_SIZE, pajeCreateContainerId, time, alias, type, container, name); - fprintf (tracing_file, "%s\n", line); -} - -void pajeCreateContainerWithPower (double time, const char *alias, const char *type, const char *container, const char *name, double power) -{ - char line[TRACE_LINE_SIZE]; - __pajeCreateContainer (line, TRACE_LINE_SIZE, pajeCreateContainerWithPowerId, time, alias, type, container, name); - fprintf (tracing_file, "%s %f\n", line, power); -} - -void pajeCreateContainerWithBandwidthLatency (double time, const char *alias, const char *type, const char *container, const char *name, double bw, double lat) -{ - char line[TRACE_LINE_SIZE]; - __pajeCreateContainer (line, TRACE_LINE_SIZE, pajeCreateContainerWithBandwidthLatencyId, time, alias, type, container, name); - fprintf (tracing_file, "%s %f %f\n", line, bw, lat); -} - - -void pajeCreateContainerWithBandwidthLatencySrcDst (double time, const char *alias, const char *type, const char *container, const char *name, double bw, double lat, const char *src, const char *dst) -{ - char line[TRACE_LINE_SIZE]; - __pajeCreateContainer (line, TRACE_LINE_SIZE, pajeCreateContainerWithBandwidthLatencySrcDstId, time, alias, type, container, name); - fprintf (tracing_file, "%s %f %f %s %s\n", line, bw, lat, src, dst); -} - - -void pajeDestroyContainer (double time, const char *type, const char *container) + const char *sourceContainerType, + const char *destContainerType, const char *name) { - fprintf(tracing_file, "%d %.15lf %s %s\n", pajeDestroyContainerId, time, type, container); + fprintf(tracing_file, "%d %s %s %s %s %s\n", pajeDefineLinkTypeId, alias, + containerType, sourceContainerType, destContainerType, name); } -void pajeSetState (double time, const char *entityType, const char *container, const char *value) +void pajeCreateContainer(double time, const char *alias, const char *type, + const char *container, const char *name) { char line[TRACE_LINE_SIZE]; - __pajeSetState (line, TRACE_LINE_SIZE, pajeSetStateId, time, entityType, container, value); + __pajeCreateContainer(line, TRACE_LINE_SIZE, pajeCreateContainerId, time, + alias, type, container, name); fprintf(tracing_file, "%s\n", line); } -void pajeSetStateWithPowerUsed (double time, const char *entityType, const char *container, const char *value, double powerUsed) -{ - char line[TRACE_LINE_SIZE]; - __pajeSetState (line, TRACE_LINE_SIZE, pajeSetStateWithPowerUsedId, time, entityType, container, value); - fprintf(tracing_file, "%s %f\n", line, powerUsed); -} - -void pajeSetStateWithHost (double time, const char *entityType, const char *container, const char *value, const char *host) +void pajeDestroyContainer(double time, const char *type, + const char *container) { - char line[TRACE_LINE_SIZE]; - __pajeSetState (line, TRACE_LINE_SIZE, pajeSetStateWithHostId, time, entityType, container, value); - fprintf(tracing_file, "%s %s\n", line, host); + fprintf(tracing_file, "%d %lf %s %s\n", pajeDestroyContainerId, time, + type, container); } -void pajePushState (double time, const char *entityType, const char *container, const char *value) +void pajeSetState(double time, const char *entityType, + const char *container, const char *value) { char line[TRACE_LINE_SIZE]; - __pajeSetState (line, TRACE_LINE_SIZE, pajePushStateId, time, entityType, container, value); + __pajeSetState(line, TRACE_LINE_SIZE, pajeSetStateId, time, entityType, + container, value); fprintf(tracing_file, "%s\n", line); } -void pajePushStateWithHost (double time, const char *entityType, const char *container, const char *value, const char *host) +void pajePushState(double time, const char *entityType, + const char *container, const char *value) { char line[TRACE_LINE_SIZE]; - __pajeSetState (line, TRACE_LINE_SIZE, pajePushStateWithHostId, time, entityType, container, value); - fprintf(tracing_file, "%s %s\n", line, host); + __pajeSetState(line, TRACE_LINE_SIZE, pajePushStateId, time, entityType, + container, value); + fprintf(tracing_file, "%s\n", line); } -void pajePushStateWithPowerUsed (double time, const char *entityType, const char *container, const char *value, double powerUsed) +void pajePopState(double time, const char *entityType, + const char *container) { - char line[TRACE_LINE_SIZE]; - __pajeSetState (line, TRACE_LINE_SIZE, pajePushStateWithPowerUsedId, time, entityType, container, value); - fprintf(tracing_file, "%s %f\n", line, powerUsed); + fprintf(tracing_file, "%d %lf %s %s\n", pajePopStateId, time, entityType, + container); } -void pajePushStateWithBandwidthUsed (double time, const char *entityType, const char *container, const char *value, double bwUsed) +void pajeStartLink(double time, const char *entityType, + const char *container, const char *value, + const char *sourceContainer, const char *key) { char line[TRACE_LINE_SIZE]; - __pajeSetState (line, TRACE_LINE_SIZE, pajePushStateWithBandwidthUsedId, time, entityType, container, value); - fprintf(tracing_file, "%s %f\n", line, bwUsed); -} - -void pajePopState (double time, const char *entityType, const char *container) -{ - fprintf(tracing_file, "%d %.15lf %s %s\n", pajePopStateId, time, entityType, container); + __pajeStartLink(line, TRACE_LINE_SIZE, pajeStartLinkId, time, entityType, + container, value, sourceContainer, key); + fprintf(tracing_file, "%s\n", line); } -void pajeStartLink (double time, const char *entityType, const char *container, const char *value, - const char *sourceContainer, const char *key) +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, pajeStartLinkId, time, entityType, container, value, sourceContainer, key); - fprintf (tracing_file, "%s\n", line); + __pajeStartLink(line, TRACE_LINE_SIZE, pajeStartLinkWithVolumeId, time, + entityType, container, value, sourceContainer, key); + fprintf(tracing_file, "%s %f\n", line, volume); } -void pajeStartLinkWithBandwidthLatency (double time, const char *entityType, const char *container, const char *value, - const char *sourceContainer, const char *key, double bw, double lat) +void pajeEndLink(double time, const char *entityType, + const char *container, const char *value, + const char *destContainer, const char *key) { - char line[TRACE_LINE_SIZE]; - __pajeStartLink (line, TRACE_LINE_SIZE, pajeStartLinkWithBandwidthLatencyId, time, entityType, container, value, sourceContainer, key); - fprintf (tracing_file, "%s %f %f\n", line, bw, lat); + fprintf(tracing_file, "%d %lf %s %s %s %s %s\n", pajeEndLinkId, time, + entityType, container, value, destContainer, key); } -void pajeStartLinkWithVolume (double time, const char *entityType, const char *container, const char *value, - const char *sourceContainer, const char *key, double volume) +void pajeDefineVariableType(const char *alias, const char *containerType, + const char *name) { - 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); + fprintf(tracing_file, "%d %s %s %s\n", pajeDefineVariableTypeId, alias, + containerType, name); } -void pajeEndLink (double time, const char *entityType, const char *container, const char *value, - const char *destContainer, const char *key) +void pajeDefineVariableTypeWithColor(const char *alias, const char *containerType, + const char *name, const char *color) { - fprintf(tracing_file, "%d %.15lf %s %s %s %s %s\n", pajeEndLinkId, time, entityType, container, value, destContainer, key); + fprintf(tracing_file, "%d %s %s %s \"%s\"\n", pajeDefineVariableTypeWithColorId, alias, + containerType, name, color); } -void pajeDefineVariableType(const char *alias, const char *containerType, const char *name) { - fprintf(tracing_file, "%d %s %s %s\n", pajeDefineVariableTypeId, alias, containerType, name); -} - - -void pajeSetVariable (double time, const char *entityType, const char *container, const char *value) +void pajeSetVariable(double time, const char *entityType, + const char *container, const char *value) { char line[TRACE_LINE_SIZE]; - __pajeSetVariable (line, TRACE_LINE_SIZE, pajeSetVariableId, time, entityType, container, value); + __pajeSetVariable(line, TRACE_LINE_SIZE, pajeSetVariableId, time, + entityType, container, value); fprintf(tracing_file, "%s\n", line); } -void pajeAddVariable (double time, const char *entityType, const char *container, const char *value) +void pajeAddVariable(double time, const char *entityType, + const char *container, const char *value) { char line[TRACE_LINE_SIZE]; - __pajeSetVariable (line, TRACE_LINE_SIZE, pajeAddVariableId, time, entityType, container, value); + __pajeSetVariable(line, TRACE_LINE_SIZE, pajeAddVariableId, time, + entityType, container, value); fprintf(tracing_file, "%s\n", line); } -void pajeSubVariable (double time, const char *entityType, const char *container, const char *value) +void pajeSubVariable(double time, const char *entityType, + const char *container, const char *value) { char line[TRACE_LINE_SIZE]; - __pajeSetVariable (line, TRACE_LINE_SIZE, pajeSubVariableId, time, entityType, container, value); + __pajeSetVariable(line, TRACE_LINE_SIZE, pajeSubVariableId, time, + entityType, container, value); fprintf(tracing_file, "%s\n", line); } -void pajeNewEvent (double time, const char *entityType, const char *container, const char *value) +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); + fprintf(tracing_file, "%d %lf %s %s %s\n", pajeNewEventId, time, + entityType, container, value); } #endif