Change synchronization code license to LGPLv2.1
[lttv.git] / lttv / lttv / sync / event_analysis_chull.h
index ed4284d880892dda5a63c2b09ab114256134e042..c96dcae279febd808d05c11baaad8d937f77c792 100644 (file)
@@ -1,19 +1,18 @@
 /* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2009 Benjamin Poirier <benjamin.poirier@polymtl.ca>
+ * Copyright (C) 2009, 2010 Benjamin Poirier <benjamin.poirier@polymtl.ca>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 2.1 of the License, or (at
+ * your option) any later version.
  *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef EVENT_ANALYSIS_CHULL_H
 
 #include <glib.h>
 
-#include "data_structures_tcp.h"
+#include "data_structures.h"
 
 
 typedef struct
 {
-       LttCycleCount x, y;
+       uint64_t x, y;
 } Point;
 
 
 typedef enum
 {
+       EXACT,
        /* Used for identity factors (a0= 0, a1= 1) that map a trace to itself. In
         * this case, min, max and accuracy are not initialized.
         */
-       EXACT,
+
+       MIDDLE,
        /* The approximation is the middle of the min and max limits, all fields
         * are initialized.
         */
-       MIDDLE,
+
+       FALLBACK,
        /* min and max are not available because the hulls do not respect
         * assumptions (hulls should not intersect and the upper half-hull should
         * be below the lower half-hull). The approximation is a "best effort".
         * All fields are initialized but min and max are NULL.
         */
-       FALLBACK,
+
+       INCOMPLETE,
        /* min or max is available but not both. The hulls respected assumptions
         * but all receives took place after all sends or vice versa. approx and
         * accuracy are not initialized.
         */
-       INCOMPLETE,
+
+       ABSENT,
        /* The pair of trace did not have communications in both directions (maybe
         * even no communication at all). approx and accuracy are not initialized.
         */
-       ABSENT,
+
+       SCREWED,
        /* min and max are not available because the algorithms are screwed. One
         * of min or max (but not both) is NULL. The other is initialized. Approx
         * is not initialized.
         */
-       SCREWED,
+
+       APPROX_NB, // This must be the last member
 } ApproxType;
 
+extern const char* const approxNames[APPROX_NB];
 
 typedef struct
 {
@@ -116,7 +123,7 @@ typedef struct
 
 typedef struct
 {
-       /* Point hullArray[traceNb][traceNb][]
+       /* Point* hullArray[traceNb][traceNb][]
         *
         * A message comes from two traces. The lowest numbered trace is
         * considered to be the reference clock, CA. The other is CB. The
@@ -161,4 +168,13 @@ typedef struct
        AnalysisGraphsDataCHull* graphsData;
 } AnalysisDataCHull;
 
+void registerAnalysisCHull();
+
+FactorsCHull** calculateAllFactors(struct _SyncState* const syncState);
+void freeAllFactors(const unsigned int traceNb, FactorsCHull** const
+       allFactors);
+
+void calculateFactorsMiddle(FactorsCHull* const factors);
+void destroyFactorsCHull(FactorsCHull* factorsCHull);
+
 #endif
This page took 0.024589 seconds and 4 git commands to generate.