/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2009 Benjamin Poirier <benjamin.poirier@polymtl.ca>
+ * Copyright (C) 2009, 2010 Benjamin Poirier <benjamin.poirier@polymtl.ca>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 2.1 of the License, or (at
+ * your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// for INFINITY in math.h
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);
}
Message* ackedMessage;
AnalysisDataLinReg* analysisData;
- g_debug("Synchronization calculation, ");
- g_debug("%d acked packets - using last one, ",
+ g_debug("Synchronization calculation, "
+ "%d acked packets - using last one,",
g_queue_get_length(exchange->acks));
analysisData= (AnalysisDataLinReg*) syncState->analysisData;
pow(fit->sd, 2) * fit->st2 - 2 * fit->st * fit->sd
* fit->std) / delta) / (fit->n - 2));
- g_debug("[i= %u j= %u]\n", i, j);
- g_debug("n= %d st= %g st2= %g sd= %g sd2= %g std= %g\n",
+ g_debug("[i= %u j= %u]", i, j);
+ g_debug("n= %d st= %g st2= %g sd= %g sd2= %g std= %g",
fit->n, fit->st, fit->st2, fit->sd, fit->sd2, fit->std);
- g_debug("xij= %g d0ij= %g e= %g\n", fit->x, fit->d0, fit->e);
- g_debug("(xji= %g d0ji= %g)\n", -fit->x / (1 + fit->x),
+ g_debug("xij= %g d0ij= %g e= %g", fit->x, fit->d0, fit->e);
+ g_debug("(xji= %g d0ji= %g)", -fit->x / (1 + fit->x),
-fit->d0 / (1 + fit->x));
}
}
GList* result;
// Perform shortest path search
- g_debug("shortest path trace %d\ndistances: ", i);
+ g_debug("shortest path trace %d, distances: ", i);
shortestPath(analysisData->fitArray, i, syncState->traceNb, distances,
previousVertex);
{
g_debug("%g, ", distances[j]);
}
- g_debug("\npreviousVertex: ");
+ g_debug("previousVertex: ");
for (j= 0; j < syncState->traceNb; j++)
{
g_debug("%u, ", previousVertex[j]);
}
- g_debug("\n");
// Group in graphs nodes that have exchanges
errorSum= sumDistances(distances, syncState->traceNb);
{
Graph* graph;
- g_debug("found graph\n");
+ g_debug("found graph");
graph= (Graph*) result->data;
if (errorSum < graph->errorSum)
{
- g_debug("adding to graph\n");
+ g_debug("adding to graph");
graph->errorSum= errorSum;
free(graph->previousVertex);
graph->previousVertex= previousVertex;
{
Graph* newGraph;
- g_debug("creating new graph\n");
+ g_debug("creating new graph");
newGraph= malloc(sizeof(Graph));
newGraph->errorSum= errorSum;
newGraph->previousVertex= previousVertex;
visited[i]= false;
fit= &fitArray[traceNum][i];
- g_debug("fitArray[traceNum= %u][i= %u]->n = %u\n", traceNum, i, fit->n);
+ g_debug("fitArray[traceNum= %u][i= %u]->n = %u", traceNum, i, fit->n);
if (fit->n > 0)
{
distances[i]= fit->e;
{
g_debug("(%d, %u, %g), ", visited[j], previousVertex[j], distances[j]);
}
- g_debug("\n");
for (i= 0; i < traceNb - 2; i++)
{
}
}
- g_debug("v= %u dvMin= %g\n", v, dvMin);
+ g_debug("v= %u dvMin= %g", v, dvMin);
if (dvMin != INFINITY)
{
{
g_debug("(%d, %u, %g), ", visited[j], previousVertex[j], distances[j]);
}
- g_debug("\n");
}
free(visited);