Calculate synchronization accuracy within the chull module
[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
BP
25#include <glib.h>
26
27#include "data_structures.h"
28
29
d4721e1a
BP
30struct RttKey
31{
32 uint32_t saddr, daddr;
33};
34
cdce23b3
BP
35typedef struct
36{
37 unsigned int inversionNb,
38 tooFastNb,
76be6fc2
BP
39 noRTTInfoNb,
40 total;
41} MessageStats;
cdce23b3
BP
42
43typedef 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
64struct 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
77typedef 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
98typedef 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
106typedef 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;
66eaf2eb 118} AnalysisGraphsEval;
4ee223e5 119
cdce23b3
BP
120typedef struct
121{
2bd4b3e4 122 // double* rttInfo[RttKey]
cdce23b3
BP
123 GHashTable* rttInfo;
124
125 AnalysisStatsEval* stats;
66eaf2eb 126 AnalysisGraphsEval* graphs;
cdce23b3
BP
127} AnalysisDataEval;
128
2f961b65
BP
129void registerAnalysisEval();
130
cdce23b3 131#endif
This page took 0.030328 seconds and 4 git commands to generate.