X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Finclude%2Fltt%2Fltt.h;h=1da397f365d7f8e816fa87a363fd242008139764;hb=01a5c7e14a0f0fe5ad4a1256376252bcb53808a7;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..1da397f3 100644 --- a/ltt/branches/poly/include/ltt/ltt.h +++ b/ltt/branches/poly/include/ltt/ltt.h @@ -124,6 +124,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