mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
Kernel: Add the ability to debug poll/select independently of read/write
This commit is contained in:
parent
c7d8aa6969
commit
635eb20289
1 changed files with 6 additions and 1 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include <Kernel/SharedMemory.h>
|
#include <Kernel/SharedMemory.h>
|
||||||
#include <Kernel/ProcessTracer.h>
|
#include <Kernel/ProcessTracer.h>
|
||||||
|
|
||||||
|
//#define DEBUG_POLL_SELECT
|
||||||
//#define DEBUG_IO
|
//#define DEBUG_IO
|
||||||
//#define TASK_DEBUG
|
//#define TASK_DEBUG
|
||||||
//#define FORK_DEBUG
|
//#define FORK_DEBUG
|
||||||
|
@ -1798,7 +1799,7 @@ int Process::sys$select(const Syscall::SC_select_params* params)
|
||||||
if (error)
|
if (error)
|
||||||
return 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);
|
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
|
#endif
|
||||||
|
|
||||||
|
@ -1872,6 +1873,10 @@ int Process::sys$poll(pollfd* fds, int nfds, int timeout)
|
||||||
current->m_select_has_timeout = false;
|
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) {
|
if (current->m_select_has_timeout || timeout < 0) {
|
||||||
current->block(Thread::State::BlockedSelect);
|
current->block(Thread::State::BlockedSelect);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue