Add graphStream field to syncState
[lttv.git] / lttv / lttv / sync / event_analysis_linreg.c
index cae9093681e90069e500dd071e39b0e2019409bb..3e88c71c28fbe283a85c237fcc047714c0b1f49d 100644 (file)
@@ -44,8 +44,8 @@ static void destroyAnalysisLinReg(SyncState* const syncState);
 static void analyzeExchangeLinReg(SyncState* const syncState, Exchange* const exchange);
 static GArray* finalizeAnalysisLinReg(SyncState* const syncState);
 static void printAnalysisStatsLinReg(SyncState* const syncState);
-static void writeAnalysisGraphsPlotsLinReg(FILE* stream, SyncState* const
-       syncState, const unsigned int i, const unsigned int j);
+static void writeAnalysisGraphsPlotsLinReg(SyncState* const syncState, const
+       unsigned int i, const unsigned int j);
 
 // Functions specific to this module
 static void registerAnalysisLinReg() __attribute__((constructor (102)));
@@ -193,14 +193,14 @@ static void analyzeExchangeLinReg(SyncState* const syncState, Exchange* const ex
 
        // Calculate the intermediate values for the
        // least-squares analysis
-       dji= ((double) ackedMessage->inE->time - (double) ackedMessage->outE->time
-               + (double) exchange->message->outE->time - (double)
-               exchange->message->inE->time) / 2;
-       eji= fabs((double) ackedMessage->inE->time - (double)
-               ackedMessage->outE->time - (double) exchange->message->outE->time +
-               (double) exchange->message->inE->time) / 2;
-       timoy= ((double) ackedMessage->outE->time + (double)
-               exchange->message->inE->time) / 2;
+       dji= ((double) ackedMessage->inE->cpuTime - (double) ackedMessage->outE->cpuTime
+               + (double) exchange->message->outE->cpuTime - (double)
+               exchange->message->inE->cpuTime) / 2;
+       eji= fabs((double) ackedMessage->inE->cpuTime - (double)
+               ackedMessage->outE->cpuTime - (double) exchange->message->outE->cpuTime +
+               (double) exchange->message->inE->cpuTime) / 2;
+       timoy= ((double) ackedMessage->outE->cpuTime + (double)
+               exchange->message->inE->cpuTime) / 2;
        ni= ackedMessage->outE->traceNum;
        nj= ackedMessage->inE->traceNum;
        fit= &analysisData->fitArray[nj][ni];
@@ -745,13 +745,12 @@ static gint gcfGraphTraceCompare(gconstpointer a, gconstpointer b)
  * Write the analysis-specific graph lines in the gnuplot script.
  *
  * Args:
- *   stream:       stream where to write the data
  *   syncState:    container for synchronization data
  *   i:            first trace number, on the x axis
  *   j:            second trace number, garanteed to be larger than i
  */
-void writeAnalysisGraphsPlotsLinReg(FILE* stream, SyncState* const syncState,
-       const unsigned int i, const unsigned int j)
+void writeAnalysisGraphsPlotsLinReg(SyncState* const syncState, const unsigned
+       int i, const unsigned int j)
 {
        AnalysisDataLinReg* analysisData;
        Fit* fit;
@@ -759,7 +758,7 @@ void writeAnalysisGraphsPlotsLinReg(FILE* stream, SyncState* const syncState,
        analysisData= (AnalysisDataLinReg*) syncState->analysisData;
        fit= &analysisData->fitArray[j][i];
 
-       fprintf(stream,
+       fprintf(syncState->graphsStream,
                "\t%7g + %7g * x "
                "title \"Linreg conversion\" with lines "
                "linecolor rgb \"gray60\" linetype 1, \\\n",
This page took 0.023421 seconds and 4 git commands to generate.