+/* This file is part of the Linux Trace Toolkit trace reading library
+ * Copyright (C) 2003-2004 Michel Dagenais
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License Version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
#ifndef LTT_H
#define LTT_H
-#include <ltt/LTTTypes.h>
+#include <ltt/time.h>
+#include <glib.h>
/* A trace is associated with a tracing session run on a single, possibly
multi-cpu, system. It is defined as a pathname to a directory containing
/* Events are usually stored with the easily obtained CPU clock cycle count,
- ltt_cycle_count. This can be converted to the real time value, ltt_time,
+ ltt_cycle_count. This can be converted to the real time value, LttTime,
using linear interpolation between regularly sampled values (e.g. a few
times per second) of the real time clock with their corresponding
cycle count values. */
-typedef struct _LttTime {
- unsigned long tv_sec;
- unsigned long tv_nsec;
-} LttTime;
-typedef uint64_t LttCycleCount;
+typedef struct _TimeInterval{
+ LttTime startTime;
+ LttTime endTime;
+} TimeInterval;
+
+
+typedef guint64 LttCycleCount;
+
+
+/* Event positions are used to seek within a tracefile based on
+ the block number and event position within the block. */
+
+typedef struct _LttEventPosition LttEventPosition;
/* Differences between architectures include word sizes, endianess,
{ LTT_LITTLE_ENDIAN, LTT_BIG_ENDIAN
} LttArchEndian;
-/* Time operation macros for LttTime (struct timespec) */
-/* (T3 = T2 - T1) */
-#define TimeSub(T3, T2, T1) \
-do \
-{\
- (T3).tv_sec = (T2).tv_sec - (T1).tv_sec; \
- (T3).tv_nsec = (T2).tv_nsec - (T1).tv_nsec; \
- if((T3).tv_nsec < 0)\
- {\
- (T3).tv_sec--;\
- (T3).tv_nsec += 1000000000;\
- }\
-} while(0)
-
-/* (T3 = T2 + T1) */
-#define TimeAdd(T3, T2, T1) \
-do \
-{\
- (T3).tv_sec = (T2).tv_sec + (T1).tv_sec; \
- (T3).tv_nsec = (T2).tv_nsec + (T1).tv_nsec; \
- if((T3).tv_nsec >= 1000000000)\
- {\
- (T3).tv_sec += (T3).tv_nsec / 1000000000;\
- (T3).tv_nsec = (T3).tv_nsec % 1000000000;\
- }\
-} while(0)
-
-/* (T2 = T1 * FLOAT) */
-/* WARNING : use this multiplicator carefully : on 32 bits, multiplying
- * by more than 4 could overflow the tv_nsec.
- */
-#define TimeMul(T2, T1, FLOAT) \
-do \
-{\
- (T2).tv_sec = (T1).tv_sec * (FLOAT); \
- (T2).tv_nsec = (T1).tv_nsec * (FLOAT); \
- if((T2).tv_nsec >= 1000000000)\
- {\
- (T2).tv_sec += (T3).tv_nsec / 1000000000;\
- (T2).tv_nsec = (T3).tv_nsec % 1000000000;\
- }\
-} while(0)
-
-
-
-
-#include <ltt/ltt-private.h>
+typedef enum _LttTypeEnum
+{ LTT_INT, LTT_UINT, LTT_FLOAT, LTT_STRING, LTT_ENUM, LTT_ARRAY,
+ LTT_SEQUENCE, LTT_STRUCT, LTT_UNION
+} LttTypeEnum;
#endif // LTT_H