X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Finclude%2Fltt%2Fltt.h;h=296c82218b3462e27fd6407c80f29aee464ab997;hb=80da81adfa88158bd3d4c26f89f96f8b58c77b4f;hp=d177e946d331e6b61c552efd230eb0f8e06df912;hpb=5fb21f61ee24f176205d0bd798564d8137e2ce60;p=lttv.git diff --git a/ltt/branches/poly/include/ltt/ltt.h b/ltt/branches/poly/include/ltt/ltt.h index d177e946..296c8221 100644 --- a/ltt/branches/poly/include/ltt/ltt.h +++ b/ltt/branches/poly/include/ltt/ltt.h @@ -82,6 +82,11 @@ typedef struct _LttTime { typedef uint64_t 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, alignment, floating point format and calling conventions. For a @@ -124,6 +129,23 @@ do \ }\ } 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 += (T2).tv_nsec / 1000000000;\ + (T2).tv_nsec = (T2).tv_nsec % 1000000000;\ + }\ +} while(0) + + #include