dbd4ac954e870a63e4eaa3c31560f73ceedadaf3
[lttv.git] / lttv / lttv / sync / event_analysis_eval.h
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 EVENT_ANALYSIS_EVAL_H
19 #define EVENT_ANALYSIS_EVAL_H
20
21 #ifdef HAVE_CONFIG_H
22 #include <config.h>
23 #endif
24
25 #include <glib.h>
26 #ifdef HAVE_LIBGLPK
27 #include <glpk.h>
28 #endif
29
30 #include "data_structures.h"
31
32
33 struct RttKey
34 {
35 uint32_t saddr, daddr;
36 };
37
38 typedef struct
39 {
40 unsigned int inversionNb,
41 tooFastNb,
42 noRTTInfoNb,
43 total;
44 } MessageStats;
45
46 typedef struct
47 {
48 unsigned int broadcastNb;
49 double broadcastStdevSum;
50
51 unsigned int broadcastPairNb;
52 double broadcastRangeMin;
53 double broadcastRangeMax;
54 double broadcastSum;
55 double broadcastSumSquares;
56
57 // MessageStats messageStats[traceNb][traceNb]
58 MessageStats** messageStats;
59
60 /* double* exchangeRtt[RttKey]
61 * For this table, saddr and daddr are swapped as necessary such that
62 * saddr < daddr */
63 GHashTable* exchangeRtt;
64
65 #ifdef HAVE_LIBGLPK
66 // Only the lower triangular part of theses matrixes is used
67 AllFactors* chFactorsArray;
68 AllFactors* lpFactorsArray;
69 #endif
70 } AnalysisStatsEval;
71
72 #define BIN_NB 1001
73 struct Bins
74 {
75 // index of min and max bins that are != 0
76 uint32_t min, max;
77 // sum of all bins
78 uint32_t total;
79 /* bin[0]: underflow ]-INFINITY..0[
80 * bin[1]: [0..1e-6[
81 * rest defined exponentially, see binStart()
82 * bin[BIN_NB - 1]: overflow [1..INFINITY[ */
83 uint32_t bin[BIN_NB];
84 };
85
86 typedef struct
87 {
88 /* File pointers to files where "trip times" (message latency) histogram
89 * values are output. Each host-pair has two files, one for each message
90 * direction. As for traces, the host with the smallest address is
91 * considered to be the reference for the direction of messages (ie.
92 * messages from the host with the lowest address to the host with the
93 * largest address are "sent"). */
94 FILE* ttSendPoints;
95 FILE* ttRecvPoints;
96
97 struct Bins ttSendBins;
98 struct Bins ttRecvBins;
99
100 /* File pointers to files where half round trip times (evaluated from
101 * exchanges) histogram values are output. */
102 FILE* hrttPoints;
103
104 struct Bins hrttBins;
105 } AnalysisHistogramEval;
106
107 typedef struct
108 {
109 // These are the cpu times of the first and last interactions (message or
110 // broadcast) between two traces. The times are from the trace with the
111 // lowest traceNum.
112 uint64_t min, max;
113 } Bounds;
114
115 typedef struct
116 {
117 /* AnalysisHistogramEval* graphs[RttKey];
118 * For this table, saddr and daddr are swapped as necessary such that
119 * saddr < daddr */
120 GHashTable* histograms;
121
122 /* Bounds bounds[traceNum][traceNum]
123 *
124 * Only the lower triangular part of the matrix is allocated, that is
125 * bounds[i][j] where i > j */
126 Bounds** bounds;
127
128 #ifdef HAVE_LIBGLPK
129 /* glp_prob* lps[traceNum][traceNum]
130 *
131 * Only the lower triangular part of the matrix is allocated, that is
132 * lps[i][j] where i > j */
133 glp_prob*** lps;
134
135 /* Only the lower triangular part of the matrix is allocated, that is
136 * lpFactorsArray[i][j] where i > j */
137 AllFactors* lpFactorsArray;
138 #endif
139 } AnalysisGraphsEval;
140
141 typedef struct
142 {
143 // double* rttInfo[RttKey]
144 GHashTable* rttInfo;
145
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
151 AnalysisStatsEval* stats;
152 AnalysisGraphsEval* graphs;
153 } AnalysisDataEval;
154
155 void registerAnalysisEval();
156
157 #endif
This page took 0.032067 seconds and 3 git commands to generate.