From d5b038ec901e9753a8569f33516a49361c54254c Mon Sep 17 00:00:00 2001 From: Benjamin Poirier Date: Wed, 25 Nov 2009 15:14:41 -0500 Subject: [PATCH] Clean debug statements Signed-off-by: Benjamin Poirier --- lttv/lttv/sync/data_structures.c | 4 --- lttv/lttv/sync/event_analysis_linreg.c | 29 +++++++++---------- .../sync/event_processing_lttng_standard.c | 18 +++++------- lttv/lttv/sync/sync_chain_lttv.c | 4 +-- 4 files changed, 22 insertions(+), 33 deletions(-) diff --git a/lttv/lttv/sync/data_structures.c b/lttv/lttv/sync/data_structures.c index 6bdf0b25..7a9b16d4 100644 --- a/lttv/lttv/sync/data_structures.c +++ b/lttv/lttv/sync/data_structures.c @@ -234,8 +234,6 @@ void gdnTCPSegmentListDestroy(gpointer data) list= (GQueue*) data; - g_debug("XXXX gdnTCPSegmentListDestroy\n"); - g_queue_foreach(list, &gfTCPSegmentDestroy, NULL); g_queue_free(list); } @@ -250,7 +248,6 @@ void gdnTCPSegmentListDestroy(gpointer data) */ void gfTCPSegmentDestroy(gpointer data, gpointer user_data) { - g_debug("XXXX gfTCPSegmentDestroy\n"); destroyTCPSegment((Message*) data); } @@ -266,7 +263,6 @@ void destroyTCPSegment(Message* const segment) { TCPEvent* inE, *outE; - g_debug("XXXX destroyTCPSegment"); segment->print(segment); g_assert(segment->inE != NULL && segment->outE != NULL); diff --git a/lttv/lttv/sync/event_analysis_linreg.c b/lttv/lttv/sync/event_analysis_linreg.c index 2ceecf3e..07537780 100644 --- a/lttv/lttv/sync/event_analysis_linreg.c +++ b/lttv/lttv/sync/event_analysis_linreg.c @@ -178,8 +178,8 @@ static void analyzeExchangeLinReg(SyncState* const syncState, Exchange* const ex 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; @@ -357,11 +357,11 @@ static void finalizeLSA(SyncState* const syncState) 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)); } } @@ -398,7 +398,7 @@ static void doGraphProcessing(SyncState* const syncState) 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); @@ -406,12 +406,11 @@ static void doGraphProcessing(SyncState* const syncState) { 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); @@ -421,11 +420,11 @@ static void doGraphProcessing(SyncState* const syncState) { 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; @@ -438,7 +437,7 @@ static void doGraphProcessing(SyncState* const syncState) { Graph* newGraph; - g_debug("creating new graph\n"); + g_debug("creating new graph"); newGraph= malloc(sizeof(Graph)); newGraph->errorSum= errorSum; newGraph->previousVertex= previousVertex; @@ -542,7 +541,7 @@ static void shortestPath(Fit* const* const fitArray, const unsigned int 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; @@ -560,7 +559,6 @@ static void shortestPath(Fit* const* const fitArray, const unsigned int { g_debug("(%d, %u, %g), ", visited[j], previousVertex[j], distances[j]); } - g_debug("\n"); for (i= 0; i < traceNb - 2; i++) { @@ -577,7 +575,7 @@ static void shortestPath(Fit* const* const fitArray, const unsigned int } } - g_debug("v= %u dvMin= %g\n", v, dvMin); + g_debug("v= %u dvMin= %g", v, dvMin); if (dvMin != INFINITY) { @@ -605,7 +603,6 @@ static void shortestPath(Fit* const* const fitArray, const unsigned int { g_debug("(%d, %u, %g), ", visited[j], previousVertex[j], distances[j]); } - g_debug("\n"); } free(visited); diff --git a/lttv/lttv/sync/event_processing_lttng_standard.c b/lttv/lttv/sync/event_processing_lttng_standard.c index b5ec8d41..1bec81f0 100644 --- a/lttv/lttv/sync/event_processing_lttng_standard.c +++ b/lttv/lttv/sync/event_processing_lttng_standard.c @@ -232,7 +232,7 @@ static void finalizeProcessingLTTVStandard(SyncState* const syncState) lttv_traceset_context_compute_time_span(processingData->traceSetContext, &processingData->traceSetContext->time_span); - g_debug("traceset start %ld.%09ld end %ld.%09ld\n", + g_debug("traceset start %ld.%09ld end %ld.%09ld", processingData->traceSetContext->time_span.start_time.tv_sec, processingData->traceSetContext->time_span.start_time.tv_nsec, processingData->traceSetContext->time_span.end_time.tv_sec, @@ -347,7 +347,7 @@ static void partialDestroyProcessingLTTVStandard(SyncState* const syncState) for(i= 0; i < syncState->traceNb; i++) { - g_debug("Cleaning up pendingRecv list\n"); + g_debug("Cleaning up pendingRecv list"); g_hash_table_destroy(processingData->pendingRecv[i]); } free(processingData->pendingRecv); @@ -397,7 +397,7 @@ static gboolean processEventLTTVStandard(void* hookData, void* callData) g_assert(g_hash_table_lookup_extended(processingData->traceNumTable, trace, NULL, (gpointer*) &traceNum)); - g_debug("XXXX process event: time: %ld.%09ld trace: %ld (%p) name: %s ", + g_debug("Process event: time: %ld.%09ld trace: %ld (%p) name: %s ", time.tv_sec, time.tv_nsec, traceNum, trace, g_quark_to_string(info->name)); @@ -468,7 +468,7 @@ static gboolean processEventLTTVStandard(void* hookData, void* callData) syncState->matchingModule->matchEvent(syncState, outE); - g_debug("Output event done\n"); + g_debug("Output event done"); } else if (info->name == LTT_EVENT_DEV_RECEIVE) { @@ -505,11 +505,7 @@ static gboolean processEventLTTVStandard(void* hookData, void* callData) g_hash_table_replace(processingData->pendingRecv[traceNum], skb, inE); - g_debug("Adding inE %p for skb %p to pendingRecv\n", inE, skb); - } - else - { - g_debug("\n"); + g_debug("Adding inE %p for skb %p to pendingRecv", inE, skb); } } else if (info->name == LTT_EVENT_TCPV4_RCV_EXTENDED) @@ -586,7 +582,7 @@ static gboolean processEventLTTVStandard(void* hookData, void* callData) syncState->matchingModule->matchEvent(syncState, inE); - g_debug("TCP input event %p for skb %p done\n", inE, skb); + g_debug("TCP input event %p for skb %p done", inE, skb); } } else if (info->name == LTT_EVENT_UDPV4_RCV_EXTENDED) @@ -660,7 +656,7 @@ static gboolean processEventLTTVStandard(void* hookData, void* callData) syncState->matchingModule->matchEvent(syncState, inE); - g_debug("UDP input event %p for skb %p done\n", inE, skb); + g_debug("UDP input event %p for skb %p done", inE, skb); } } else diff --git a/lttv/lttv/sync/sync_chain_lttv.c b/lttv/lttv/sync/sync_chain_lttv.c index fbbf7dfe..c2ec05de 100644 --- a/lttv/lttv/sync/sync_chain_lttv.c +++ b/lttv/lttv/sync/sync_chain_lttv.c @@ -101,7 +101,7 @@ static void init() { int retval; - g_debug("\t\t\tXXXX sync init\n"); + g_debug("Sync init"); g_assert(g_queue_get_length(&analysisModules) > 0); optionSyncAnalysis.arg = ((AnalysisModule*) @@ -138,7 +138,7 @@ static void init() */ static void destroy() { - g_debug("\t\t\tXXXX sync destroy\n"); + g_debug("Sync destroy"); g_queue_foreach(&moduleOptions, &gfRemoveModuleOption, NULL); g_string_free(analysisModulesNames, TRUE); -- 2.34.1