Commit | Line | Data |
---|---|---|
b2da0724 BP |
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 FACTOR_REDUCTION_H | |
19 | #define FACTOR_REDUCTION_H | |
20 | ||
21 | #include "data_structures.h" | |
22 | #include "graph_functions.h" | |
23 | ||
24 | ||
25 | struct _SyncState; | |
26 | ||
27 | typedef struct | |
28 | { | |
29 | char* name; | |
30 | ||
eb8e0e6f BP |
31 | /* |
32 | * This function is called at the beginning of a synchronization run for a | |
33 | * set of traces. Allocate some reduction specific data structures. | |
34 | */ | |
b2da0724 | 35 | void (*initReduction)(struct _SyncState* const syncState); |
eb8e0e6f BP |
36 | |
37 | /* | |
38 | * Free the reduction specific data structures | |
39 | */ | |
b2da0724 BP |
40 | void (*destroyReduction)(struct _SyncState* const syncState); |
41 | ||
eb8e0e6f BP |
42 | /* |
43 | * Convert trace pair synchronization factors to a resulting offset and | |
44 | * drift for each trace. | |
45 | */ | |
b2da0724 BP |
46 | GArray* (*finalizeReduction)(struct _SyncState* const syncState, |
47 | AllFactors* allFactors); | |
48 | ||
eb8e0e6f BP |
49 | /* |
50 | * Print statistics related to reduction. Is always called after | |
51 | * finalizeReduction. | |
52 | */ | |
b2da0724 | 53 | void (*printReductionStats)(struct _SyncState* const syncState); |
eb8e0e6f BP |
54 | |
55 | /* | |
56 | * Write the reduction-specific options and graph commands in the gnuplot | |
57 | * script. Is always called after finalizeReduction. | |
58 | */ | |
b2da0724 BP |
59 | GraphFunctions graphFunctions; |
60 | } ReductionModule; | |
61 | ||
62 | #endif |