[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <zyhvjj66drbmqfeccpph3b53fltry4smxoocjr7i5hdtqzkoap@i4xidbzzmb6p>
Date: Tue, 18 Jun 2024 09:42:08 -0500
From: Maxwell Bland <mbland@...orola.com>
To: linux-mm@...ck.org
Cc: Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>,
Jonathan Corbet <corbet@....net>,
Andrew Morton <akpm@...ux-foundation.org>,
Ard Biesheuvel <ardb@...nel.org>, Mark Rutland <mark.rutland@....com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Maxwell Bland <mbland@...orola.com>,
Alexandre Ghiti <alexghiti@...osinc.com>,
linux-arm-kernel@...ts.infradead.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v4 3/5] arm64: indent ptdump by level, aligning attributes
Outputs each level of the page table with two additional spaces for
parsers, distinction, and readability while maintaining the alignment of
region size and attributes.
Signed-off-by: Maxwell Bland <mbland@...orola.com>
---
arch/arm64/mm/ptdump.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm64/mm/ptdump.c b/arch/arm64/mm/ptdump.c
index 8f0b459c13ed..2ec16b523043 100644
--- a/arch/arm64/mm/ptdump.c
+++ b/arch/arm64/mm/ptdump.c
@@ -336,6 +336,10 @@ static void note_page(struct ptdump_state *pt_st, unsigned long addr, int level,
addr >= st->marker[1].start_address) {
const char *unit = units;
unsigned long delta;
+ unsigned int i;
+
+ for (i = 0; i < st->level; i++)
+ pt_dump_seq_printf(st->seq, " ");
if (st->current_prot) {
note_prot_uxn(st, addr);
@@ -362,6 +366,10 @@ static void note_page(struct ptdump_state *pt_st, unsigned long addr, int level,
st->start_address, addr);
}
+ /* Align region information regardlesss of level */
+ for (i = st->level; i < 4; i++)
+ pt_dump_seq_printf(st->seq, " ");
+
delta >>= 10;
while (!(delta & 1023) && unit[1]) {
delta >>= 10;
@@ -369,6 +377,7 @@ static void note_page(struct ptdump_state *pt_st, unsigned long addr, int level,
}
pt_dump_seq_printf(st->seq, "%9lu%c %s", delta, *unit,
pg_level[st->level].name);
+
if (st->current_prot && pg_level[st->level].bits)
dump_prot(st, pg_level[st->level].bits,
pg_level[st->level].num);
--
2.39.2
Powered by blists - more mailing lists