diff --git a/base/src/timer_event_handler.cpp b/base/src/timer_event_handler.cpp index 75e7d41156ff045b9b3776ef38d9aac775c161e4..be6c1ab17210e3f0e788a616635c0d62650deeff 100644 --- a/base/src/timer_event_handler.cpp +++ b/base/src/timer_event_handler.cpp @@ -98,8 +98,17 @@ void TimerEventHandler::TimeOut() uint64_t expirations = 0; ssize_t n = ::read(GetHandle(), &expirations, sizeof(expirations)); if (n != sizeof(expirations)) { - UTILS_LOGE("epoll_loop::on_timer() reads %{public}d bytes instead of 8, errno=%{public}d", static_cast(n), - errno); + int erronRead = errno; + struct itimerspec current = { + .it_interval = {.tv_sec = -1, .tv_nsec = -1}, + .it_value = {.tv_sec = -1, .tv_nsec = -1} + }; + if (timerfd_gettime(GetHandle(), ¤t) == -1) { + UTILS_LOGE("timerfd_gettime failed, errno=%{public}d", errno); + } + UTILS_LOGE("epoll_loop::on_timer() reads %{public}d bytes instead of 8, timerFd=%{public}d, errno=%{public}d, " + "Current timer value: %{public}lld sec, %{public}ld nsec", static_cast(n), GetHandle(), + erronRead, current.it_value.tv_sec, current.it_value.tv_nsec); } if (callback_) { callback_(GetHandle());