diff mbox series

[1/2] powerpc: Make instruction dump work with scripts/decodecode

Message ID 20221006032019.1128624-1-mpe@ellerman.id.au (mailing list archive)
State Accepted
Commit 3e65412709293d5fb65249408e8e801b23b72635
Headers show
Series [1/2] powerpc: Make instruction dump work with scripts/decodecode | expand

Commit Message

Michael Ellerman Oct. 6, 2022, 3:20 a.m. UTC
Matt reported that scripts/decodecode doesn't work for the instruction
dump in the powerpc oops output. Although there are scripts around that
can decode it, it would be preferable if the standard in-tree script
worked.

All other arches prefix the instruction dump with "Code:", and that's
what the script looks for, so use that.

The script then works as expected:

  $ CROSS_COMPILE=powerpc64le-linux-gnu- ./scripts/decodecode
  Code:
  fbc1fff0 f821ffc1 7c7d1b78 7c9c2378 ebc30028 7fdff378 48000018 60000000
  60000000 ebff0008 7c3ef840 41820048 <815f0060> e93f0000 5529077c 7d295378
  ^D

  All code
  ========
     0:   f0 ff c1 fb     std     r30,-16(r1)
     4:   c1 ff 21 f8     stdu    r1,-64(r1)
     8:   78 1b 7d 7c     mr      r29,r3
     ...

Note that the script doesn't cope well with printk timestamps or printk
caller info.

Reported-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Ellerman Nov. 30, 2022, 9:24 a.m. UTC | #1
On Thu, 6 Oct 2022 14:20:18 +1100, Michael Ellerman wrote:
> Matt reported that scripts/decodecode doesn't work for the instruction
> dump in the powerpc oops output. Although there are scripts around that
> can decode it, it would be preferable if the standard in-tree script
> worked.
> 
> All other arches prefix the instruction dump with "Code:", and that's
> what the script looks for, so use that.
> 
> [...]

Applied to powerpc/next.

[1/2] powerpc: Make instruction dump work with scripts/decodecode
      https://git.kernel.org/powerpc/c/3e65412709293d5fb65249408e8e801b23b72635
[2/2] powerpc: Print instruction dump on a single line
      https://git.kernel.org/powerpc/c/d90bb7b4fdaff3f2fa68c7af85de2ce9e70189b1

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 37df0428e4fb..1d22a539d45c 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1359,7 +1359,7 @@  static void show_instructions(struct pt_regs *regs)
 	unsigned long nip = regs->nip;
 	unsigned long pc = regs->nip - (NR_INSN_TO_PRINT * 3 / 4 * sizeof(int));
 
-	printk("Instruction dump:");
+	printk("Code:");
 
 	/*
 	 * If we were executing with the MMU off for instructions, adjust pc