1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:28:11 +00:00

Kernel: Show more (b)locking info when dumping the process list

This commit is contained in:
Tim Schumacher 2022-08-25 12:18:16 +02:00 committed by Andreas Kling
parent 47af812a23
commit 2bf5052608
2 changed files with 49 additions and 5 deletions

View file

@ -564,6 +564,17 @@ void dump_thread_list(bool with_stack_traces)
thread.times_scheduled());
break;
}
if (thread.state() == Thread::State::Blocked && thread.blocking_mutex()) {
dmesgln(" Blocking on Mutex {:#x} ({})", thread.blocking_mutex(), thread.blocking_mutex()->name());
}
if (thread.state() == Thread::State::Blocked && thread.blocker()) {
dmesgln(" Blocking on Blocker {:#x}", thread.blocker());
}
#if LOCK_DEBUG
thread.for_each_held_lock([](auto const& entry) {
dmesgln(" Holding lock {:#x} ({}) at {}", entry.lock, entry.lock->name(), entry.lock_location);
});
#endif
if (with_stack_traces) {
auto trace_or_error = thread.backtrace();
if (!trace_or_error.is_error()) {