From e9c0f4567dae2ca6c3a9cc377d8f65b25ced74e9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 15 Apr 2019 19:43:12 +0200 Subject: Kernel+ProcessManager: Expose the number of kmalloc/kfree calls. This will be very helpful in tracking down unwanted kmalloc traffic. :^) --- Kernel/FileSystem/ProcFS.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Kernel/FileSystem') diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index d9c28162bd..1aaf655101 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -8,6 +8,7 @@ #include "Console.h" #include "Scheduler.h" #include +#include #include #include @@ -558,14 +559,16 @@ ByteBuffer procfs$memstat(InodeIdentifier) { InterruptDisabler disabler; StringBuilder builder; - builder.appendf("%u,%u,%u,%u,%u,%u,%u\n", + builder.appendf("%u,%u,%u,%u,%u,%u,%u,%u,%u\n", kmalloc_sum_eternal, sum_alloc, sum_free, MM.user_physical_pages_in_existence() - MM.m_free_physical_pages.size(), MM.m_free_physical_pages.size(), MM.super_physical_pages_in_existence() - MM.m_free_supervisor_physical_pages.size(), - MM.m_free_supervisor_physical_pages.size() + MM.m_free_supervisor_physical_pages.size(), + g_kmalloc_call_count, + g_kfree_call_count ); return builder.to_byte_buffer(); } -- cgit v1.2.3