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