Document the functions that each module may provide in each module's
respective header file.
Signed-off-by: Benjamin Poirier <benjamin.poirier@polymtl.ca>
to deduce synchronization factors.
eg. convex hull, linear regression, broadcast Maximum Likelihood Estimator
to deduce synchronization factors.
eg. convex hull, linear regression, broadcast Maximum Likelihood Estimator
+This module should return a set of synchronization factors for each trace
+pair. Some trace pairs may have no factors, their approxType should be set to
+ABSENT.
+
Instead of having one analyzeEvents() function that can receive any sort of
grouping of events, there are three prototypes: analyzeMessage(),
analyzeExchange() and analyzeBroadcast(). A module implements only the
Instead of having one analyzeEvents() function that can receive any sort of
grouping of events, there are three prototypes: analyzeMessage(),
analyzeExchange() and analyzeBroadcast(). A module implements only the
3) we'll see which one of the two approaches works best and we can adapt
later.
3) we'll see which one of the two approaches works best and we can adapt
later.
-++ Data flow
-Data from traces flows "down" from processing to matching to analysis. Factors
-come back up.
-
++ Stage 4: Factor reduction
++ Stage 4: Factor reduction
-This stage reduces the pair-wise synchronization factors to time correction
-factors for each trace. It is most useful when synchronizing more than two
-traces.
+This stage reduces the pair-wise synchronization factors obtained in step 3 to
+time correction factors for each trace. It is most useful when synchronizing
+more than two traces.
++ Evolution and adaptation
It is possible to change/add another sync chain and to add other modules. It
++ Evolution and adaptation
It is possible to change/add another sync chain and to add other modules. It
+ /*
+ * This function is called at the beginning of a synchronization run for a set
+ * of traces. Allocate analysis specific data structures.
+ */
void (*initAnalysis)(struct _SyncState* const syncState);
void (*initAnalysis)(struct _SyncState* const syncState);
+
+ /*
+ * Free the analysis specific data structures.
+ */
void (*destroyAnalysis)(struct _SyncState* const syncState);
void (*destroyAnalysis)(struct _SyncState* const syncState);
+ /*
+ * Perform analysis on an event pair.
+ */
void (*analyzeMessage)(struct _SyncState* const syncState, Message* const
message);
void (*analyzeMessage)(struct _SyncState* const syncState, Message* const
message);
+
+ /*
+ * Perform analysis on multiple messages.
+ */
void (*analyzeExchange)(struct _SyncState* const syncState, Exchange* const
exchange);
void (*analyzeExchange)(struct _SyncState* const syncState, Exchange* const
exchange);
+
+ /*
+ * Perform analysis on muliple events.
+ */
void (*analyzeBroadcast)(struct _SyncState* const syncState, Broadcast* const
broadcast);
void (*analyzeBroadcast)(struct _SyncState* const syncState, Broadcast* const
broadcast);
+
+ /*
+ * Finalize the factor calculations. Return synchronization factors
+ * between trace pairs.
+ */
AllFactors* (*finalizeAnalysis)(struct _SyncState* const syncState);
AllFactors* (*finalizeAnalysis)(struct _SyncState* const syncState);
+ /*
+ * Print statistics related to analysis. Is always called after
+ * finalizeAnalysis.
+ */
void (*printAnalysisStats)(struct _SyncState* const syncState);
void (*printAnalysisStats)(struct _SyncState* const syncState);
+
+ /*
+ * Write the analysis-specific options and graph commands in the gnuplot
+ * script. Is always called after finalizeAnalysis.
+ */
GraphFunctions graphFunctions;
} AnalysisModule;
GraphFunctions graphFunctions;
} AnalysisModule;
char* name;
bool canMatch[TYPE_COUNT];
char* name;
bool canMatch[TYPE_COUNT];
+ /*
+ * This function is called at the beginning of a synchronization run for a set
+ * of traces. Allocate the matching specific data structures.
+ */
void (*initMatching)(struct _SyncState* const syncState);
void (*initMatching)(struct _SyncState* const syncState);
+
+ /*
+ * Free the matching specific data structures.
+ */
void (*destroyMatching)(struct _SyncState* const syncState);
void (*destroyMatching)(struct _SyncState* const syncState);
+ /*
+ * Try to match one event from a trace with the corresponding event from
+ * another trace. If it is possible, create a new structure and call the
+ * analyse{message,exchange,broadcast} function of the analysis module.
+ */
void (*matchEvent)(struct _SyncState* const syncState, Event* const
event);
void (*matchEvent)(struct _SyncState* const syncState, Event* const
event);
+
+ /*
+ * Obtain the factors from downstream.
+ */
AllFactors* (*finalizeMatching)(struct _SyncState* const syncState);
AllFactors* (*finalizeMatching)(struct _SyncState* const syncState);
+ /*
+ * Print statistics related to matching. Is always called after
+ * finalizeMatching.
+ */
void (*printMatchingStats)(struct _SyncState* const syncState);
void (*printMatchingStats)(struct _SyncState* const syncState);
+
+ /*
+ * Write the matching-specific options and graph commands in the gnuplot
+ * script. Is always called after finalizeMatching.
+ */
GraphFunctions graphFunctions;
} MatchingModule;
GraphFunctions graphFunctions;
} MatchingModule;
- * Call the partial matching destroyer and Obtain the factors from downstream
+ * Call the partial matching destroyer and obtain the factors from downstream
*
* Args:
* syncState container for synchronization data.
*
* Args:
* syncState container for synchronization data.
+ /*
+ * This function is called at the beginning of a synchronization run for a
+ * set of traces. Allocate and initialize data structures for
+ * synchronizing a traceset.
+ */
void (*initProcessing)(struct _SyncState* const syncStateLttv, ...);
void (*initProcessing)(struct _SyncState* const syncStateLttv, ...);
+
+ /*
+ * Obtain the factors from downstream.
+ */
AllFactors* (*finalizeProcessing)(struct _SyncState* const syncState);
AllFactors* (*finalizeProcessing)(struct _SyncState* const syncState);
+
+ /*
+ * Print statistics related to processing. Is always called after
+ * finalizeProcessing.
+ */
void (*printProcessingStats)(struct _SyncState* const syncState);
void (*printProcessingStats)(struct _SyncState* const syncState);
+
+ /*
+ * Deallocate processingData. No more functions may be called after this.
+ */
void (*destroyProcessing)(struct _SyncState* const syncState);
void (*destroyProcessing)(struct _SyncState* const syncState);
+
+ /*
+ * Write the processing-specific options and graph commands in the gnuplot
+ * script. Is always called after finalizeProcessing.
+ */
GraphFunctions graphFunctions;
} ProcessingModule;
GraphFunctions graphFunctions;
} ProcessingModule;
- * Call the partial processing destroyer, obtain and adjust the factors from
+ * Call the partial processing destroyer, obtain and the factors from
- * Print statistics related to processing Must be called after
+ * Print statistics related to processing. Must be called after
* finalizeProcessing.
*
* Args:
* finalizeProcessing.
*
* Args:
+ /*
+ * This function is called at the beginning of a synchronization run for a
+ * set of traces. Allocate some reduction specific data structures.
+ */
void (*initReduction)(struct _SyncState* const syncState);
void (*initReduction)(struct _SyncState* const syncState);
+
+ /*
+ * Free the reduction specific data structures
+ */
void (*destroyReduction)(struct _SyncState* const syncState);
void (*destroyReduction)(struct _SyncState* const syncState);
+ /*
+ * Convert trace pair synchronization factors to a resulting offset and
+ * drift for each trace.
+ */
GArray* (*finalizeReduction)(struct _SyncState* const syncState,
AllFactors* allFactors);
GArray* (*finalizeReduction)(struct _SyncState* const syncState,
AllFactors* allFactors);
+ /*
+ * Print statistics related to reduction. Is always called after
+ * finalizeReduction.
+ */
void (*printReductionStats)(struct _SyncState* const syncState);
void (*printReductionStats)(struct _SyncState* const syncState);
+
+ /*
+ * Write the reduction-specific options and graph commands in the gnuplot
+ * script. Is always called after finalizeReduction.
+ */
GraphFunctions graphFunctions;
} ReductionModule;
GraphFunctions graphFunctions;
} ReductionModule;
/*
* Reduction destroy function
*
/*
* Reduction destroy function
*
- * Free the analysis specific data structures
+ * Free the reduction specific data structures
*
* Args:
* syncState container for synchronization data.
*
* Args:
* syncState container for synchronization data.
+ /*
+ * These functions are called at the beginning of the gnuplot script and
+ * may writes variables that can be reused in the plot or options lines
+ */
GraphVariableFunction* writeVariables;
GraphVariableFunction* writeVariables;
- /* This is for graphs where the data on both axis is in the range of
- * timestamps */
+
+ /*
+ * All "Back" functions are called, then all "Fore" functions. They add
+ * graphs to a gnuplot "plot" command. All "Options" functions are called.
+ * They can set options via the gnuplot "set" command. Finaly, a replot is
+ * performed. This is done so that options may be set using dynamic
+ * gnuplot variables like GPVAL_X_MIN
+ */
+ /*
+ * These next three functions ("writeTraceTrace...") are for graphs where
+ * both axes are in the scale of timestamps.
+ */
GraphFunction* writeTraceTraceForePlots;
GraphFunction* writeTraceTraceBackPlots;
GraphFunction* writeTraceTraceOptions;
GraphFunction* writeTraceTraceForePlots;
GraphFunction* writeTraceTraceBackPlots;
GraphFunction* writeTraceTraceOptions;
- /* This is for graphs where the data on the abscissa is in the range of
- * timestamps and the ordinates is in the range of timestamp deltas */
+
+ /*
+ * These next three functions ("writeTraceTime...") are for graphs where
+ * the abscissa are in the scale of timestamps and the ordinate in the
+ * scale of seconds.
+ */
GraphFunction* writeTraceTimeForePlots;
GraphFunction* writeTraceTimeBackPlots;
GraphFunction* writeTraceTimeOptions;
GraphFunction* writeTraceTimeForePlots;
GraphFunction* writeTraceTimeBackPlots;
GraphFunction* writeTraceTimeOptions;