| 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 | |
| 19 | #ifndef SYNC_CHAIN_H |
| 20 | #define SYNC_CHAIN_H |
| 21 | |
| 22 | #include <glib.h> |
| 23 | #include <sys/time.h> |
| 24 | |
| 25 | #include "event_processing.h" |
| 26 | #include "event_matching.h" |
| 27 | #include "event_analysis.h" |
| 28 | |
| 29 | typedef struct _SyncState |
| 30 | { |
| 31 | unsigned int traceNb; |
| 32 | bool stats; |
| 33 | FILE* graphsStream; |
| 34 | const char* graphsDir; |
| 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 | |
| 44 | typedef struct |
| 45 | { |
| 46 | const char* longName; |
| 47 | enum { |
| 48 | NO_ARG, |
| 49 | REQUIRED_ARG, |
| 50 | //OPTIONAL_ARG, // Not yet implemented because not supported by LTTV |
| 51 | HAS_ARG_COUNT // This must be the last field |
| 52 | } hasArg; |
| 53 | union |
| 54 | { |
| 55 | bool present; |
| 56 | const char* arg; |
| 57 | }; |
| 58 | const char* optionHelp; |
| 59 | const char* argHelp; |
| 60 | } ModuleOption; |
| 61 | |
| 62 | |
| 63 | extern GQueue processingModules; |
| 64 | extern GQueue matchingModules; |
| 65 | extern GQueue analysisModules; |
| 66 | extern GQueue moduleOptions; |
| 67 | |
| 68 | |
| 69 | void syncTraceset(LttvTracesetContext* const traceSetContext); |
| 70 | |
| 71 | void timeDiff(struct timeval* const end, const struct timeval* const start); |
| 72 | |
| 73 | gint gcfCompareProcessing(gconstpointer a, gconstpointer b); |
| 74 | gint gcfCompareMatching(gconstpointer a, gconstpointer b); |
| 75 | gint gcfCompareAnalysis(gconstpointer a, gconstpointer b); |
| 76 | |
| 77 | #endif |