Commit | Line | Data |
---|---|---|
70407e86 | 1 | /* This file is part of the Linux Trace Toolkit viewer |
277e5b53 | 2 | * Copyright (C) 2009, 2010 Benjamin Poirier <benjamin.poirier@polymtl.ca> |
70407e86 | 3 | * |
277e5b53 BP |
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. | |
70407e86 | 8 | * |
277e5b53 BP |
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. | |
70407e86 | 13 | * |
277e5b53 BP |
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/>. | |
70407e86 BP |
16 | */ |
17 | ||
2bd4b3e4 BP |
18 | #ifndef SYNC_CHAIN_H |
19 | #define SYNC_CHAIN_H | |
70407e86 BP |
20 | |
21 | #include <glib.h> | |
9a9ca632 | 22 | #include <sys/time.h> |
70407e86 BP |
23 | |
24 | #include "event_processing.h" | |
25 | #include "event_matching.h" | |
26 | #include "event_analysis.h" | |
b2da0724 | 27 | #include "factor_reduction.h" |
70407e86 BP |
28 | |
29 | typedef 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; | |
b2da0724 BP |
42 | const ReductionModule* reductionModule; |
43 | void* reductionData; | |
70407e86 BP |
44 | } SyncState; |
45 | ||
2bd4b3e4 BP |
46 | typedef struct |
47 | { | |
b670bb7c | 48 | char shortName; |
2bd4b3e4 BP |
49 | const char* longName; |
50 | enum { | |
51 | NO_ARG, | |
52 | REQUIRED_ARG, | |
49c335f1 | 53 | OPTIONAL_ARG, |
2bd4b3e4 BP |
54 | HAS_ARG_COUNT // This must be the last field |
55 | } hasArg; | |
49c335f1 BP |
56 | bool present; |
57 | // in the case of OPTIONAL_ARG, arg can be initialized to a default value. | |
58 | // If an argument is present, arg will be modified | |
59 | const char* arg; | |
2bd4b3e4 BP |
60 | const char* optionHelp; |
61 | const char* argHelp; | |
62 | } ModuleOption; | |
63 | ||
64 | ||
70407e86 BP |
65 | extern GQueue processingModules; |
66 | extern GQueue matchingModules; | |
67 | extern GQueue analysisModules; | |
b2da0724 BP |
68 | extern GQueue reductionModules; |
69 | ||
2bd4b3e4 | 70 | extern GQueue moduleOptions; |
70407e86 | 71 | |
1ed11971 | 72 | void printStats(SyncState* const syncState); |
70407e86 | 73 | |
9a9ca632 BP |
74 | void timeDiff(struct timeval* const end, const struct timeval* const start); |
75 | ||
76 | gint gcfCompareProcessing(gconstpointer a, gconstpointer b); | |
77 | gint gcfCompareMatching(gconstpointer a, gconstpointer b); | |
78 | gint gcfCompareAnalysis(gconstpointer a, gconstpointer b); | |
b2da0724 | 79 | gint gcfCompareReduction(gconstpointer a, gconstpointer b); |
49c335f1 | 80 | void gfAppendAnalysisName(gpointer data, gpointer user_data); |
b2da0724 | 81 | void gfAppendReductionName(gpointer data, gpointer user_data); |
08365995 | 82 | |
70407e86 | 83 | #endif |