Skip to content

Commit 5f4b349

Browse files
committed
Add lua debug logging
1 parent 339c7ea commit 5f4b349

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

backends/lua.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static uint32_t lua_interval(){
6464
next_timer = timer[n].interval - timer[n].delta;
6565
}
6666
}
67+
DBGPF("Next timer fires in %" PRIu32, next_timer);
6768
return next_timer;
6869
}
6970
return 1000;
@@ -85,6 +86,7 @@ static int lua_update_timerfd(){
8586
interval = timer[n].interval;
8687
}
8788
}
89+
DBGPF("Recalculating timers, minimum is %" PRIu64, interval);
8890

8991
//calculate gcd of all timers if any are active
9092
if(interval){
@@ -111,11 +113,13 @@ static int lua_update_timerfd(){
111113
}
112114

113115
if(interval == timer_interval){
116+
DBGPF("Keeping interval at %" PRIu64, interval);
114117
return 0;
115118
}
116119

117120
#ifdef MMBACKEND_LUA_TIMERFD
118-
//configure the new interval
121+
//configure the new interval, 0.0 disarms the timer
122+
DBGPF("Reconfiguring timerfd to %" PRIu64 ".%" PRIu64, timer_config.it_interval.tv_sec, timer_config.it_interval.tv_nsec);
119123
timerfd_settime(timer_fd, 0, &timer_config, NULL);
120124
#endif
121125
timer_interval = interval;

0 commit comments

Comments
 (0)