X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=inline;f=ltt%2Fbranches%2Fpoly%2Finclude%2Fltt%2Fltt.h;h=fc00a14d78888728966de71933f30437c0496674;hb=fc17f7eb70be2555a6b1cf4444dd75a9058adfeb;hp=d177e946d331e6b61c552efd230eb0f8e06df912;hpb=2a9b7ad116b80ee1eb2a316c62b46a969822a26e;p=lttv.git diff --git a/ltt/branches/poly/include/ltt/ltt.h b/ltt/branches/poly/include/ltt/ltt.h index d177e946..fc00a14d 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 += (T3).tv_nsec / 1000000000;\ + (T2).tv_nsec = (T3).tv_nsec % 1000000000;\ + }\ +} while(0) + + #include