[CRIU] Re: [PATCH] uptime_grow: allow for 0 timer growth
Evgeny Antyshev
eantyshev at parallels.com
Tue Jun 26 11:04:08 EDT 2012
resent, fixed
On 26.06.2012 16:43, Pavel Emelyanov wrote:
> 1. Put some sign that this patch is for zdtm/criu in the Subject
> 2. Put the Signed-off-by: line in the letter body
>
> Thanks,
> Pavel
>
> On 06/26/2012 04:40 PM, Evgeny Antyshev wrote:
>> It may occur that the loop spins faster than clock ticks.
>> ---
>> test/zdtm/live/static/uptime_grow.c | 6 +++---
>> 1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/test/zdtm/live/static/uptime_grow.c b/test/zdtm/live/static/uptime_grow.c
>> index c5eff51..1f3dba3 100644
>> --- a/test/zdtm/live/static/uptime_grow.c
>> +++ b/test/zdtm/live/static/uptime_grow.c
>> @@ -6,9 +6,9 @@ const char *test_author = "Evgeny Antysev <eantyshev at parallels.com>";
>> #include <time.h>
>> #include <stdlib.h>
>>
>> -# define tv_gt(a, b) \
>> +# define tv_ge(a, b) \
>> (((a)->tv_sec == (b)->tv_sec) ? \
>> - ((a)->tv_nsec > (b)->tv_nsec) : \
>> + ((a)->tv_nsec >= (b)->tv_nsec) : \
>> ((a)->tv_sec > (b)->tv_sec))
>>
>> int main(int argc, char **argv)
>> @@ -29,7 +29,7 @@ int main(int argc, char **argv)
>> err("clock_gettime failed: %m\n");
>> exit(1);
>> }
>> - if (!tv_gt(&tm, &tm_old)) {
>> + if (!tv_ge(&tm, &tm_old)) {
>> diff_nsec = (tm_old.tv_sec - tm.tv_sec) * 1.0E9 +\
>> (tm_old.tv_nsec - tm.tv_nsec);
>> fail("clock step backward for %e nsec\n", diff_nsec);
--
Best regards,
Evgeny Antyshev.
More information about the CRIU
mailing list