summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorRobin Burchell <robin+git@viroteck.net>2019-05-19 10:24:28 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-05-19 14:13:49 +0200
commit635eb202890e72ced620f8e471bb5025ce67354e (patch)
tree5b3bc9875ce73db6a465f7e3cde8c2fea4582ac1 /Kernel
parentc7d8aa6969c2d30f1209be0c95b1bfc31c79831f (diff)
downloadserenity-635eb202890e72ced620f8e471bb5025ce67354e.zip
Kernel: Add the ability to debug poll/select independently of read/write
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Process.cpp7
1 files changed, 6 insertions, 1 deletions
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 <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);
}