From: Benjamin Poirier Date: Thu, 26 Nov 2009 16:12:58 +0000 (-0500) Subject: initProcessing takes a va_arg rather than an lttv-specific type X-Git-Tag: v0.12.26~22 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2f07659468ff3427bb3923cdc5a7ec61b6e8bbce;p=lttv.git initProcessing takes a va_arg rather than an lttv-specific type Makes the framework more general. Signed-off-by: Benjamin Poirier --- diff --git a/lttv/lttv/sync/event_analysis_chull.c b/lttv/lttv/sync/event_analysis_chull.c index b89f89ca..d0dd0a70 100644 --- a/lttv/lttv/sync/event_analysis_chull.c +++ b/lttv/lttv/sync/event_analysis_chull.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include "sync_chain.h" diff --git a/lttv/lttv/sync/event_processing.h b/lttv/lttv/sync/event_processing.h index d1ac7647..34ea8001 100644 --- a/lttv/lttv/sync/event_processing.h +++ b/lttv/lttv/sync/event_processing.h @@ -22,8 +22,6 @@ #include #include -#include - #include "data_structures.h" #include "graph_functions.h" @@ -34,12 +32,9 @@ typedef struct { char* name; - void (*initProcessing)(struct _SyncState* const syncStateLttv, - LttvTracesetContext* const traceSetContext); + void (*initProcessing)(struct _SyncState* const syncStateLttv, ...); void (*destroyProcessing)(struct _SyncState* const syncState); - void (*finalizeProcessing)(struct _SyncState* const syncState); - void (*printProcessingStats)(struct _SyncState* const syncState); GraphFunctions graphFunctions; } ProcessingModule; diff --git a/lttv/lttv/sync/event_processing_lttng_null.c b/lttv/lttv/sync/event_processing_lttng_null.c index 580185fb..28b97cca 100644 --- a/lttv/lttv/sync/event_processing_lttng_null.c +++ b/lttv/lttv/sync/event_processing_lttng_null.c @@ -20,6 +20,7 @@ #include #endif +#include #include #include "sync_chain.h" @@ -29,8 +30,7 @@ // Functions common to all processing modules -static void initProcessingLTTVNull(SyncState* const syncState, - LttvTracesetContext* const traceSetContext); +static void initProcessingLTTVNull(SyncState* const syncState, ...); static void destroyProcessingLTTVNull(SyncState* const syncState); static void finalizeProcessingLTTVNull(SyncState* const syncState); @@ -68,12 +68,13 @@ static void registerProcessingLTTVNull() * syncState: container for synchronization data. * This function allocates these processingData members: * hookListList - * traceSetContext: set of LTTV traces + * traceSetContext: LttvTracesetContext*, set of LTTV traces */ -static void initProcessingLTTVNull(SyncState* const syncState, - LttvTracesetContext* const traceSetContext) +static void initProcessingLTTVNull(SyncState* const syncState, ...) { ProcessingDataLTTVNull* processingData; + LttvTracesetContext* traceSetContext; + va_list ap; processingData= malloc(sizeof(ProcessingDataLTTVNull)); syncState->processingData= processingData; @@ -82,6 +83,9 @@ static void initProcessingLTTVNull(SyncState* const syncState, processingData->hookListList= g_array_sized_new(FALSE, FALSE, sizeof(GArray*), syncState->traceNb); + va_start(ap, syncState); + traceSetContext= va_arg(ap, LttvTracesetContext*); + va_end(ap); registerHooks(processingData->hookListList, traceSetContext, &processEventLTTVNull, syncState, syncState->matchingModule->canMatch); diff --git a/lttv/lttv/sync/event_processing_lttng_standard.c b/lttv/lttv/sync/event_processing_lttng_standard.c index 1bec81f0..4b5f69ec 100644 --- a/lttv/lttv/sync/event_processing_lttng_standard.c +++ b/lttv/lttv/sync/event_processing_lttng_standard.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -36,8 +37,7 @@ // Functions common to all processing modules -static void initProcessingLTTVStandard(SyncState* const syncState, - LttvTracesetContext* const traceSetContext); +static void initProcessingLTTVStandard(SyncState* const syncState, ...); static void destroyProcessingLTTVStandard(SyncState* const syncState); static void finalizeProcessingLTTVStandard(SyncState* const syncState); @@ -91,17 +91,19 @@ static void registerProcessingLTTVStandard() * pendingRecv * hookListList * stats - * traceSetContext: set of LTTV traces + * traceSetContext: LttvTracesetContext*, set of LTTV traces */ -static void initProcessingLTTVStandard(SyncState* const syncState, LttvTracesetContext* - const traceSetContext) +static void initProcessingLTTVStandard(SyncState* const syncState, ...) { unsigned int i; ProcessingDataLTTVStandard* processingData; + va_list ap; processingData= malloc(sizeof(ProcessingDataLTTVStandard)); syncState->processingData= processingData; - processingData->traceSetContext= traceSetContext; + va_start(ap, syncState); + processingData->traceSetContext= va_arg(ap, LttvTracesetContext*); + va_end(ap); if (syncState->stats) { @@ -131,7 +133,7 @@ static void initProcessingLTTVStandard(SyncState* const syncState, LttvTracesetC for(i= 0; i < syncState->traceNb; i++) { - LttTrace* traceI= traceSetContext->traces[i]->t; + LttTrace* traceI= processingData->traceSetContext->traces[i]->t; processingData->graphs[i].startFreq= traceI->start_freq; processingData->graphs[i].freqScale= traceI->freq_scale; @@ -148,8 +150,8 @@ static void initProcessingLTTVStandard(SyncState* const syncState, LttvTracesetC NULL, NULL, &gdnDestroyEvent); } - registerHooks(processingData->hookListList, traceSetContext, - &processEventLTTVStandard, syncState, + registerHooks(processingData->hookListList, + processingData->traceSetContext, &processEventLTTVStandard, syncState, syncState->matchingModule->canMatch); } diff --git a/lttv/lttv/sync/graph_functions.c b/lttv/lttv/sync/graph_functions.c index 6bd28b80..85adcf37 100644 --- a/lttv/lttv/sync/graph_functions.c +++ b/lttv/lttv/sync/graph_functions.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/lttv/lttv/sync/sync_chain.c b/lttv/lttv/sync/sync_chain.c index 30593508..e6541597 100644 --- a/lttv/lttv/sync/sync_chain.c +++ b/lttv/lttv/sync/sync_chain.c @@ -21,6 +21,7 @@ #endif #include +#include #include #include "sync_chain.h" diff --git a/lttv/lttv/sync/sync_chain.h b/lttv/lttv/sync/sync_chain.h index ee81308f..852e8e4a 100644 --- a/lttv/lttv/sync/sync_chain.h +++ b/lttv/lttv/sync/sync_chain.h @@ -66,8 +66,6 @@ extern GQueue analysisModules; extern GQueue moduleOptions; -void syncTraceset(LttvTracesetContext* const traceSetContext); - void timeDiff(struct timeval* const end, const struct timeval* const start); gint gcfCompareProcessing(gconstpointer a, gconstpointer b); diff --git a/lttv/lttv/sync/sync_chain_lttv.c b/lttv/lttv/sync/sync_chain_lttv.c index 58ef078d..5dd10bf9 100644 --- a/lttv/lttv/sync/sync_chain_lttv.c +++ b/lttv/lttv/sync/sync_chain_lttv.c @@ -34,6 +34,7 @@ #include #include "sync_chain.h" +#include "sync_chain_lttv.h" static void init(); diff --git a/lttv/lttv/sync/sync_chain_lttv.h b/lttv/lttv/sync/sync_chain_lttv.h new file mode 100644 index 00000000..0688f96e --- /dev/null +++ b/lttv/lttv/sync/sync_chain_lttv.h @@ -0,0 +1,26 @@ +/* This file is part of the Linux Trace Toolkit viewer + * Copyright (C) 2009 Benjamin Poirier + * + * 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 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. + * + * 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. + */ + +#ifndef SYNC_CHAIN_LTTV_H +#define SYNC_CHAIN_LTTV_H + +#include + +void syncTraceset(LttvTracesetContext* const traceSetContext); + +#endif diff --git a/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c b/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c index 53681f48..6514ef0a 100644 --- a/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c +++ b/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/lttv/modules/text/batchAnalysis.c b/lttv/modules/text/batchAnalysis.c index 3ee4d021..4b02f332 100644 --- a/lttv/modules/text/batchAnalysis.c +++ b/lttv/modules/text/batchAnalysis.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include static LttvTraceset *traceset;