X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttv%2Flttv%2Fsync%2Fsync_chain_unittest.c;h=652c379752e71ed05b13e635c212c24688a01576;hb=0a87ec9a018cc9731ce3b04309eaa4dcc77df6d2;hp=50c9f395526cbb75fed31abf71679ed921bb2dba;hpb=9c7696b8589e76aed870b15cabd09a162d468621;p=lttv.git diff --git a/lttv/lttv/sync/sync_chain_unittest.c b/lttv/lttv/sync/sync_chain_unittest.c index 50c9f395..652c3797 100644 --- a/lttv/lttv/sync/sync_chain_unittest.c +++ b/lttv/lttv/sync/sync_chain_unittest.c @@ -100,12 +100,13 @@ int main(const int argc, char* const argv[]) struct timeval startTime, endTime; struct rusage startUsage, endUsage; GList* result; + GArray* factors; int retval; bool stats; const char* testCaseName; GString* analysisModulesNames; unsigned int id; - GArray* factors; + AllFactors* allFactors; /* * Initialize event modules @@ -208,8 +209,9 @@ int main(const int argc, char* const argv[]) syncState->analysisModule->initAnalysis(syncState); // Process traceset - factors= syncState->processingModule->finalizeProcessing(syncState); - g_array_free(factors, TRUE); + allFactors= syncState->processingModule->finalizeProcessing(syncState); + factors= reduceFactors(allFactors); + freeAllFactors(allFactors); // Write graphs file if (syncState->graphsStream) @@ -223,9 +225,19 @@ int main(const int argc, char* const argv[]) } // Print statistics - if (syncState->stats) + if (optionSyncStats.present) { + unsigned int i; + printStats(syncState); + + printf("Resulting synchronization factors:\n"); + for (i= 0; i < factors->len; i++) + { + Factors* traceFactors= &g_array_index(factors, Factors, i); + printf("\ttrace %u drift= %g offset= %g\n", i, + traceFactors->drift, traceFactors->offset); + } } // Destroy modules and clean up @@ -263,7 +275,7 @@ int main(const int argc, char* const argv[]) /* - * Read program arguments dans update ModuleOptions structures + * Read program arguments and update ModuleOptions structures * * Args: * argc, argv: standard argument arrays