Skip to content

Commit 04548ea

Browse files
committed
Add log in epoll
Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
1 parent 1ffc5d9 commit 04548ea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/epoll/epoll.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import (
2020
"errors"
2121
"os"
2222
"syscall"
23+
24+
"k8s.io/klog"
2325
)
2426

2527
const (
@@ -189,6 +191,7 @@ func (e *Epoll) dispatchEvent(ev *syscall.EpollEvent) {
189191
if !ok {
190192
return
191193
}
194+
klog.V(4).Infof("epoll event for file %s dispatched", w.FileName)
192195

193196
e.eventChan <- Event{
194197
fileName: w.FileName,
@@ -200,7 +203,9 @@ func (e *Epoll) listen() {
200203
events := make([]syscall.EpollEvent, 2)
201204
for e.active {
202205
// TODO: Handle errors here
206+
klog.Info("waiting for epoll events...")
203207
count, _ := syscall.EpollWait(e.epfd, events, timeout)
208+
klog.Infof("received %d events from epoll. dispatching...", count)
204209
for i := 0; e.active && i < count; i++ {
205210
e.dispatchEvent(&events[i])
206211
}

0 commit comments

Comments
 (0)