lkml.org 
[lkml]   [2016]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 12/21] MIPS memblock: Add memblock print outs in debug
Date
When debugging it is useful to have a list of all memory regions
added and reserved in the system. Ones are printed right from
memblock if memblock_debug is enabled.

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
---
arch/mips/kernel/setup.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index d2f410d..409d23d 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -200,11 +200,16 @@ void __init detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_add
add_memory_region(start, size, BOOT_MEM_RAM);
}

+/*
+ * Print declared memory layout
+ */
static void __init print_memory_map(void)
{
int i;
const int field = 2 * sizeof(unsigned long);

+ /* Print the added memory map */
+ pr_info("Determined physical RAM map:\n");
for (i = 0; i < boot_mem_map.nr_map; i++) {
printk(KERN_INFO " memory: %0*Lx @ %0*Lx ",
field, (unsigned long long) boot_mem_map.map[i].size,
@@ -228,6 +233,9 @@ static void __init print_memory_map(void)
break;
}
}
+
+ /* Print memblocks if memblock_debug is set */
+ memblock_dump_all();
}

/*
@@ -795,11 +803,11 @@ static void __init arch_mem_init(char **cmdline_p)
/* Sanity check the specified memory */
sanity_check_meminfo();

- pr_info("Determined physical RAM map:\n");
- print_memory_map();
-
bootmem_init();

+ /* Print memory map initialized by arch-specific code and params */
+ print_memory_map();
+
device_tree_init();
sparse_init();
plat_swiotlb_setup();
--
2.6.6
\
 
 \ /
  Last update: 2016-12-19 03:11    [W:0.573 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site