1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

Kernel: Add the ability to debug poll/select independently of read/write

This commit is contained in:
Robin Burchell 2019-05-19 10:24:28 +02:00 committed by Andreas Kling
parent c7d8aa6969
commit 635eb20289

View file

@ -25,6 +25,7 @@
#include <Kernel/SharedMemory.h>
#include <Kernel/ProcessTracer.h>
//#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);
}