Makes the framework more general.
Signed-off-by: Benjamin Poirier <benjamin.poirier@polymtl.ca>
#include <float.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <unistd.h>
#include "sync_chain.h"
#include <glib.h>
#include <stdio.h>
-#include <lttv/tracecontext.h>
-
#include "data_structures.h"
#include "graph_functions.h"
{
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;
#include <config.h>
#endif
+#include <stdarg.h>
#include <stdlib.h>
#include "sync_chain.h"
// 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);
* 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;
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);
#include <linux/if_ether.h>
#include <math.h>
#include <netinet/in.h>
+#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
// 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);
* 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)
{
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;
NULL, NULL, &gdnDestroyEvent);
}
- registerHooks(processingData->hookListList, traceSetContext,
- &processEventLTTVStandard, syncState,
+ registerHooks(processingData->hookListList,
+ processingData->traceSetContext, &processEventLTTVStandard, syncState,
syncState->matchingModule->canMatch);
}
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#endif
#include <errno.h>
+#include <string.h>
#include <unistd.h>
#include "sync_chain.h"
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);
#include <lttv/option.h>
#include "sync_chain.h"
+#include "sync_chain_lttv.h"
static void init();
--- /dev/null
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2009 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 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 <lttv/tracecontext.h>
+
+void syncTraceset(LttvTracesetContext* const traceSetContext);
+
+#endif
#include <lttv/iattribute.h>
#include <lttv/stats.h>
#include <lttv/filter.h>
-#include <lttv/sync/sync_chain.h>
+#include <lttv/sync/sync_chain_lttv.h>
#include <lttvwindow/mainwindow.h>
#include <lttvwindow/mainwindow-private.h>
#include <lttvwindow/menu.h>
#include <lttv/stats.h>
#include <lttv/filter.h>
#include <ltt/trace.h>
-#include <lttv/sync/sync_chain.h>
+#include <lttv/sync/sync_chain_lttv.h>
static LttvTraceset *traceset;