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 BP |
25 | #include <glib.h> |
26 | ||
27 | #include "data_structures.h" | |
28 | ||
29 | ||
d4721e1a BP |
30 | struct RttKey |
31 | { | |
32 | uint32_t saddr, daddr; | |
33 | }; | |
34 | ||
cdce23b3 BP |
35 | typedef struct |
36 | { | |
37 | unsigned int inversionNb, | |
38 | tooFastNb, | |
76be6fc2 BP |
39 | noRTTInfoNb, |
40 | total; | |
41 | } MessageStats; | |
cdce23b3 BP |
42 | |
43 | typedef struct | |
44 | { | |
76be6fc2 | 45 | unsigned int broadcastNb; |
2849af52 BP |
46 | double broadcastStdevSum; |
47 | ||
48 | unsigned int broadcastPairNb; | |
49 | double broadcastRangeMin; | |
50 | double broadcastRangeMax; | |
51 | double broadcastSum; | |
52 | double broadcastSumSquares; | |
76be6fc2 | 53 | |
e072e1ab | 54 | // MessageStats messageStats[traceNb][traceNb] |
76be6fc2 | 55 | MessageStats** messageStats; |
e072e1ab | 56 | |
d4721e1a BP |
57 | /* double* exchangeRtt[RttKey] |
58 | * For this table, saddr and daddr are swapped as necessary such that | |
59 | * saddr < daddr */ | |
60 | GHashTable* exchangeRtt; | |
66eaf2eb | 61 | } AnalysisStatsEval; |
e072e1ab BP |
62 | |
63 | #define BIN_NB 1001 | |
64 | struct Bins | |
65 | { | |
66 | // index of min and max bins that are != 0 | |
67 | uint32_t min, max; | |
68 | // sum of all bins | |
69 | uint32_t total; | |
70 | /* bin[0]: underflow ]-INFINITY..0[ | |
71 | * bin[1]: [0..1e-6[ | |
72 | * rest defined exponentially, see binStart() | |
73 | * bin[BIN_NB - 1]: overflow [1..INFINITY[ */ | |
74 | uint32_t bin[BIN_NB]; | |
75 | }; | |
76 | ||
4ee223e5 BP |
77 | typedef struct |
78 | { | |
e072e1ab | 79 | /* File pointers to files where "trip times" (message latency) histogram |
e96ed88f BP |
80 | * values are output. Each host-pair has two files, one for each message |
81 | * direction. As for traces, the host with the smallest address is | |
82 | * considered to be the reference for the direction of messages (ie. | |
e072e1ab BP |
83 | * messages from the host with the lowest address to the host with the |
84 | * largest address are "sent"). */ | |
85 | FILE* ttSendPoints; | |
86 | FILE* ttRecvPoints; | |
87 | ||
88 | struct Bins ttSendBins; | |
89 | struct Bins ttRecvBins; | |
90 | ||
91 | /* File pointers to files where half round trip times (evaluated from | |
e96ed88f | 92 | * exchanges) histogram values are output. */ |
e072e1ab BP |
93 | FILE* hrttPoints; |
94 | ||
95 | struct Bins hrttBins; | |
66eaf2eb BP |
96 | } AnalysisHistogramEval; |
97 | ||
98 | typedef struct | |
99 | { | |
100 | // These are the cpu times of the first and last interactions (message or | |
101 | // broadcast) between two traces. The times are from the trace with the | |
102 | // lowest traceNum. | |
103 | uint64_t min, max; | |
104 | } Bounds; | |
105 | ||
106 | typedef struct | |
107 | { | |
108 | /* AnalysisHistogramEval* graphs[RttKey]; | |
109 | * For this table, saddr and daddr are swapped as necessary such that | |
110 | * saddr < daddr */ | |
111 | GHashTable* histograms; | |
112 | ||
113 | /* Bounds bounds[traceNum][traceNum] | |
114 | * | |
115 | * Only the lower triangular part of the matrix is allocated, that is | |
116 | * bounds[i][j] where i > j */ | |
117 | Bounds** bounds; | |
e2793cfa BP |
118 | |
119 | // Extra SyncState used to overlay the chull-calculated accuracy region | |
120 | SyncState* chullSS; | |
66eaf2eb | 121 | } AnalysisGraphsEval; |
4ee223e5 | 122 | |
cdce23b3 BP |
123 | typedef struct |
124 | { | |
2bd4b3e4 | 125 | // double* rttInfo[RttKey] |
cdce23b3 BP |
126 | GHashTable* rttInfo; |
127 | ||
128 | AnalysisStatsEval* stats; | |
66eaf2eb | 129 | AnalysisGraphsEval* graphs; |
cdce23b3 BP |
130 | } AnalysisDataEval; |
131 | ||
2f961b65 BP |
132 | void registerAnalysisEval(); |
133 | ||
cdce23b3 | 134 | #endif |