X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttv%2Flttv%2Fsync%2Fevent_matching_distributor.c;h=4bb7e68cd50dd9158dadd414b4c4b0cd642795a6;hb=c6356aa749f534f9bc0aa6315d41bff0e69a6ef9;hp=4523ec530ec5e7b00a46200decfd959194643ba0;hpb=8d7d16dd4f5f6ae09f556a9b0b477baaa93d468c;p=lttv.git diff --git a/lttv/lttv/sync/event_matching_distributor.c b/lttv/lttv/sync/event_matching_distributor.c index 4523ec53..4bb7e68c 100644 --- a/lttv/lttv/sync/event_matching_distributor.c +++ b/lttv/lttv/sync/event_matching_distributor.c @@ -54,10 +54,18 @@ static void matchEventDistributor(SyncState* const syncState, Event* const event); static GArray* finalizeMatchingDistributor(SyncState* const syncState); static void printMatchingStatsDistributor(SyncState* const syncState); -static void writeMatchingGraphsPlotsDistributor(SyncState* const syncState, - const unsigned int i, const unsigned int j); -static void writeMatchingGraphsOptionsDistributor(SyncState* const syncState, - const unsigned int i, const unsigned int j); +static void writeMatchingTraceTraceForePlotsDistributor(SyncState* const + syncState, const unsigned int i, const unsigned int j); +static void writeMatchingTraceTraceBackPlotsDistributor(SyncState* const + syncState, const unsigned int i, const unsigned int j); +static void writeMatchingTraceTraceOptionsDistributor(SyncState* const + syncState, const unsigned int i, const unsigned int j); +static void writeMatchingTraceTimeForePlotsDistributor(SyncState* const + syncState, const unsigned int i, const unsigned int j); +static void writeMatchingTraceTimeBackPlotsDistributor(SyncState* const + syncState, const unsigned int i, const unsigned int j); +static void writeMatchingTraceTimeOptionsDistributor(SyncState* const + syncState, const unsigned int i, const unsigned int j); // Functions specific to this module static void registerMatchingDistributor() __attribute__((constructor (101))); @@ -79,8 +87,16 @@ static MatchingModule matchingModuleDistributor = { .matchEvent= &matchEventDistributor, .finalizeMatching= &finalizeMatchingDistributor, .printMatchingStats= &printMatchingStatsDistributor, - .writeMatchingGraphsPlots= &writeMatchingGraphsPlotsDistributor, - .writeMatchingGraphsOptions= &writeMatchingGraphsOptionsDistributor, + .graphFunctions= { + .writeTraceTraceForePlots= + &writeMatchingTraceTraceForePlotsDistributor, + .writeTraceTraceBackPlots= + &writeMatchingTraceTraceBackPlotsDistributor, + .writeTraceTraceOptions= &writeMatchingTraceTraceOptionsDistributor, + .writeTraceTimeForePlots= &writeMatchingTraceTimeForePlotsDistributor, + .writeTraceTimeBackPlots= &writeMatchingTraceTimeBackPlotsDistributor, + .writeTraceTimeOptions= &writeMatchingTraceTimeOptionsDistributor, + }, }; @@ -210,14 +226,90 @@ static void printMatchingStatsDistributor(SyncState* const syncState) * i: first trace number * j: second trace number, garanteed to be larger than i */ -static void writeMatchingGraphsPlotsDistributor(SyncState* const syncState, +static void writeMatchingTraceTraceForePlotsDistributor(SyncState* const + syncState, const unsigned int i, const unsigned int j) +{ + MatchingDataDistributor* matchingData= syncState->matchingData; + + g_queue_foreach(matchingData->distributedModules, &gfGraphFunctionCall, + &(struct GraphAggregate) {offsetof(MatchingModule, + graphFunctions.writeTraceTraceForePlots), i, j}); +} + + +/* + * Call the distributed graph lines functions (when they exist). + * + * Args: + * syncState: container for synchronization data + * i: first trace number + * j: second trace number, garanteed to be larger than i + */ +static void writeMatchingTraceTraceBackPlotsDistributor(SyncState* const + syncState, const unsigned int i, const unsigned int j) +{ + MatchingDataDistributor* matchingData= syncState->matchingData; + + g_queue_foreach(matchingData->distributedModules, &gfGraphFunctionCall, + &(struct GraphAggregate) {offsetof(MatchingModule, + graphFunctions.writeTraceTraceBackPlots), i, j}); +} + + +/* + * Call the distributed graph lines functions (when they exist). + * + * Args: + * syncState: container for synchronization data + * i: first trace number + * j: second trace number, garanteed to be larger than i + */ +static void writeMatchingTraceTimeForePlotsDistributor(SyncState* const + syncState, const unsigned int i, const unsigned int j) +{ + MatchingDataDistributor* matchingData= syncState->matchingData; + + g_queue_foreach(matchingData->distributedModules, &gfGraphFunctionCall, + &(struct GraphAggregate) {offsetof(MatchingModule, + graphFunctions.writeTraceTimeForePlots), i, j}); +} + + +/* + * Call the distributed graph lines functions (when they exist). + * + * Args: + * syncState: container for synchronization data + * i: first trace number + * j: second trace number, garanteed to be larger than i + */ +static void writeMatchingTraceTimeBackPlotsDistributor(SyncState* const + syncState, const unsigned int i, const unsigned int j) +{ + MatchingDataDistributor* matchingData= syncState->matchingData; + + g_queue_foreach(matchingData->distributedModules, &gfGraphFunctionCall, + &(struct GraphAggregate) {offsetof(MatchingModule, + graphFunctions.writeTraceTimeBackPlots), i, j}); +} + + +/* + * Call the distributed graph options functions (when they exist). + * + * Args: + * syncState: container for synchronization data + * i: first trace number + * j: second trace number, garanteed to be larger than i + */ +static void writeMatchingTraceTraceOptionsDistributor(SyncState* const syncState, const unsigned int i, const unsigned int j) { MatchingDataDistributor* matchingData= syncState->matchingData; g_queue_foreach(matchingData->distributedModules, &gfGraphFunctionCall, &(struct GraphAggregate) {offsetof(MatchingModule, - writeMatchingGraphsPlots), i, j}); + graphFunctions.writeTraceTraceOptions), i, j}); } @@ -229,14 +321,14 @@ static void writeMatchingGraphsPlotsDistributor(SyncState* const syncState, * i: first trace number * j: second trace number, garanteed to be larger than i */ -static void writeMatchingGraphsOptionsDistributor(SyncState* const syncState, +static void writeMatchingTraceTimeOptionsDistributor(SyncState* const syncState, const unsigned int i, const unsigned int j) { MatchingDataDistributor* matchingData= syncState->matchingData; g_queue_foreach(matchingData->distributedModules, &gfGraphFunctionCall, &(struct GraphAggregate) {offsetof(MatchingModule, - writeMatchingGraphsOptions), i, j}); + graphFunctions.writeTraceTimeOptions), i, j}); } @@ -356,8 +448,10 @@ void gfGraphFunctionCall(gpointer data, gpointer user_data) { SyncState* parallelSS= data; struct GraphAggregate* aggregate= user_data; - void (*graphFunction)(struct _SyncState*, const unsigned int, const - unsigned int)= (void*) data + (size_t) aggregate->offset; + typedef void (*GraphFunction)(struct _SyncState*, const unsigned int, + const unsigned int); + GraphFunction graphFunction= *(GraphFunction*)((void*) + parallelSS->matchingModule + (size_t) aggregate->offset); if (graphFunction != NULL) {