summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-10-27 20:38:22 -0600
committerAndreas Kling <kling@serenityos.org>2021-01-27 22:48:41 +0100
commit95bfc12ff430c0b7539e7d8c3991599d6c67bf4e (patch)
tree1049a4a2c26ace323f9ef5496560168b46122d75
parente67402c7027f13fcc03d61f88725470e4c66e820 (diff)
downloadserenity-95bfc12ff430c0b7539e7d8c3991599d6c67bf4e.zip
AK: Include the processor id in log messages
-rw-r--r--AK/Format.cpp4
-rw-r--r--AK/LogStream.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/AK/Format.cpp b/AK/Format.cpp
index b1eb5e6d83..fe0e88d6f3 100644
--- a/AK/Format.cpp
+++ b/AK/Format.cpp
@@ -670,9 +670,9 @@ void vdbgln(StringView fmtstr, TypeErasedFormatParams params)
# ifdef KERNEL
if (Kernel::Processor::is_initialized() && Kernel::Thread::current()) {
auto& thread = *Kernel::Thread::current();
- builder.appendff("\033[34;1m[{}({}:{})]\033[0m: ", thread.process().name(), thread.pid().value(), thread.tid().value());
+ builder.appendff("\033[34;1m[#{} {}({}:{})]\033[0m: ", Kernel::Processor::id(), thread.process().name(), thread.pid().value(), thread.tid().value());
} else {
- builder.appendff("\033[34;1m[Kernel]\033[0m: ");
+ builder.appendff("\033[34;1m[#{} Kernel]\033[0m: ", Kernel::Processor::id());
}
# else
static TriState got_process_name = TriState::Unknown;
diff --git a/AK/LogStream.cpp b/AK/LogStream.cpp
index f5108f0b08..feaeb7c13a 100644
--- a/AK/LogStream.cpp
+++ b/AK/LogStream.cpp
@@ -129,7 +129,7 @@ DebugLogStream dbg()
#endif
#if defined(__serenity__) && defined(KERNEL)
if (Kernel::Processor::is_initialized() && Kernel::Thread::current())
- stream << "\033[34;1m[" << *Kernel::Thread::current() << "]\033[0m: ";
+ stream << "\033[34;1m[#" << Kernel::Processor::id() << " " << *Kernel::Thread::current() << "]\033[0m: ";
else
stream << "\033[36;1m[Kernel]\033[0m: ";
#endif
@@ -141,7 +141,7 @@ KernelLogStream klog()
{
KernelLogStream stream;
if (Kernel::Processor::is_initialized() && Kernel::Thread::current())
- stream << "\033[34;1m[" << *Kernel::Thread::current() << "]\033[0m: ";
+ stream << "\033[34;1m[#" << Kernel::Processor::id() << " " << *Kernel::Thread::current() << "]\033[0m: ";
else
stream << "\033[36;1m[Kernel]\033[0m: ";
return stream;