analysisData= (AnalysisDataCHull*) syncState->analysisData;
- if (syncState->graphs)
+ if (syncState->graphs && analysisData->graphsData->hullPoints != NULL)
{
writeGraphFiles(syncState);
closeGraphFiles(syncState);
/*
- * Print statistics related to matching and downstream modules. Must be
- * called after finalizeMatching.
+ * Print statistics related to matching. Must be called after
+ * finalizeMatching.
*
* Args:
* syncState container for synchronization data.
matchingData->stats->totComplete * syncState->traceNb) /
matchingData->stats->totIncomplete);
}
-
- if (syncState->analysisModule->printAnalysisStats != NULL)
- {
- syncState->analysisModule->printAnalysisStats(syncState);
- }
}
static void printMatchingStatsTCP(SyncState* const syncState);
static void writeMatchingGraphsPlotsTCP(FILE* stream, SyncState* const
syncState, const unsigned int i, const unsigned int j);
-static void writeMatchingGraphsOptionsTCP(FILE* stream, SyncState* const
- syncState, const unsigned int i, const unsigned int j);
// Functions specific to this module
static void registerMatchingTCP() __attribute__((constructor (101)));
.finalizeMatching= &finalizeMatchingTCP,
.printMatchingStats= &printMatchingStatsTCP,
.writeMatchingGraphsPlots= &writeMatchingGraphsPlotsTCP,
- .writeMatchingGraphsOptions= &writeMatchingGraphsOptionsTCP,
+ .writeMatchingGraphsOptions= NULL,
};
/*
- * Print statistics related to matching and downstream modules. Must be
- * called after finalizeMatching.
+ * Print statistics related to matching. Must be called after
+ * finalizeMatching.
*
* Args:
* syncState container for synchronization data.
printf("\ttotal synchronization exchanges: %u\n",
matchingData->stats->totExchangeSync);
}
-
- if (syncState->analysisModule->printAnalysisStats != NULL)
- {
- syncState->analysisModule->printAnalysisStats(syncState);
- }
}
/*
- * Write the matching-specific graph lines in the gnuplot script. Call the
- * downstream module's graph function.
+ * Write the matching-specific graph lines in the gnuplot script.
*
* Args:
* stream: stream where to write the data
"\t\"matching_tcp-%2$03d_to_%1$03d.data\" "
"title \"Received messages\" with points linetype 4 "
"linecolor rgb \"#6699cc\" pointtype 11 pointsize 2, \\\n", i, j);
-
- if (syncState->analysisModule->writeAnalysisGraphsPlots != NULL)
- {
- syncState->analysisModule->writeAnalysisGraphsPlots(stream, syncState,
- i, j);
- }
-}
-
-
-/*
- * Write the matching-specific options in the gnuplot script (none). Call the
- * downstream module's options function.
- *
- * Args:
- * stream: stream where to write the data
- * syncState: container for synchronization data
- * i: first trace number
- * j: second trace number, garanteed to be larger than i
- */
-static void writeMatchingGraphsOptionsTCP(FILE* stream, SyncState* const
- syncState, const unsigned int i, const unsigned int j)
-{
- if (syncState->analysisModule->writeAnalysisGraphsOptions != NULL)
- {
- syncState->analysisModule->writeAnalysisGraphsOptions(stream,
- syncState, i, j);
- }
}
static void finalizeProcessingLTTVStandard(SyncState* const syncState);
static void printProcessingStatsLTTVStandard(SyncState* const syncState);
-static void writeProcessingGraphsPlotsLTTVStandard(FILE* stream, SyncState*
- const syncState, const unsigned int i, const unsigned int j);
static void writeProcessingGraphsOptionsLTTVStandard(FILE* stream, SyncState*
const syncState, const unsigned int i, const unsigned int j);
.destroyProcessing= &destroyProcessingLTTVStandard,
.finalizeProcessing= &finalizeProcessingLTTVStandard,
.printProcessingStats= &printProcessingStatsLTTVStandard,
- .writeProcessingGraphsPlots= &writeProcessingGraphsPlotsLTTVStandard,
+ .writeProcessingGraphsPlots= NULL,
.writeProcessingGraphsOptions= &writeProcessingGraphsOptionsLTTVStandard,
};
/*
- * Print statistics related to processing and downstream modules. Must be
- * called after finalizeProcessing.
+ * Print statistics related to processing Must be called after
+ * finalizeProcessing.
*
* Args:
* syncState container for synchronization data.
*/
static void printProcessingStatsLTTVStandard(SyncState* const syncState)
{
- unsigned int i;
ProcessingDataLTTVStandard* processingData;
if (!syncState->stats)
printf("\tsent packets that are TCP: %d\n",
processingData->stats->totOutE);
}
-
- if (syncState->matchingModule->printMatchingStats != NULL)
- {
- syncState->matchingModule->printMatchingStats(syncState);
- }
-
- printf("Resulting synchronization factors:\n");
- for (i= 0; i < syncState->traceNb; i++)
- {
- LttTrace* t;
-
- t= processingData->traceSetContext->traces[i]->t;
-
- printf("\ttrace %u drift= %g offset= %g (%f) start time= %ld.%09ld\n",
- i, t->drift, t->offset, (double) tsc_to_uint64(t->freq_scale,
- t->start_freq, t->offset) / NANOSECONDS_PER_SECOND,
- t->start_time_from_tsc.tv_sec, t->start_time_from_tsc.tv_nsec);
- }
}
/*
- * Write the processing-specific graph lines in the gnuplot script (none at
- * the moment). Call the downstream module's graph function.
- *
- * Args:
- * stream: stream where to write the data
- * syncState: container for synchronization data
- * i: first trace number
- * j: second trace number, garanteed to be larger than i
- */
-static void writeProcessingGraphsPlotsLTTVStandard(FILE* stream, SyncState*
- const syncState, const unsigned int i, const unsigned int j)
-{
- if (syncState->matchingModule->writeMatchingGraphsPlots != NULL)
- {
- syncState->matchingModule->writeMatchingGraphsPlots(stream, syncState,
- i, j);
- }
-}
-
-
-/*
- * Write the processing-specific options in the gnuplot script. Call the
- * downstream module's options function.
+ * Write the processing-specific options in the gnuplot script.
*
* Args:
* stream: stream where to write the data
traceJ= processingData->traceSetContext->traces[j]->t;
fprintf(stream,
+ "set key inside right bottom\n"
+ "set xlabel \"Clock %1$u\"\n"
+ "set xtics nomirror\n"
+ "set ylabel \"Clock %3$u\"\n"
+ "set ytics nomirror\n"
"set x2label \"Clock %1$d (s)\"\n"
"set x2range [GPVAL_X_MIN / %2$.1f : GPVAL_X_MAX / %2$.1f]\n"
"set x2tics\n"
"set y2range [GPVAL_Y_MIN / %4$.1f : GPVAL_Y_MAX / %4$.1f]\n"
"set y2tics\n", i, (double) traceI->start_freq / traceI->freq_scale,
j, (double) traceJ->start_freq / traceJ->freq_scale);
-
- if (syncState->matchingModule->writeMatchingGraphsOptions != NULL)
- {
- syncState->matchingModule->writeMatchingGraphsOptions(stream,
- syncState, i, j);
- }
}
struct rusage startUsage, endUsage;
GList* result;
FILE* graphsStream;
+ unsigned int i, j;
int retval;
if (!optionSync.present)
// Write graphs file
if (graphsStream != NULL)
{
- unsigned int i, j;
-
fprintf(graphsStream,
"#!/usr/bin/gnuplot\n\n"
"set terminal postscript eps color size 8in,6in\n");
{
for (j= i + 1; j < syncState->traceNb; j++)
{
- long pos;
+ long pos1, pos2, trunc;
fprintf(graphsStream,
"\nset output \"%03d-%03d.eps\"\n"
"plot \\\n", i, j);
- syncState->processingModule->writeProcessingGraphsPlots(graphsStream,
- syncState, i, j);
+ if (syncState->processingModule->writeProcessingGraphsPlots)
+ {
+ syncState->processingModule->writeProcessingGraphsPlots(graphsStream,
+ syncState, i, j);
+ }
+ if (syncState->matchingModule->writeMatchingGraphsPlots)
+ {
+ syncState->matchingModule->writeMatchingGraphsPlots(graphsStream,
+ syncState, i, j);
+ }
+ if (syncState->analysisModule->writeAnalysisGraphsPlots)
+ {
+ syncState->analysisModule->writeAnalysisGraphsPlots(graphsStream,
+ syncState, i, j);
+ }
- // Remove the ", \\\n" from the last graph plot line
fflush(graphsStream);
- pos= ftell(graphsStream);
- if (ftruncate(fileno(graphsStream), pos - 4) == -1)
+ pos2= ftell(graphsStream);
+ if (pos1 != pos2)
+ {
+ // Remove the ", \\\n" from the last graph plot line
+ trunc= pos2 - 4;
+ }
+ else
+ {
+ // Remove the "plot \\\n" line to avoid creating an invalid
+ // gnuplot script
+ trunc= pos2 - 7;
+ }
+
+ if (ftruncate(fileno(graphsStream), trunc) == -1)
{
g_error(strerror(errno));
}
}
fprintf(graphsStream,
- "\nset output \"%1$03d-%2$03d.eps\"\n"
- "set key inside right bottom\n"
- "set title \"\"\n"
- "set xlabel \"Clock %1$u\"\n"
- "set xtics nomirror\n"
- "set ylabel \"Clock %2$u\"\n"
- "set ytics nomirror\n", i, j);
+ "\nset output \"%03d-%03d.eps\"\n"
+ "set title \"\"\n", i, j);
- syncState->processingModule->writeProcessingGraphsOptions(graphsStream,
- syncState, i, j);
+ if (syncState->processingModule->writeProcessingGraphsOptions)
+ {
+ syncState->processingModule->writeProcessingGraphsOptions(graphsStream,
+ syncState, i, j);
+ }
+ if (syncState->matchingModule->writeMatchingGraphsOptions)
+ {
+ syncState->matchingModule->writeMatchingGraphsOptions(graphsStream,
+ syncState, i, j);
+ }
+ if (syncState->analysisModule->writeAnalysisGraphsOptions)
+ {
+ syncState->analysisModule->writeAnalysisGraphsOptions(graphsStream,
+ syncState, i, j);
+ }
- fprintf(graphsStream,
- "replot\n");
+ if (pos1 != pos2)
+ {
+ fprintf(graphsStream, "replot\n");
+ }
}
}
{
syncState->processingModule->printProcessingStats(syncState);
}
+ if (syncState->matchingModule->printMatchingStats != NULL)
+ {
+ syncState->matchingModule->printMatchingStats(syncState);
+ }
+ if (syncState->analysisModule->printAnalysisStats != NULL)
+ {
+ syncState->analysisModule->printAnalysisStats(syncState);
+ }
+
+ if (optionSyncStats.present)
+ {
+ printf("Resulting synchronization factors:\n");
+ for (i= 0; i < syncState->traceNb; i++)
+ {
+ LttTrace* t;
+
+ t= traceSetContext->traces[i]->t;
+
+ printf("\ttrace %u drift= %g offset= %g (%f) start time= %ld.%09ld\n",
+ i, t->drift, t->offset, (double) tsc_to_uint64(t->freq_scale,
+ t->start_freq, t->offset) / NANOSECONDS_PER_SECOND,
+ t->start_time_from_tsc.tv_sec,
+ t->start_time_from_tsc.tv_nsec);
+ }
+ }
syncState->processingModule->destroyProcessing(syncState);
if (syncState->matchingModule != NULL)
"synchronization points", "none", LTTV_OPT_NONE, &optionEvalGraphs,
NULL, NULL);
- retval= snprintf(graphsDir, sizeof(graphsDir), "graphs-%d", getpid());
+ retval= snprintf(graphsDir, sizeof(graphsDir), "eval-graphs-%d", getpid());
if (retval > sizeof(graphsDir) - 1)
{
graphsDir[sizeof(graphsDir) - 1]= '\0';
syncState->analysisModule->initAnalysis(syncState);
syncState->matchingData= NULL;
- result= g_queue_find_custom(&matchingModules, "broadcast", &gcfCompareMatching);
+ result= g_queue_find_custom(&matchingModules, "distributor",
+ &gcfCompareMatching);
syncState->matchingModule= (MatchingModule*) result->data;
syncState->matchingModule->initMatching(syncState);
SyncState* syncState;
struct timeval endTime;
struct rusage endUsage;
+ unsigned int i, j;
int retval;
tracesetChainState= g_hash_table_lookup(tracesetChainStates, traceSetContext);
// Write graphs file
if (tracesetChainState->graphsStream != NULL)
{
- unsigned int i, j;
-
fprintf(tracesetChainState->graphsStream,
"#!/usr/bin/gnuplot\n\n"
"set terminal postscript eps color size 8in,6in\n");
{
for (j= i + 1; j < syncState->traceNb; j++)
{
- long pos;
+ long pos1, pos2, trunc;
fprintf(tracesetChainState->graphsStream,
"\nset output \"%03d-%03d.eps\"\n"
"plot \\\n", i, j);
+ pos1= ftell(tracesetChainState->graphsStream);
- syncState->processingModule->writeProcessingGraphsPlots(tracesetChainState->graphsStream,
- syncState, i, j);
+ if (syncState->analysisModule->writeAnalysisGraphsPlots)
+ {
+ syncState->analysisModule->writeAnalysisGraphsPlots(tracesetChainState->graphsStream,
+ syncState, i, j);
+ }
- // Remove the ", \\\n" from the last graph plot line
fflush(tracesetChainState->graphsStream);
- pos= ftell(tracesetChainState->graphsStream);
- if (ftruncate(fileno(tracesetChainState->graphsStream), pos - 4) == -1)
+ pos2= ftell(tracesetChainState->graphsStream);
+ if (pos1 != pos2)
+ {
+ // Remove the ", \\\n" from the last graph plot line
+ trunc= pos2 - 4;
+ }
+ else
+ {
+ // Remove the "plot \\\n" line to avoid creating an invalid
+ // gnuplot script
+ trunc= pos2 - 7;
+ }
+
+ if (ftruncate(fileno(tracesetChainState->graphsStream), trunc) == -1)
{
g_error(strerror(errno));
}
fprintf(tracesetChainState->graphsStream,
"\nset output \"%1$03d-%2$03d.eps\"\n"
- "set key inside right bottom\n"
- "set title \"\"\n"
- "set xlabel \"Clock %1$u\"\n"
- "set xtics nomirror\n"
- "set ylabel \"Clock %2$u\"\n"
- "set ytics nomirror\n", i, j);
+ "set title \"\"\n", i, j);
- syncState->processingModule->writeProcessingGraphsOptions(tracesetChainState->graphsStream,
- syncState, i, j);
+ if (syncState->analysisModule->writeAnalysisGraphsOptions)
+ {
+ syncState->analysisModule->writeAnalysisGraphsOptions(tracesetChainState->graphsStream,
+ syncState, i, j);
+ }
- fprintf(tracesetChainState->graphsStream,
- "replot\n");
+ if (pos1 != pos2)
+ {
+ fprintf(tracesetChainState->graphsStream, "replot\n");
+ }
}
}
{
syncState->processingModule->printProcessingStats(syncState);
}
+ if (syncState->matchingModule->printMatchingStats != NULL)
+ {
+ syncState->matchingModule->printMatchingStats(syncState);
+ }
+ if (syncState->analysisModule->printAnalysisStats != NULL)
+ {
+ syncState->analysisModule->printAnalysisStats(syncState);
+ }
+
+ printf("Resulting synchronization factors:\n");
+ for (i= 0; i < syncState->traceNb; i++)
+ {
+ LttTrace* t;
+
+ t= traceSetContext->traces[i]->t;
+
+ printf("\ttrace %u drift= %g offset= %g (%f) start time= %ld.%09ld\n",
+ i, t->drift, t->offset, (double) tsc_to_uint64(t->freq_scale,
+ t->start_freq, t->offset) / NANOSECONDS_PER_SECOND,
+ t->start_time_from_tsc.tv_sec, t->start_time_from_tsc.tv_nsec);
+ }
syncState->processingModule->destroyProcessing(syncState);
if (syncState->matchingModule != NULL)