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