Remove unused g_info definitions
[lttv.git] / lttv / lttv / sync / event_matching_tcp.c
index 6b8f538eaf25cddbd5809e70c5f062e4bfa12710..e9cdce925bf66630bd17db015b52e8a2b4dd0a40 100644 (file)
 #include <unistd.h>
 
 #include "event_analysis.h"
-#include "sync_chain_lttv.h"
+#include "sync_chain.h"
 
 #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,10 +38,8 @@ 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 writeMatchingGraphsOptionsTCP(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)));
@@ -76,8 +69,9 @@ static MatchingModule matchingModuleTCP = {
        .matchEvent= &matchEventTCP,
        .finalizeMatching= &finalizeMatchingTCP,
        .printMatchingStats= &printMatchingStatsTCP,
-       .writeMatchingGraphsPlots= &writeMatchingGraphsPlotsTCP,
-       .writeMatchingGraphsOptions= &writeMatchingGraphsOptionsTCP,
+       .graphFunctions= {
+               .writeTraceTraceForePlots= &writeMatchingGraphsPlotsTCPMessages,
+       }
 };
 
 
@@ -139,7 +133,7 @@ static void initMatchingTCP(SyncState* const syncState)
                matchingData->stats= NULL;
        }
 
-       if (syncState->graphs)
+       if (syncState->graphsStream)
        {
                openGraphDataFiles(syncState);
        }
@@ -219,7 +213,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);
        }
@@ -275,8 +269,8 @@ static GArray* finalizeMatchingTCP(SyncState* const 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.
@@ -318,11 +312,6 @@ static void printMatchingStatsTCP(SyncState* const syncState)
                printf("\ttotal synchronization exchanges: %u\n",
                        matchingData->stats->totExchangeSync);
        }
-
-       if (syncState->analysisModule->printAnalysisStats != NULL)
-       {
-               syncState->analysisModule->printAnalysisStats(syncState);
-       }
 }
 
 
@@ -379,7 +368,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);
@@ -597,7 +586,7 @@ static void openGraphDataFiles(SyncState* const syncState)
 
        matchingData= (MatchingDataTCP*) syncState->matchingData;
 
-       cwd= changeToGraphDir(syncState->graphs);
+       cwd= changeToGraphDir(syncState->graphsDir);
 
        matchingData->messagePoints= malloc(syncState->traceNb * sizeof(FILE**));
        for (i= 0; i < syncState->traceNb; i++)
@@ -637,23 +626,23 @@ 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)
        {
                // CA is inE->traceNum
-               x= message->inE->time;
-               y= message->outE->time;
+               x= message->inE->cpuTime;
+               y= message->outE->cpuTime;
        }
        else
        {
                // CA is outE->traceNum
-               x= message->outE->time;
-               y= message->inE->time;
+               x= message->outE->cpuTime;
+               y= message->inE->cpuTime;
        }
 
        fprintf(stream, "%20llu %20llu\n", x, y);
@@ -702,50 +691,21 @@ static void closeGraphDataFiles(SyncState* const 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
  *   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"
                "\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);
-       }
 }
This page took 0.024683 seconds and 4 git commands to generate.