mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
Kernel: Split SCHEDULER_DEBUG into a new SCHEDULER_RUNNABLE_DEBUG
And use dbgprintf() consistently on a few of the pieces of logging here. This is useful when trying to track thread switching when you don't really care about what it's switching _to_.
This commit is contained in:
parent
a648331e26
commit
4f94fbc9e1
Notes:
sideshowbarker
2024-07-19 13:13:03 +09:00
Author: https://github.com/rburchell Commit: https://github.com/SerenityOS/serenity/commit/4f94fbc9e1d Pull-request: https://github.com/SerenityOS/serenity/pull/324
@ -8,6 +8,7 @@
|
||||
|
||||
//#define LOG_EVERY_CONTEXT_SWITCH
|
||||
//#define SCHEDULER_DEBUG
|
||||
//#define SCHEDULER_RUNNABLE_DEBUG
|
||||
|
||||
static u32 time_slice_for(Process::Priority priority)
|
||||
{
|
||||
@ -233,7 +234,7 @@ bool Scheduler::pick_next()
|
||||
return true;
|
||||
});
|
||||
|
||||
#ifdef SCHEDULER_DEBUG
|
||||
#ifdef SCHEDULER_RUNNABLE_DEBUG
|
||||
dbgprintf("Non-runnables:\n");
|
||||
for (auto* thread = g_nonrunnable_threads->head(); thread; thread = thread->next()) {
|
||||
auto* process = &thread->process();
|
||||
@ -258,7 +259,7 @@ bool Scheduler::pick_next()
|
||||
|
||||
if (!thread->process().is_being_inspected() && (thread->state() == Thread::Runnable || thread->state() == Thread::Running)) {
|
||||
#ifdef SCHEDULER_DEBUG
|
||||
kprintf("switch to %s(%u:%u) @ %w:%x\n", thread->process().name().characters(), thread->process().pid(), thread->tid(), thread->tss().cs, thread->tss().eip);
|
||||
dbgprintf("switch to %s(%u:%u) @ %w:%x\n", thread->process().name().characters(), thread->process().pid(), thread->tid(), thread->tss().cs, thread->tss().eip);
|
||||
#endif
|
||||
return context_switch(*thread);
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ void Thread::block(Thread::State new_state)
|
||||
{
|
||||
bool did_unlock = process().big_lock().unlock_if_locked();
|
||||
if (state() != Thread::Running) {
|
||||
kprintf("Thread::block: %s(%u) block(%u/%s) with state=%u/%s\n", process().name().characters(), process().pid(), new_state, to_string(new_state), state(), to_string(state()));
|
||||
dbgprintf("Thread::block: %s(%u) block(%u/%s) with state=%u/%s\n", process().name().characters(), process().pid(), new_state, to_string(new_state), state(), to_string(state()));
|
||||
}
|
||||
ASSERT(state() == Thread::Running);
|
||||
m_was_interrupted_while_blocked = false;
|
||||
|
Loading…
Reference in New Issue
Block a user