X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Finclude%2Fltt%2Fltt.h;h=ed86a5db8c394e5b5e89a535116ea56fbad546f5;hb=a5dcde2f975b43a9c6069c4a346528588bf1f8c8;hp=158553622fc02102be136bda10faf9ac8733f12c;hpb=f7afe191fd58f0bf4bab9c9514c261535b99d32b;p=lttv.git diff --git a/ltt/branches/poly/include/ltt/ltt.h b/ltt/branches/poly/include/ltt/ltt.h index 15855362..ed86a5db 100644 --- a/ltt/branches/poly/include/ltt/ltt.h +++ b/ltt/branches/poly/include/ltt/ltt.h @@ -1,7 +1,8 @@ #ifndef LTT_H #define LTT_H -#include +#include +#include /* 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 @@ -70,16 +71,11 @@ typedef unsigned long LttChecksum; /* 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 struct _TimeInterval{ LttTime startTime; @@ -87,9 +83,8 @@ typedef struct _TimeInterval{ } TimeInterval; -typedef uint64_t LttCycleCount; +typedef guint64 LttCycleCount; -#define NANSECOND_CONST 1000000000 /* Event positions are used to seek within a tracefile based on the block number and event position within the block. */ @@ -111,56 +106,10 @@ typedef enum _LttArchEndian { 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; \ - if((T2).tv_nsec < (T1).tv_nsec)\ - {\ - (T3).tv_sec--;\ - (T3).tv_nsec = NANSECOND_CONST - (T1).tv_nsec + (T2).tv_nsec;\ - }\ - else\ - {\ - (T3).tv_nsec = (T2).tv_nsec - (T1).tv_nsec;\ - }\ -} 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 >= NANSECOND_CONST)\ - {\ - (T3).tv_sec += (T3).tv_nsec / NANSECOND_CONST;\ - (T3).tv_nsec = (T3).tv_nsec % NANSECOND_CONST;\ - }\ -} 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 >= NANSECOND_CONST)\ - {\ - (T2).tv_sec += (T2).tv_nsec / NANSECOND_CONST;\ - (T2).tv_nsec = (T2).tv_nsec % NANSECOND_CONST;\ - }\ -} while(0) - - - - -#include +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