aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/ev_epollex_linux.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-04-10 23:14:29 +0000
committerGravatar Craig Tiller <ctiller@google.com>2017-04-10 23:14:29 +0000
commit1814374c6958ca4a0a97f7a85e9cdcb7d5d30e82 (patch)
tree5143a4485be6477faa1f0a774142ce8529a07583 /src/core/lib/iomgr/ev_epollex_linux.c
parent59b86dd7957be126d542c9f46c24ce8b9a80bd98 (diff)
debug
Diffstat (limited to 'src/core/lib/iomgr/ev_epollex_linux.c')
-rw-r--r--src/core/lib/iomgr/ev_epollex_linux.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/ev_epollex_linux.c b/src/core/lib/iomgr/ev_epollex_linux.c
index 2afc20daa5..468acd60c7 100644
--- a/src/core/lib/iomgr/ev_epollex_linux.c
+++ b/src/core/lib/iomgr/ev_epollex_linux.c
@@ -676,14 +676,19 @@ static grpc_error *pollset_poll(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
GRPC_SCHEDULING_END_BLOCKING_REGION;
if (r < 0) return GRPC_OS_ERROR(errno, "epoll_wait");
+ gpr_log(GPR_DEBUG, "PS:%p poll got %d events", pollset, r);
+
grpc_error *error = GRPC_ERROR_NONE;
for (int i = 0; i < r; i++) {
void *data_ptr = events[i].data.ptr;
if (data_ptr == &global_wakeup_fd) {
+ gpr_log(GPR_DEBUG, "PS:%p poll got global_wakeup_fd", pollset);
+
grpc_timer_consume_kick();
append_error(&error, grpc_wakeup_fd_consume_wakeup(&global_wakeup_fd),
err_desc);
} else if (data_ptr == &pollset->pollset_wakeup) {
+ gpr_log(GPR_DEBUG, "PS:%p poll got pollset_wakeup", pollset);
/* once we start shutting down we stop consuming the wakeup:
the fd is level triggered and non-exclusive, which should result in all
pollers waking */
@@ -697,6 +702,9 @@ static grpc_error *pollset_poll(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
bool cancel = (events[i].events & (EPOLLERR | EPOLLHUP)) != 0;
bool read_ev = (events[i].events & (EPOLLIN | EPOLLPRI)) != 0;
bool write_ev = (events[i].events & EPOLLOUT) != 0;
+ 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);
if (is_workqueue) {
append_error(&error,
grpc_wakeup_fd_consume_wakeup(&fd->workqueue_wakeup_fd),
@@ -812,7 +820,7 @@ static void pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
}
}
struct epoll_event ev_wq = {.events = EPOLLET | EPOLLIN | EPOLLEXCLUSIVE,
- .data.ptr = fd};
+ .data.ptr = (void*)(1+(intptr_t)fd)};
if (epoll_ctl(pollset->epfd, EPOLL_CTL_ADD, fd->workqueue_wakeup_fd.read_fd,
&ev_wq) != 0) {
switch (errno) {