From 635eb202890e72ced620f8e471bb5025ce67354e Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Sun, 19 May 2019 10:24:28 +0200 Subject: Kernel: Add the ability to debug poll/select independently of read/write --- Kernel/Process.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 3770954931..dff5a9ddf5 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -25,6 +25,7 @@ #include #include +//#define DEBUG_POLL_SELECT //#define DEBUG_IO //#define TASK_DEBUG //#define FORK_DEBUG @@ -1798,7 +1799,7 @@ int Process::sys$select(const Syscall::SC_select_params* params) if (error) return error; -#ifdef DEBUG_IO +#if defined(DEBUG_IO) || defined(DEBUG_POLL_SELECT) dbgprintf("%s<%u> selecting on (read:%u, write:%u), timeout=%p\n", name().characters(), pid(), current->m_select_read_fds.size(), current->m_select_write_fds.size(), timeout); #endif @@ -1872,6 +1873,10 @@ int Process::sys$poll(pollfd* fds, int nfds, int timeout) current->m_select_has_timeout = false; } +#if defined(DEBUG_IO) || defined(DEBUG_POLL_SELECT) + dbgprintf("%s<%u> polling on (read:%u, write:%u), timeout=%d\n", name().characters(), pid(), current->m_select_read_fds.size(), current->m_select_write_fds.size(), timeout); +#endif + if (current->m_select_has_timeout || timeout < 0) { current->block(Thread::State::BlockedSelect); } -- cgit v1.2.3