arm64: Show three registers per line
PATCH 1/1 arm64: Show three registers per line
Displaying two registers per line takes 15 lines. That improves to just 10 lines if we display three registers per line, which reduces the amount of information lost when oopses are cut off. It stays within 80 columns and matches x86-64.
--- arch/arm64/kernel/process.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
arch/arm64/kernel/process.c +3 -6
@@ -294,13 +294,10 @@ void __show_regs(struct pt_regs *regs) i = top_reg;while (i >=0 ) { -printk ("x%-2d: %016llx " , i, regs->regs[i]); - i--; +printk ("x%-2d: %016llx" , i, regs->regs[i]); -if (i %2 ==0 ) { -pr_cont ("x%-2d: %016llx " , i, regs->regs[i]); - i--; - } +while (i-- %3 ) +pr_cont (" x%-2d: %016llx" , i, regs->regs[i]);pr_cont ("\n" ); }
Signature · 1 line
2.30.2
Quoted 6 lines · Matthew Wilcox (Oracle)
Displaying two registers per line takes 15 lines. That improves to just 10 lines if we display three registers per line, which reduces the amount of information lost when oopses are cut off. It stays within 80 columns and matches x86-64.
Signed-off-by Matthew Wilcox (Oracle) <[email protected]>
Signature · 1 line
Kees Cook
From: Matthew Wilcox
Quoted 23 lines
Sent: 20 April 2021 18:23
Displaying two registers per line takes 15 lines. That improves to just 10 lines if we display three registers per line, which reduces the amount of information lost when oopses are cut off. It stays within 80 columns and matches x86-64.
Signed-off-by Matthew Wilcox (Oracle) <[email protected]>--- arch/arm64/kernel/process.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)arch/arm64/kernel/process.c +1
-2@@ -294,13 +294,10 @@ void __show_regs(struct pt_regs *regs) i = top_reg;while (i >=0 ) { -printk ("x%-2d: %016llx " , i, regs->regs[i]); - i--; +printk ("x%-2d: %016llx" , i, regs->regs[i]);
arch/arm64/kernel/process.c void __show_regs(struct pt_regs *regs) · line 303
Quoted 10 lines
arch/arm64/kernel/process.c +2
-4-if (i %2 ==0 ) { -pr_cont ("x%-2d: %016llx " , i, regs->regs[i]); - i--; - } +while (i-- %3 ) +pr_cont (" x%-2d: %016llx" , i, regs->regs[i]);pr_cont ("\n" ); }
I think I'd avoid pr_cont() to avoid 'mishaps' during concurrent oops. This probably needs something like:
for (; i >= 0; i -= 3) {
switch (i) {
case 0:
printk("x%-2d: %016llx\n", i, regs->regs[i]);
break;
case 1:
printk("x%-2d: %016llx x%-2d: %016llx\n",
i, regs->regs[i], i - 1, regs->regs[i - 1]);
break;
default:
printk("x%-2d: %016llx x%-2d: %016llx x%-2d: %016llx\n",
i, regs->regs[i], i - 1, regs->regs[i - 1],
i - 2, regs->regs[i - 2]);
continue;
}
break;
}
David-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
Quoted 9 lines · Matthew Wilcox (Oracle)
Displaying two registers per line takes 15 lines. That improves to just 10 lines if we display three registers per line, which reduces the amount of information lost when oopses are cut off. It stays within 80 columns and matches x86-64.
Signed-off-by Matthew Wilcox (Oracle) <[email protected]>--- arch/arm64/kernel/process.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Will
Quoted 4 lines · Matthew Wilcox (Oracle)
Displaying two registers per line takes 15 lines. That improves to just 10 lines if we display three registers per line, which reduces the amount of information lost when oopses are cut off. It stays within 80 columns and matches x86-64.
Applied to arm64 (for-next/core), thanks!
[1/1] arm64: Show three registers per line
https://git.kernel.org/arm64/c/0bca3ec846d7
Signature · 1 line
Catalin