unsigned int i, const unsigned int j);
// Functions specific to this module
-static void registerAnalysisCHull() __attribute__((constructor (101)));
-
static void openGraphFiles(SyncState* const syncState);
static void closeGraphFiles(SyncState* const syncState);
static void writeGraphFiles(SyncState* const syncState);
/*
* Analysis module registering function
*/
-static void registerAnalysisCHull()
+void registerAnalysisCHull()
{
g_queue_push_tail(&analysisModules, &analysisModuleCHull);
}
AnalysisGraphsDataCHull* graphsData;
} AnalysisDataCHull;
+void registerAnalysisCHull();
FactorsCHull** calculateAllFactors(struct _SyncState* const syncState);
void freeAllFactors(const unsigned int traceNb, FactorsCHull** const
const unsigned int i, const unsigned int j);
// Functions specific to this module
-static void registerAnalysisEval() __attribute__((constructor (102)));
static guint ghfRttKeyHash(gconstpointer key);
static gboolean gefRttKeyEqual(gconstpointer a, gconstpointer b);
static void gdnDestroyRttKey(gpointer data);
/*
* Analysis module registering function
*/
-static void registerAnalysisEval()
+void registerAnalysisEval()
{
binBase= exp10(6. / (BIN_NB - 3));
AnalysisGraphsEval* graphs;
} AnalysisDataEval;
+void registerAnalysisEval();
+
#endif
unsigned int i, const unsigned int j);
// Functions specific to this module
-static void registerAnalysisLinReg() __attribute__((constructor (102)));
-
static void finalizeLSA(SyncState* const syncState);
static void doGraphProcessing(SyncState* const syncState);
static GArray* calculateFactors(SyncState* const syncState);
/*
* Analysis module registering function
*/
-static void registerAnalysisLinReg()
+void registerAnalysisLinReg()
{
g_queue_push_tail(&analysisModules, &analysisModuleLinReg);
}
double* stDev;
} AnalysisDataLinReg;
+void registerAnalysisLinReg();
+
#endif
unsigned int i, const unsigned int j);
// Functions specific to this module
-static void registerMatchingBroadcast() __attribute__((constructor (101)));
-
static void partialDestroyMatchingBroadcast(SyncState* const syncState);
static void openGraphDataFiles(SyncState* const syncState);
/*
* Matching module registering function
*/
-static void registerMatchingBroadcast()
+void registerMatchingBroadcast()
{
g_queue_push_tail(&matchingModules, &matchingModuleBroadcast);
}
MatchingGraphsBroadcast* graphs;
} MatchingDataBroadcast;
+void registerMatchingBroadcast();
+
#endif
syncState, const unsigned int i, const unsigned int j);
// Functions specific to this module
-static void registerMatchingDistributor() __attribute__((constructor (101)));
-
void gfInitModule(gpointer data, gpointer user_data);
void gfDestroyModule(gpointer data, gpointer user_data);
void gfMatchEvent(gpointer data, gpointer user_data);
/*
* Matching module registering function
*/
-static void registerMatchingDistributor()
+void registerMatchingDistributor()
{
g_queue_push_tail(&matchingModules, &matchingModuleDistributor);
}
GQueue* distributedModules;
} MatchingDataDistributor;
+void registerMatchingDistributor();
+
#endif
const unsigned int i, const unsigned int j);
// Functions specific to this module
-static void registerMatchingTCP() __attribute__((constructor (101)));
-
static void matchEvents(SyncState* const syncState, Event* const event,
GHashTable* const unMatchedList, GHashTable* const
unMatchedOppositeList, const size_t fieldOffset, const size_t
/*
* Matching module registering function
*/
-static void registerMatchingTCP()
+void registerMatchingTCP()
{
g_queue_push_tail(&matchingModules, &matchingModuleTCP);
}
FILE*** messagePoints;
} MatchingDataTCP;
+void registerMatchingTCP();
+
#endif
static void finalizeProcessingLTTVNull(SyncState* const syncState);
// Functions specific to this module
-static void registerProcessingLTTVNull() __attribute__((constructor (102)));
static gboolean processEventLTTVNull(void* hookData, void* callData);
/*
* Processing Module registering function
*/
-static void registerProcessingLTTVNull()
+void registerProcessingLTTVNull()
{
g_queue_push_tail(&processingModules, &processingModuleLTTVNull);
GArray* hookListList;
} ProcessingDataLTTVNull;
+void registerProcessingLTTVNull();
+
#endif
syncState, const unsigned int i, const unsigned int j);
// Functions specific to this module
-static void registerProcessingLTTVStandard() __attribute__((constructor (102)));
static gboolean processEventLTTVStandard(void* hookData, void* callData);
static void partialDestroyProcessingLTTVStandard(SyncState* const syncState);
/*
* Processing Module registering function
*/
-static void registerProcessingLTTVStandard()
+void registerProcessingLTTVStandard()
{
g_queue_push_tail(&processingModules, &processingModuleLTTVStandard);
ProcessingGraphsLTTVStandard* graphs;
} ProcessingDataLTTVStandard;
+void registerProcessingLTTVStandard();
+
#endif
const unsigned int i);
// Functions specific to this module
-static void registerProcessingText() __attribute__((constructor (102)));
-
static unsigned int readTraceNb(FILE* testCase);
static void skipCommentLines(FILE* testCase);
/*
* Processing Module registering function
*/
-static void registerProcessingText()
+void registerProcessingText()
{
g_queue_push_tail(&processingModules, &processingModuleText);
}
FILE* testCase;
} ProcessingDataText;
+void registerProcessingText();
+
#endif
#include <lttv/module.h>
#include <lttv/option.h>
+
+#include "event_processing_lttng_standard.h"
+#include "event_processing_lttng_null.h"
+#include "event_matching_tcp.h"
+#include "event_matching_broadcast.h"
+#include "event_matching_distributor.h"
+#include "event_analysis_chull.h"
+#include "event_analysis_linreg.h"
+#include "event_analysis_eval.h"
#include "sync_chain.h"
#include "sync_chain_lttv.h"
/*
* Module init function
*
- * This function is declared to be the module initialization function. Event
- * modules are registered with a "constructor (102)" attribute except one in
- * each class (processing, matching, analysis) which is chosen to be the
- * default and which is registered with a "constructor (101)" attribute.
- * Constructors with no priority are called after constructors with
- * priorities. The result is that the list of event modules is known when this
- * function is executed.
+ * This function is declared to be the module initialization function.
*/
static void init()
{
g_debug("Sync init");
+ /*
+ * Initialize event modules
+ * Call the "constructor" or initialization function of each event module
+ * so it can register itself. This must be done before elements in
+ * processingModules, matchingModules, analysisModules or moduleOptions
+ * are accessed.
+ */
+ registerProcessingLTTVStandard();
+ registerProcessingLTTVNull();
+
+ registerMatchingTCP();
+ registerMatchingBroadcast();
+ registerMatchingDistributor();
+
+ registerAnalysisCHull();
+ registerAnalysisLinReg();
+ registerAnalysisEval();
+
g_assert(g_queue_get_length(&analysisModules) > 0);
optionSyncAnalysis.arg= ((AnalysisModule*)
g_queue_peek_head(&analysisModules))->name;
#include <sys/stat.h>
#include <unistd.h>
+#include "event_processing_text.h"
+#include "event_matching_tcp.h"
+#include "event_matching_broadcast.h"
+#include "event_matching_distributor.h"
+#include "event_analysis_chull.h"
+#include "event_analysis_linreg.h"
+#include "event_analysis_eval.h"
#include "sync_chain.h"
GString* analysisModulesNames;
unsigned int id;
+ /*
+ * Initialize event modules
+ * Call the "constructor" or initialization function of each event module
+ * so it can register itself. This must be done before elements in
+ * processingModules, matchingModules, analysisModules or moduleOptions
+ * are accessed.
+ */
+ registerProcessingText();
+
+ registerMatchingTCP();
+ registerMatchingBroadcast();
+ registerMatchingDistributor();
+
+ registerAnalysisCHull();
+ registerAnalysisLinReg();
+ registerAnalysisEval();
+
// Initialize data structures
syncState= malloc(sizeof(SyncState));