X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Finclude%2Fltt%2Fltt.h;h=17303a08922b1ef52ceabae27854f0a8ac786968;hb=02007847f865c0d2f50979b5ceecbdeec5ef7b97;hp=7c347414926d7804d2119128b646c2a89924124b;hpb=290dfc8c6f0882260a7a1c39b87873016d678d0b;p=lttv.git diff --git a/ltt/branches/poly/include/ltt/ltt.h b/ltt/branches/poly/include/ltt/ltt.h index 7c347414..17303a08 100644 --- a/ltt/branches/poly/include/ltt/ltt.h +++ b/ltt/branches/poly/include/ltt/ltt.h @@ -61,6 +61,7 @@ typedef struct _LttField LttField; typedef struct _LttEvent LttEvent; +typedef struct _LttSystemDescription LttSystemDescription; /* Checksums are used to differentiate facilities which have the same name but differ. */ @@ -93,6 +94,33 @@ 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; \ + (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) + #include