mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 18:42:43 +00:00 
			
		
		
		
	Kernel+ProcessManager: Expose the number of kmalloc/kfree calls.
This will be very helpful in tracking down unwanted kmalloc traffic. :^)
This commit is contained in:
		
							parent
							
								
									13041f894f
								
							
						
					
					
						commit
						e9c0f4567d
					
				
					 5 changed files with 25 additions and 8 deletions
				
			
		|  | @ -8,6 +8,7 @@ | |||
| #include "Console.h" | ||||
| #include "Scheduler.h" | ||||
| #include <Kernel/PCI.h> | ||||
| #include <Kernel/kmalloc.h> | ||||
| #include <AK/StringBuilder.h> | ||||
| #include <LibC/errno_numbers.h> | ||||
| 
 | ||||
|  | @ -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(); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling