diff options
author | Liav A <liavalb@gmail.com> | 2021-05-13 19:36:31 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-16 19:58:33 +0200 |
commit | 99eab4667a7afcf7a6106e4b6472840fb2a21151 (patch) | |
tree | 6d0b7dc4f127321d922dfbccbb001ba747769dea /Kernel | |
parent | 20743e8aede1de46195dd61ad18002cd52db7d3a (diff) | |
download | serenity-99eab4667a7afcf7a6106e4b6472840fb2a21151.zip |
Kernel: Print scheduler state to the display console
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Devices/HID/PS2KeyboardDevice.cpp | 1 | ||||
-rw-r--r-- | Kernel/Scheduler.cpp | 4 | ||||
-rw-r--r-- | Kernel/TTY/ConsoleManagement.h | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/Kernel/Devices/HID/PS2KeyboardDevice.cpp b/Kernel/Devices/HID/PS2KeyboardDevice.cpp index a20c9e6044..8df0dced28 100644 --- a/Kernel/Devices/HID/PS2KeyboardDevice.cpp +++ b/Kernel/Devices/HID/PS2KeyboardDevice.cpp @@ -35,6 +35,7 @@ void PS2KeyboardDevice::irq_handle_byte_read(u8 byte) if (m_modifiers == (Mod_Alt | Mod_Shift) && byte == 0x58) { // Alt+Shift+F12 pressed, dump some kernel state to the debug console. + ConsoleManagement::the().switch_to_debug(); Scheduler::dump_scheduler_state(); } diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp index 8c1dad9379..b4df7f8a1e 100644 --- a/Kernel/Scheduler.cpp +++ b/Kernel/Scheduler.cpp @@ -587,7 +587,7 @@ void dump_thread_list() Thread::for_each([&](Thread& thread) { switch (thread.state()) { case Thread::Dying: - dbgln(" {:14} {:30} @ {:04x}:{:08x} Finalizable: {}, (nsched: {})", + dmesgln(" {:14} {:30} @ {:04x}:{:08x} Finalizable: {}, (nsched: {})", thread.state_string(), thread, get_cs(thread), @@ -596,7 +596,7 @@ void dump_thread_list() thread.times_scheduled()); break; default: - dbgln(" {:14} Pr:{:2} {:30} @ {:04x}:{:08x} (nsched: {})", + dmesgln(" {:14} Pr:{:2} {:30} @ {:04x}:{:08x} (nsched: {})", thread.state_string(), thread.priority(), thread, diff --git a/Kernel/TTY/ConsoleManagement.h b/Kernel/TTY/ConsoleManagement.h index 8cca80e860..eb05156a37 100644 --- a/Kernel/TTY/ConsoleManagement.h +++ b/Kernel/TTY/ConsoleManagement.h @@ -26,6 +26,8 @@ public: void switch_to(unsigned); void initialize(); + void switch_to_debug() { switch_to(1); } + NonnullRefPtr<VirtualConsole> first_tty() const { return m_consoles[0]; } NonnullRefPtr<VirtualConsole> debug_tty() const { return m_consoles[1]; } |