Fix live timer calculation error
[lttng-tools.git] / src / common / consumer-timer.c
index 02b7b3a49cd9ae81000a4e93c0f0d22b87d32b06..b35826cbba8ce82af8d47932832831819cbc6722 100644 (file)
@@ -438,7 +438,7 @@ void consumer_timer_switch_start(struct lttng_consumer_channel *channel,
        channel->switch_timer_enabled = 1;
 
        its.it_value.tv_sec = switch_timer_interval / 1000000;
-       its.it_value.tv_nsec = switch_timer_interval % 1000000;
+       its.it_value.tv_nsec = (switch_timer_interval % 1000000) * 1000;
        its.it_interval.tv_sec = its.it_value.tv_sec;
        its.it_interval.tv_nsec = its.it_value.tv_nsec;
 
@@ -495,7 +495,7 @@ void consumer_timer_live_start(struct lttng_consumer_channel *channel,
        channel->live_timer_enabled = 1;
 
        its.it_value.tv_sec = live_timer_interval / 1000000;
-       its.it_value.tv_nsec = live_timer_interval % 1000000;
+       its.it_value.tv_nsec = (live_timer_interval % 1000000) * 1000;
        its.it_interval.tv_sec = its.it_value.tv_sec;
        its.it_interval.tv_nsec = its.it_value.tv_nsec;
 
This page took 0.023926 seconds and 4 git commands to generate.