c1286d66a393727c68653246a5c07edce527ea01
1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2009, 2010 Benjamin Poirier <benjamin.poirier@polymtl.ca>
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.
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.
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/>.
18 #ifndef EVENT_ANALYSIS_CHULL_H
19 #define EVENT_ANALYSIS_CHULL_H
23 #include "data_structures.h"
36 /* allFactors is divided into three parts depending on the position of an
37 * element allFactors->pairFactors[i][j]:
38 * Lower triangular part of the matrix
40 * This contains the factors between nodes i and j. These factors
41 * convert the time values of j to time values of i.
42 * Diagonal part of the matrix
44 * This contains identity factors (a0= 0, a1= 1).
45 * Upper triangular part of the matrix
47 * These factors are absent
49 * Factor types are used as follows:
51 * Used for identity factors (a0= 0, a1= 1) that map a trace to itself. In
52 * this case, min, max and accuracy are not initialized.
55 * The approximation is the middle of the min and max limits.
58 * min and max are not available because the hulls do not respect
59 * assumptions (hulls should not intersect and the upper half-hull should
60 * be below the lower half-hull). The approximation is a "best effort".
61 * All fields are initialized but min and max are NULL.
64 * min or max is available but not both. The hulls respected assumptions
65 * but all receives took place after all sends or vice versa.
68 * The pair of trace did not have communications in both directions (maybe
69 * even no communication at all). Also used for factors in the upper
73 * min and max are not available because the algorithms are screwed. One
74 * of min or max (but not both) is NULL. The other is initialized.
76 AllFactors
* allFactors
;
82 /* This array contains file pointers to files where hull points x-y data
83 * is outputed. Each trace-pair has two files, one for each message
84 * direction. The structure of the array is the same as for hullArray,
85 * hullPoints[row][col] where:
89 * The elements on the diagonal are not initialized.
93 /* This is the same array as AnalysisStatsCHull.allFactors.
95 AllFactors
* allFactors
;
96 } AnalysisGraphsDataCHull
;
101 /* Point* hullArray[traceNb][traceNb][]
103 * A message comes from two traces. The lowest numbered trace is
104 * considered to be the reference clock, CA. The other is CB. The
105 * direction of messages (sent or received) is relative to CA. Points are
106 * formed such that their abscissa comes from CA and their ordinate from
109 * hullArray is divided into three parts depending on the position of an
110 * element hullArray[i][j]:
111 * Lower triangular part of the matrix
113 * This contains the points that form lower hulls, therefore that
114 * represent "sent" messages.
115 * Upper triangular part of the matrix
117 * This contains the points that form upper hulls, therefore that
118 * represent "received" messages.
119 * Diagonal part of the matrix
121 * This contains empty lists
123 * When a message is such that:
124 * inE->traceNum < outE->traceNum
125 * CA is inE->traceNum, therefore the message was received and may
126 * generate a point in the upper hull. Upper hulls are such that i <
127 * j, therefore, i= inE->traceNum and j= outE->traceNum.
128 * inE->traceNum > outE->traceNum
129 * CA is outE->traceNum, therefore the message was sent and may
130 * generate a point in the lower hull. Lower hulls are such that i >
131 * j, therefore, i= inE->traceNum and j= outE->traceNum. Hence, we
136 * Do not let yourself get confused! Always remember that the "lower hull"
137 * is in fact the "lower half" of a hull. When assumptions are respected,
138 * the lower half is above the upper half.
142 AnalysisStatsCHull
* stats
;
143 AnalysisGraphsDataCHull
* graphsData
;
146 void registerAnalysisCHull();
148 AllFactors
* calculateAllFactors(struct _SyncState
* const syncState
);
150 void calculateFactorsMiddle(PairFactors
* const factors
);
This page took 0.032233 seconds and 4 git commands to generate.