summaryrefslogtreecommitdiff
path: root/Kernel/Scheduler.cpp
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2022-08-25 17:43:32 +0200
committerAndreas Kling <kling@serenityos.org>2022-08-26 13:07:07 +0200
commit8ba6e96d050881c0b77baf68d39bcba3de0d049b (patch)
tree4a25f0ec1547473c31a217a49fc47c05eb9b9f9a /Kernel/Scheduler.cpp
parent2bf5052608b8013a5bae82ac0cdc86a8d5e60e4d (diff)
downloadserenity-8ba6e96d050881c0b77baf68d39bcba3de0d049b.zip
Kernel: Reorganize and colorize the scheduler thread list dump
Diffstat (limited to 'Kernel/Scheduler.cpp')
-rw-r--r--Kernel/Scheduler.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp
index e153f10c01..3bfdd354dc 100644
--- a/Kernel/Scheduler.cpp
+++ b/Kernel/Scheduler.cpp
@@ -544,23 +544,26 @@ void dump_thread_list(bool with_stack_traces)
};
Thread::for_each([&](Thread& thread) {
+ auto color = thread.process().is_kernel_process() ? "\x1b[34;1m"sv : "\x1b[33;1m"sv;
switch (thread.state()) {
case Thread::State::Dying:
- dmesgln(" {:14} {:30} @ {:04x}:{:08x} Finalizable: {}, (nsched: {})",
- thread.state_string(),
+ dmesgln(" {}{:30}\x1b[0m @ {:04x}:{:08x} is {:14} (Finalizable: {}, nsched: {})",
+ color,
thread,
get_cs(thread),
get_eip(thread),
+ thread.state_string(),
thread.is_finalizable(),
thread.times_scheduled());
break;
default:
- dmesgln(" {:14} Pr:{:2} {:30} @ {:04x}:{:08x} (nsched: {})",
- thread.state_string(),
- thread.priority(),
+ dmesgln(" {}{:30}\x1b[0m @ {:04x}:{:08x} is {:14} (Pr:{:2}, nsched: {})",
+ color,
thread,
get_cs(thread),
get_eip(thread),
+ thread.state_string(),
+ thread.priority(),
thread.times_scheduled());
break;
}