]> asedeno.scripts.mit.edu Git - linux.git/commit
powerpc/process: Fix interleaved output in show_user_instructions()
authorChristophe Leroy <christophe.leroy@c-s.fr>
Sat, 6 Oct 2018 16:51:14 +0000 (16:51 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 13 Oct 2018 11:21:25 +0000 (22:21 +1100)
commitfb2d9505c0dbd4f5e00db70f7ca0ca7a3d75ca63
tree7cd8733510170de72e5bdf7fc68d5c884802ece2
parentc9386bfd37d37f29588de9ea9add455510049c33
powerpc/process: Fix interleaved output in show_user_instructions()

When two processes crash at the same time, we sometimes encounter
interleaving in the middle of a line:

  init[1]: segfault (11) at 0 nip 0 lr 0 code 1
  init[1]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
  init[74]: segfault (11) at 10a74 nip 1000c198 lr 100078c8 code 1 in sh[10000000+14000]
  XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
  init[1]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
  init[74]: code: 90010024 bf61000c 91490a7c 3fa01002 3be00000 7d3e4b78 3bbd0c20 3b600000
  init[74]: code: 3b9d0040 7c7fe02e 2f830000 419e0028 <892300002f890000 41be001c 4b7f6e79

This patch fixes it by preparing complete lines in a buffer and
printing it at once.

Fixes: 88b0fe1757359 ("powerpc: Add show_user_instructions()")
Reviewed-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
[mpe: Use seq_buf_printf() not seq_buf_puts() which doesn't NULL terminate]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/process.c