X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttv%2Flttv%2Fsync%2Fevent_matching_tcp.c;h=5f3aa934e4c87564945b9d874daf554c9c51522c;hb=2f961b65e3422f23019286e9531b0a40070278ea;hp=0202380ccb6f2dca652c6cbe6702d9cba5bee65a;hpb=d6ee500355b870e83d5cdbc431629999ec97794e;p=lttv.git diff --git a/lttv/lttv/sync/event_matching_tcp.c b/lttv/lttv/sync/event_matching_tcp.c index 0202380c..5f3aa934 100644 --- a/lttv/lttv/sync/event_matching_tcp.c +++ b/lttv/lttv/sync/event_matching_tcp.c @@ -21,6 +21,7 @@ #endif #include +#include #include #include #include @@ -31,11 +32,6 @@ #include "event_matching_tcp.h" -#ifndef g_info -#define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format) -#endif - - // Functions common to all matching modules static void initMatchingTCP(SyncState* const syncState); static void destroyMatchingTCP(SyncState* const syncState); @@ -43,12 +39,10 @@ static void destroyMatchingTCP(SyncState* const syncState); static void matchEventTCP(SyncState* const syncState, Event* const event); static GArray* finalizeMatchingTCP(SyncState* const 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 writeMatchingGraphsPlotsTCPMessages(SyncState* const syncState, + 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 @@ -74,15 +68,16 @@ static MatchingModule matchingModuleTCP = { .matchEvent= &matchEventTCP, .finalizeMatching= &finalizeMatchingTCP, .printMatchingStats= &printMatchingStatsTCP, - .writeMatchingGraphsPlots= &writeMatchingGraphsPlotsTCP, - .writeMatchingGraphsOptions= NULL, + .graphFunctions= { + .writeTraceTraceForePlots= &writeMatchingGraphsPlotsTCPMessages, + } }; /* * Matching module registering function */ -static void registerMatchingTCP() +void registerMatchingTCP() { g_queue_push_tail(&matchingModules, &matchingModuleTCP); } @@ -137,7 +132,7 @@ static void initMatchingTCP(SyncState* const syncState) matchingData->stats= NULL; } - if (syncState->graphs) + if (syncState->graphsStream) { openGraphDataFiles(syncState); } @@ -217,7 +212,7 @@ static void partialDestroyMatchingTCP(SyncState* const syncState) g_hash_table_destroy(matchingData->unMatchedOutE); g_hash_table_destroy(matchingData->unAcked); - if (syncState->graphs && matchingData->messagePoints) + if (syncState->graphsStream && matchingData->messagePoints) { closeGraphDataFiles(syncState); } @@ -372,7 +367,7 @@ static void matchEvents(SyncState* const syncState, Event* const event, return; } - if (syncState->graphs) + if (syncState->graphsStream) { writeMessagePoint(matchingData->messagePoints[packet->inE->traceNum][packet->outE->traceNum], packet); @@ -590,7 +585,7 @@ static void openGraphDataFiles(SyncState* const syncState) matchingData= (MatchingDataTCP*) syncState->matchingData; - cwd= changeToGraphDir(syncState->graphs); + cwd= changeToGraphsDir(syncState->graphsDir); matchingData->messagePoints= malloc(syncState->traceNb * sizeof(FILE**)); for (i= 0; i < syncState->traceNb; i++) @@ -630,11 +625,11 @@ static void openGraphDataFiles(SyncState* const syncState) * * Args: * stream: FILE*, file pointer where to write the point - * message: message for which to write the point + * message: message for which to write the point */ static void writeMessagePoint(FILE* stream, const Message* const message) { - LttCycleCount x, y; + uint64_t x, y; if (message->inE->traceNum < message->outE->traceNum) { @@ -649,7 +644,7 @@ static void writeMessagePoint(FILE* stream, const Message* const message) y= message->inE->cpuTime; } - fprintf(stream, "%20llu %20llu\n", x, y); + fprintf(stream, "%20" PRIu64 " %20" PRIu64 "\n", x, y); } @@ -698,15 +693,14 @@ static void closeGraphDataFiles(SyncState* const syncState) * Write the matching-specific graph lines in the gnuplot script. * * 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 writeMatchingGraphsPlotsTCP(FILE* stream, SyncState* const - syncState, const unsigned int i, const unsigned int j) +static void writeMatchingGraphsPlotsTCPMessages(SyncState* const syncState, + const unsigned int i, const unsigned int j) { - fprintf(stream, + fprintf(syncState->graphsStream, "\t\"matching_tcp-%1$03d_to_%2$03d.data\" " "title \"Sent messages\" with points linetype 4 " "linecolor rgb \"#98fc66\" pointtype 9 pointsize 2, \\\n"