Calculate synchronization accuracy within the chull module
[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
27 #include "data_structures.h"
28
29
30 struct RttKey
31 {
32 uint32_t saddr, daddr;
33 };
34
35 typedef struct
36 {
37 unsigned int inversionNb,
38 tooFastNb,
39 noRTTInfoNb,
40 total;
41 } MessageStats;
42
43 typedef struct
44 {
45 unsigned int broadcastNb;
46 double broadcastStdevSum;
47
48 unsigned int broadcastPairNb;
49 double broadcastRangeMin;
50 double broadcastRangeMax;
51 double broadcastSum;
52 double broadcastSumSquares;
53
54 // MessageStats messageStats[traceNb][traceNb]
55 MessageStats** messageStats;
56
57 /* double* exchangeRtt[RttKey]
58 * For this table, saddr and daddr are swapped as necessary such that
59 * saddr < daddr */
60 GHashTable* exchangeRtt;
61 } AnalysisStatsEval;
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
77 typedef struct
78 {
79 /* File pointers to files where "trip times" (message latency) histogram
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.
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
92 * exchanges) histogram values are output. */
93 FILE* hrttPoints;
94
95 struct Bins hrttBins;
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;
118 } AnalysisGraphsEval;
119
120 typedef struct
121 {
122 // double* rttInfo[RttKey]
123 GHashTable* rttInfo;
124
125 AnalysisStatsEval* stats;
126 AnalysisGraphsEval* graphs;
127 } AnalysisDataEval;
128
129 void registerAnalysisEval();
130
131 #endif
This page took 0.033144 seconds and 4 git commands to generate.