X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=lttv%2Flttv%2Fsync%2Fsync_chain_lttv.c;h=2479512fed5ddb083ef170fabda3b154f56199d7;hb=f6691532b67cb6911749118e3da8d74de876380c;hp=16190c48b4216d2c8d93c2499db55743a7480438;hpb=fea7219b7d953f8c2677f497f010495cfa095b00;p=lttv.git diff --git a/lttv/lttv/sync/sync_chain_lttv.c b/lttv/lttv/sync/sync_chain_lttv.c index 16190c48..2479512f 100644 --- a/lttv/lttv/sync/sync_chain_lttv.c +++ b/lttv/lttv/sync/sync_chain_lttv.c @@ -210,24 +210,22 @@ void syncTraceset(LttvTracesetContext* const traceSetContext) syncState->processingModule= (ProcessingModule*) result->data; graphsStream= NULL; - if (syncState->graphs) + if (syncState->graphs && + syncState->processingModule->writeProcessingGraphsPlots != NULL) { // Create the graph directory right away in case the module initialization // functions have something to write in it. cwd= changeToGraphDir(syncState->graphs); - if (syncState->processingModule->writeProcessingGraphsPlots != NULL) + if ((graphsFp= open("graphs.gnu", O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | + S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH + | S_IWOTH | S_IXOTH)) == -1) { - if ((graphsFp= open("graphs.gnu", O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | - S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH - | S_IWOTH | S_IXOTH)) == -1) - { - g_error(strerror(errno)); - } - if ((graphsStream= fdopen(graphsFp, "w")) == NULL) - { - g_error(strerror(errno)); - } + g_error(strerror(errno)); + } + if ((graphsStream= fdopen(graphsFp, "w")) == NULL) + { + g_error(strerror(errno)); } retval= chdir(cwd); @@ -238,34 +236,31 @@ void syncTraceset(LttvTracesetContext* const traceSetContext) free(cwd); } - syncState->processingModule->initProcessing(syncState, traceSetContext); + // Identify matching and analysis modules + g_assert(g_queue_get_length(&matchingModules) == 1); + syncState->matchingModule= (MatchingModule*) + g_queue_peek_head(&matchingModules); - // Identify and initialize matching and analysis modules - syncState->matchingData= NULL; - syncState->analysisData= NULL; - if (optionSyncNull) + result= g_queue_find_custom(&analysisModules, optionSyncAnalysis, + &gcfCompareAnalysis); + if (result != NULL) { - syncState->matchingModule= NULL; - syncState->analysisModule= NULL; + syncState->analysisModule= (AnalysisModule*) result->data; } else { - g_assert(g_queue_get_length(&matchingModules) == 1); - syncState->matchingModule= (MatchingModule*) - g_queue_peek_head(&matchingModules); - syncState->matchingModule->initMatching(syncState); + g_error("Analysis module '%s' not found", optionSyncAnalysis); + } - result= g_queue_find_custom(&analysisModules, optionSyncAnalysis, - &gcfCompareAnalysis); - if (result != NULL) - { - syncState->analysisModule= (AnalysisModule*) result->data; - syncState->analysisModule->initAnalysis(syncState); - } - else - { - g_error("Analysis module '%s' not found", optionSyncAnalysis); - } + syncState->processingModule->initProcessing(syncState, traceSetContext); + + syncState->matchingData= NULL; + syncState->analysisData= NULL; + + if (!optionSyncNull) + { + syncState->matchingModule->initMatching(syncState); + syncState->analysisModule->initAnalysis(syncState); } // Process traceset