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

Kernel: Tidy up debug logging a little bit

When using dbg() in the kernel, the output is automatically prefixed
with [Process(PID:TID)]. This makes it a lot easier to understand which
thread is generating the output.

This patch also cleans up some common logging messages and removes the
now-unnecessary "dbg() << *current << ..." pattern.
This commit is contained in:
Andreas Kling 2020-01-21 16:14:39 +01:00
parent 5dd5d5ca4e
commit f38cfb3562
9 changed files with 41 additions and 38 deletions

View file

@ -82,7 +82,7 @@ Thread::Thread(Process& process)
m_tid = Process::allocate_pid();
}
process.m_thread_count++;
dbgprintf("Thread{%p}: New thread TID=%u in %s(%u)\n", this, m_tid, process.name().characters(), process.pid());
dbg() << "Created new thread " << process.name() << "(" << process.pid() << ":" << m_tid << ")";
set_default_signal_dispositions();
m_fpu_state = (FPUState*)kmalloc_aligned(sizeof(FPUState), 16);
memcpy(m_fpu_state, &s_clean_fpu_state, sizeof(FPUState));
@ -143,7 +143,6 @@ Thread::Thread(Process& process)
Thread::~Thread()
{
dbgprintf("~Thread{%p}\n", this);
kfree_aligned(m_fpu_state);
{
InterruptDisabler disabler;
@ -282,7 +281,7 @@ void Thread::finalize()
{
ASSERT(current == g_finalizer);
dbgprintf("Finalizing Thread %u in %s(%u)\n", tid(), m_process.name().characters(), pid());
dbg() << "Finalizing thread " << *this;
set_state(Thread::State::Dead);
if (m_joiner) {
@ -308,7 +307,6 @@ void Thread::finalize_dying_threads()
return IterationDecision::Continue;
});
}
dbgprintf("Finalizing %u dying threads\n", dying_threads.size());
for (auto* thread : dying_threads) {
auto& process = thread->process();
thread->finalize();
@ -316,7 +314,6 @@ void Thread::finalize_dying_threads()
if (process.m_thread_count == 0)
process.finalize();
}
dbgprintf("Done\n");
}
bool Thread::tick()