Commit | Line | Data |
---|---|---|
cdce23b3 | 1 | /* This file is part of the Linux Trace Toolkit viewer |
277e5b53 | 2 | * Copyright (C) 2009, 2010 Benjamin Poirier <benjamin.poirier@polymtl.ca> |
cdce23b3 | 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. | |
cdce23b3 | 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. | |
cdce23b3 | 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/>. | |
cdce23b3 BP |
16 | */ |
17 | ||
18 | #ifndef EVENT_ANALYSIS_EVAL_H | |
19 | #define EVENT_ANALYSIS_EVAL_H | |
20 | ||
66eaf2eb BP |
21 | #ifdef HAVE_CONFIG_H |
22 | #include <config.h> | |
23 | #endif | |
24 | ||
cdce23b3 | 25 | #include <glib.h> |
66eaf2eb BP |
26 | #ifdef HAVE_LIBGLPK |
27 | #include <glpk.h> | |
28 | #endif | |
cdce23b3 BP |
29 | |
30 | #include "data_structures.h" | |
31 | ||
32 | ||
d4721e1a BP |
33 | struct RttKey |
34 | { | |
35 | uint32_t saddr, daddr; | |
36 | }; | |
37 | ||
cdce23b3 BP |
38 | typedef struct |
39 | { | |
40 | unsigned int inversionNb, | |
41 | tooFastNb, | |
76be6fc2 BP |
42 | noRTTInfoNb, |
43 | total; | |
44 | } MessageStats; | |
cdce23b3 BP |
45 | |
46 | typedef struct | |
47 | { | |
48 | double broadcastDiffSum; | |
76be6fc2 BP |
49 | unsigned int broadcastNb; |
50 | ||
e072e1ab | 51 | // MessageStats messageStats[traceNb][traceNb] |
76be6fc2 | 52 | MessageStats** messageStats; |
e072e1ab | 53 | |
d4721e1a BP |
54 | /* double* exchangeRtt[RttKey] |
55 | * For this table, saddr and daddr are swapped as necessary such that | |
56 | * saddr < daddr */ | |
57 | GHashTable* exchangeRtt; | |
cdce23b3 | 58 | |
66eaf2eb BP |
59 | #ifdef HAVE_LIBGLPK |
60 | /* FactorsCHull** chFactorsArray[traceNum][traceNum] | |
61 | * FactorsCHull** lpFactorsArray[traceNum][traceNum] | |
62 | * | |
63 | * As usual, only the lower triangular part of theses matrixes is | |
64 | * allocated */ | |
65 | FactorsCHull** chFactorsArray; | |
66 | FactorsCHull** lpFactorsArray; | |
67 | #endif | |
68 | } AnalysisStatsEval; | |
e072e1ab BP |
69 | |
70 | #define BIN_NB 1001 | |
71 | struct Bins | |
72 | { | |
73 | // index of min and max bins that are != 0 | |
74 | uint32_t min, max; | |
75 | // sum of all bins | |
76 | uint32_t total; | |
77 | /* bin[0]: underflow ]-INFINITY..0[ | |
78 | * bin[1]: [0..1e-6[ | |
79 | * rest defined exponentially, see binStart() | |
80 | * bin[BIN_NB - 1]: overflow [1..INFINITY[ */ | |
81 | uint32_t bin[BIN_NB]; | |
82 | }; | |
83 | ||
4ee223e5 BP |
84 | typedef struct |
85 | { | |
e072e1ab | 86 | /* File pointers to files where "trip times" (message latency) histogram |
e96ed88f BP |
87 | * values are output. Each host-pair has two files, one for each message |
88 | * direction. As for traces, the host with the smallest address is | |
89 | * considered to be the reference for the direction of messages (ie. | |
e072e1ab BP |
90 | * messages from the host with the lowest address to the host with the |
91 | * largest address are "sent"). */ | |
92 | FILE* ttSendPoints; | |
93 | FILE* ttRecvPoints; | |
94 | ||
95 | struct Bins ttSendBins; | |
96 | struct Bins ttRecvBins; | |
97 | ||
98 | /* File pointers to files where half round trip times (evaluated from | |
e96ed88f | 99 | * exchanges) histogram values are output. */ |
e072e1ab BP |
100 | FILE* hrttPoints; |
101 | ||
102 | struct Bins hrttBins; | |
66eaf2eb BP |
103 | } AnalysisHistogramEval; |
104 | ||
105 | typedef struct | |
106 | { | |
107 | // These are the cpu times of the first and last interactions (message or | |
108 | // broadcast) between two traces. The times are from the trace with the | |
109 | // lowest traceNum. | |
110 | uint64_t min, max; | |
111 | } Bounds; | |
112 | ||
113 | typedef struct | |
114 | { | |
115 | /* AnalysisHistogramEval* graphs[RttKey]; | |
116 | * For this table, saddr and daddr are swapped as necessary such that | |
117 | * saddr < daddr */ | |
118 | GHashTable* histograms; | |
119 | ||
120 | /* Bounds bounds[traceNum][traceNum] | |
121 | * | |
122 | * Only the lower triangular part of the matrix is allocated, that is | |
123 | * bounds[i][j] where i > j */ | |
124 | Bounds** bounds; | |
125 | ||
126 | #ifdef HAVE_LIBGLPK | |
127 | /* glp_prob* lps[traceNum][traceNum] | |
128 | * | |
129 | * Only the lower triangular part of the matrix is allocated, that is | |
130 | * lps[i][j] where i > j */ | |
131 | glp_prob*** lps; | |
132 | ||
133 | /* Factors lpFactors[traceNum][traceNum] | |
134 | * | |
135 | * Only the lower triangular part of the matrix is allocated, that is | |
136 | * lpFactorsArray[i][j] where i > j */ | |
137 | FactorsCHull** lpFactorsArray; | |
138 | #endif | |
139 | } AnalysisGraphsEval; | |
4ee223e5 | 140 | |
cdce23b3 BP |
141 | typedef struct |
142 | { | |
2bd4b3e4 | 143 | // double* rttInfo[RttKey] |
cdce23b3 BP |
144 | GHashTable* rttInfo; |
145 | ||
66eaf2eb BP |
146 | /* The convex hull analysis is encapsulated and messages are passed to it |
147 | * so that it builds the convex hulls. These are reused in the linear | |
148 | * program. */ | |
149 | struct _SyncState* chullSS; | |
150 | ||
cdce23b3 | 151 | AnalysisStatsEval* stats; |
66eaf2eb | 152 | AnalysisGraphsEval* graphs; |
cdce23b3 BP |
153 | } AnalysisDataEval; |
154 | ||
2f961b65 BP |
155 | void registerAnalysisEval(); |
156 | ||
cdce23b3 | 157 | #endif |