Generate graphs of synchronization accuracy
[lttv.git] / lttv / lttv / sync / event_analysis_eval.h
CommitLineData
cdce23b3
BP
1/* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2009 Benjamin Poirier <benjamin.poirier@polymtl.ca>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
16 * MA 02111-1307, USA.
17 */
18
19#ifndef EVENT_ANALYSIS_EVAL_H
20#define EVENT_ANALYSIS_EVAL_H
21
66eaf2eb
BP
22#ifdef HAVE_CONFIG_H
23#include <config.h>
24#endif
25
cdce23b3 26#include <glib.h>
66eaf2eb
BP
27#ifdef HAVE_LIBGLPK
28#include <glpk.h>
29#endif
cdce23b3
BP
30
31#include "data_structures.h"
32
33
d4721e1a
BP
34struct RttKey
35{
36 uint32_t saddr, daddr;
37};
38
cdce23b3
BP
39typedef struct
40{
41 unsigned int inversionNb,
42 tooFastNb,
76be6fc2
BP
43 noRTTInfoNb,
44 total;
45} MessageStats;
cdce23b3
BP
46
47typedef struct
48{
49 double broadcastDiffSum;
76be6fc2
BP
50 unsigned int broadcastNb;
51
e072e1ab 52 // MessageStats messageStats[traceNb][traceNb]
76be6fc2 53 MessageStats** messageStats;
e072e1ab 54
d4721e1a
BP
55 /* double* exchangeRtt[RttKey]
56 * For this table, saddr and daddr are swapped as necessary such that
57 * saddr < daddr */
58 GHashTable* exchangeRtt;
cdce23b3 59
66eaf2eb
BP
60#ifdef HAVE_LIBGLPK
61 /* FactorsCHull** chFactorsArray[traceNum][traceNum]
62 * FactorsCHull** lpFactorsArray[traceNum][traceNum]
63 *
64 * As usual, only the lower triangular part of theses matrixes is
65 * allocated */
66 FactorsCHull** chFactorsArray;
67 FactorsCHull** lpFactorsArray;
68#endif
69} AnalysisStatsEval;
e072e1ab
BP
70
71#define BIN_NB 1001
72struct Bins
73{
74 // index of min and max bins that are != 0
75 uint32_t min, max;
76 // sum of all bins
77 uint32_t total;
78 /* bin[0]: underflow ]-INFINITY..0[
79 * bin[1]: [0..1e-6[
80 * rest defined exponentially, see binStart()
81 * bin[BIN_NB - 1]: overflow [1..INFINITY[ */
82 uint32_t bin[BIN_NB];
83};
84
4ee223e5
BP
85typedef struct
86{
e072e1ab 87 /* File pointers to files where "trip times" (message latency) histogram
e96ed88f
BP
88 * values are output. Each host-pair has two files, one for each message
89 * direction. As for traces, the host with the smallest address is
90 * considered to be the reference for the direction of messages (ie.
e072e1ab
BP
91 * messages from the host with the lowest address to the host with the
92 * largest address are "sent"). */
93 FILE* ttSendPoints;
94 FILE* ttRecvPoints;
95
96 struct Bins ttSendBins;
97 struct Bins ttRecvBins;
98
99 /* File pointers to files where half round trip times (evaluated from
e96ed88f 100 * exchanges) histogram values are output. */
e072e1ab
BP
101 FILE* hrttPoints;
102
103 struct Bins hrttBins;
66eaf2eb
BP
104} AnalysisHistogramEval;
105
106typedef struct
107{
108 // These are the cpu times of the first and last interactions (message or
109 // broadcast) between two traces. The times are from the trace with the
110 // lowest traceNum.
111 uint64_t min, max;
112} Bounds;
113
114typedef struct
115{
116 /* AnalysisHistogramEval* graphs[RttKey];
117 * For this table, saddr and daddr are swapped as necessary such that
118 * saddr < daddr */
119 GHashTable* histograms;
120
121 /* Bounds bounds[traceNum][traceNum]
122 *
123 * Only the lower triangular part of the matrix is allocated, that is
124 * bounds[i][j] where i > j */
125 Bounds** bounds;
126
127#ifdef HAVE_LIBGLPK
128 /* glp_prob* lps[traceNum][traceNum]
129 *
130 * Only the lower triangular part of the matrix is allocated, that is
131 * lps[i][j] where i > j */
132 glp_prob*** lps;
133
134 /* Factors lpFactors[traceNum][traceNum]
135 *
136 * Only the lower triangular part of the matrix is allocated, that is
137 * lpFactorsArray[i][j] where i > j */
138 FactorsCHull** lpFactorsArray;
139#endif
140} AnalysisGraphsEval;
4ee223e5 141
cdce23b3
BP
142typedef struct
143{
2bd4b3e4 144 // double* rttInfo[RttKey]
cdce23b3
BP
145 GHashTable* rttInfo;
146
66eaf2eb
BP
147 /* The convex hull analysis is encapsulated and messages are passed to it
148 * so that it builds the convex hulls. These are reused in the linear
149 * program. */
150 struct _SyncState* chullSS;
151
cdce23b3 152 AnalysisStatsEval* stats;
66eaf2eb 153 AnalysisGraphsEval* graphs;
cdce23b3
BP
154} AnalysisDataEval;
155
156#endif
This page took 0.028585 seconds and 4 git commands to generate.