From 1ad9477da37b8aa92459c75ee22c9841075baaf0 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 11 Apr 2017 16:15:19 +0000 Subject: [PATCH] More debug --- src/core/lib/iomgr/ev_epollex_linux.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/core/lib/iomgr/ev_epollex_linux.c b/src/core/lib/iomgr/ev_epollex_linux.c index 4c35dab0c3e..35e4e0543f3 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.c +++ b/src/core/lib/iomgr/ev_epollex_linux.c @@ -530,20 +530,38 @@ static grpc_error *pollset_kick(grpc_pollset *p, if (specific_worker == NULL) { if (gpr_tls_get(&g_current_thread_pollset) != (intptr_t)p) { if (p->num_pollers == 0) { + if (grpc_polling_trace) { + gpr_log(GPR_DEBUG, "PS:%p kicked_without_poller", p); + } p->kicked_without_poller = true; return GRPC_ERROR_NONE; } else { + if (grpc_polling_trace) { + gpr_log(GPR_DEBUG, "PS:%p kicked_via_wakeup_fd", p); + } return grpc_wakeup_fd_wakeup(&p->pollset_wakeup); } } else { + if (grpc_polling_trace) { + gpr_log(GPR_DEBUG, "PS:%p kicked_but_awake", p); + } return GRPC_ERROR_NONE; } } else if (gpr_tls_get(&g_current_thread_worker) == (intptr_t)specific_worker) { + if (grpc_polling_trace) { + gpr_log(GPR_DEBUG, "PS:%p kicked_but_awake", p); + } return GRPC_ERROR_NONE; } else if (specific_worker == p->root_worker) { + if (grpc_polling_trace) { + gpr_log(GPR_DEBUG, "PS:%p kicked_via_wakeup_fd", p); + } return grpc_wakeup_fd_wakeup(&p->pollset_wakeup); } else { + if (grpc_polling_trace) { + gpr_log(GPR_DEBUG, "PS:%p kicked_via_cv", p); + } gpr_cv_signal(&specific_worker->cv); return GRPC_ERROR_NONE; } @@ -716,9 +734,11 @@ static grpc_error *pollset_poll(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, bool read_ev = (events[i].events & (EPOLLIN | EPOLLPRI)) != 0; bool write_ev = (events[i].events & EPOLLOUT) != 0; if (grpc_polling_trace) { - gpr_log(GPR_DEBUG, - "PS:%p poll got fd: is_wq=%d cancel=%d read=%d write=%d", - pollset, is_workqueue, cancel, read_ev, write_ev); + gpr_log( + GPR_DEBUG, + "PS:%p poll got fd %p(%d/%d): is_wq=%d cancel=%d read=%d write=%d", + pollset, fd, fd->fd, fd->workqueue_wakeup_fd.read_fd, is_workqueue, + cancel, read_ev, write_ev); } if (is_workqueue) { append_error(&error,