Add sync_chain_unittest
[lttv.git] / lttv / lttv / sync / sync_chain.h
CommitLineData
70407e86
BP
1/* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2009 Benjamin Poirier <benjamin.poirier@polymtl.ca>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
16 * MA 02111-1307, USA.
17 */
18
2bd4b3e4
BP
19#ifndef SYNC_CHAIN_H
20#define SYNC_CHAIN_H
70407e86
BP
21
22#include <glib.h>
9a9ca632 23#include <sys/time.h>
70407e86
BP
24
25#include "event_processing.h"
26#include "event_matching.h"
27#include "event_analysis.h"
28
29typedef struct _SyncState
30{
31 unsigned int traceNb;
32 bool stats;
8d7d16dd
BP
33 FILE* graphsStream;
34 const char* graphsDir;
70407e86
BP
35
36 const ProcessingModule* processingModule;
37 void* processingData;
38 const MatchingModule* matchingModule;
39 void* matchingData;
40 const AnalysisModule* analysisModule;
41 void* analysisData;
42} SyncState;
43
2bd4b3e4
BP
44typedef struct
45{
b670bb7c 46 char shortName;
2bd4b3e4
BP
47 const char* longName;
48 enum {
49 NO_ARG,
50 REQUIRED_ARG,
49c335f1 51 OPTIONAL_ARG,
2bd4b3e4
BP
52 HAS_ARG_COUNT // This must be the last field
53 } hasArg;
49c335f1
BP
54 bool present;
55 // in the case of OPTIONAL_ARG, arg can be initialized to a default value.
56 // If an argument is present, arg will be modified
57 const char* arg;
2bd4b3e4
BP
58 const char* optionHelp;
59 const char* argHelp;
60} ModuleOption;
61
62
70407e86
BP
63extern GQueue processingModules;
64extern GQueue matchingModules;
65extern GQueue analysisModules;
2bd4b3e4 66extern GQueue moduleOptions;
70407e86 67
1ed11971 68void printStats(SyncState* const syncState);
70407e86 69
9a9ca632
BP
70void timeDiff(struct timeval* const end, const struct timeval* const start);
71
72gint gcfCompareProcessing(gconstpointer a, gconstpointer b);
73gint gcfCompareMatching(gconstpointer a, gconstpointer b);
74gint gcfCompareAnalysis(gconstpointer a, gconstpointer b);
49c335f1 75void gfAppendAnalysisName(gpointer data, gpointer user_data);
08365995 76
70407e86 77#endif
This page took 0.025762 seconds and 4 git commands to generate.