1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2009 Benjamin Poirier <benjamin.poirier@polymtl.ca>
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;
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.
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,
19 #ifndef EVENT_ANALYSIS_CHULL_H
20 #define EVENT_ANALYSIS_CHULL_H
24 #include "data_structures.h"
36 /* Used for identity factors (a0= 0, a1= 1) that map a trace to itself. In
37 * this case, min, max and accuracy are not initialized.
41 /* The approximation is the middle of the min and max limits, all fields
46 /* min and max are not available because the hulls do not respect
47 * assumptions (hulls should not intersect and the upper half-hull should
48 * be below the lower half-hull). The approximation is a "best effort".
49 * All fields are initialized but min and max are NULL.
53 /* min or max is available but not both. The hulls respected assumptions
54 * but all receives took place after all sends or vice versa. approx and
55 * accuracy are not initialized.
59 /* The pair of trace did not have communications in both directions (maybe
60 * even no communication at all). approx and accuracy are not initialized.
64 /* min and max are not available because the algorithms are screwed. One
65 * of min or max (but not both) is NULL. The other is initialized. Approx
69 APPROX_NB
, // This must be the last member
72 extern const char* const approxNames
[APPROX_NB
];
76 Factors
* min
, * max
, * approx
;
86 /* FactorsCHull allFactors[traceNb][traceNb]
88 * allFactors is divided into three parts depending on the position of an
89 * element allFactors[i][j]:
90 * Lower triangular part of the matrix
92 * This contains the factors between nodes i and j. These factors
93 * convert the time values of j to time values of i.
94 * Diagonal part of the matrix
96 * This contains identity factors (a0= 0, a1= 1).
97 * Upper triangular part of the matrix
99 * This area is not allocated.
101 FactorsCHull
** allFactors
;
102 } AnalysisStatsCHull
;
107 /* This array contains file pointers to files where hull points x-y data
108 * is outputed. Each trace-pair has two files, one for each message
109 * direction. The structure of the array is the same as for hullArray,
110 * hullPoints[row][col] where:
112 * col= outE->traceNum
114 * The elements on the diagonal are not initialized.
118 /* FactorsCHull allFactors[traceNb][traceNb]
119 * This is the same array as AnalysisStatsCHull.allFactors.
121 FactorsCHull
** allFactors
;
122 } AnalysisGraphsDataCHull
;
127 /* Point* hullArray[traceNb][traceNb][]
129 * A message comes from two traces. The lowest numbered trace is
130 * considered to be the reference clock, CA. The other is CB. The
131 * direction of messages (sent or received) is relative to CA. Points are
132 * formed such that their abscissa comes from CA and their ordinate from
135 * hullArray is divided into three parts depending on the position of an
136 * element hullArray[i][j]:
137 * Lower triangular part of the matrix
139 * This contains the points that form lower hulls, therefore that
140 * represent "sent" messages.
141 * Upper triangular part of the matrix
143 * This contains the points that form upper hulls, therefore that
144 * represent "received" messages.
145 * Diagonal part of the matrix
147 * This contains empty lists
149 * When a message is such that:
150 * inE->traceNum < outE->traceNum
151 * CA is inE->traceNum, therefore the message was received and may
152 * generate a point in the upper hull. Upper hulls are such that i <
153 * j, therefore, i= inE->traceNum and j= outE->traceNum.
154 * inE->traceNum > outE->traceNum
155 * CA is outE->traceNum, therefore the message was sent and may
156 * generate a point in the lower hull. Lower hulls are such that i >
157 * j, therefore, i= inE->traceNum and j= outE->traceNum. Hence, we
162 * Do not let yourself get confused! Always remember that the "lower hull"
163 * is in fact the "lower half" of a hull. When assumptions are respected,
164 * the lower half is above the upper half.
168 AnalysisStatsCHull
* stats
;
169 AnalysisGraphsDataCHull
* graphsData
;
173 FactorsCHull
** calculateAllFactors(struct _SyncState
* const syncState
);
174 void freeAllFactors(const unsigned int traceNb
, FactorsCHull
** const
177 void calculateFactorsMiddle(FactorsCHull
* const factors
);
178 void destroyFactorsCHull(FactorsCHull
* factorsCHull
);
This page took 0.033143 seconds and 4 git commands to generate.