forked from crash-utility/crash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently the output is like this ppc64le: crash> info threads Id Target Id Frame 1 CPU 0 <unavailable> in ?? () 2 CPU 1 0xc000000000025d00 in ppc_panic_event (this=<optimized out>, event=<optimized out>, ptr=0x0) at arch/powerpc/kernel/setup-common.c:712 3 CPU 2 0xc000000000025d00 in ppc_panic_event (this=<optimized out>, event=<optimized out>, ptr=0x0) at arch/powerpc/kernel/setup-common.c:712 4 CPU 3 0xc000000000025d00 in ppc_panic_event (this=<optimized out>, event=<optimized out>, ptr=0x0) at arch/powerpc/kernel/setup-common.c:712 * 5 CPU 4 0xc000000000025d00 in ppc_panic_event (this=<optimized out>, event=<optimized out>, ptr=0x0) at arch/powerpc/kernel/setup-common.c:712 6 CPU 5 0xc000000000025d00 in ppc_panic_event (this=<optimized out>, event=<optimized out>, ptr=0x0) at arch/powerpc/kernel/setup-common.c:712 7 CPU 6 0xc000000000025d00 in ppc_panic_event (this=<optimized out>, event=<optimized out>, ptr=0x0) at arch/powerpc/kernel/setup-common.c:712 8 CPU 7 0xc000000000025d00 in ppc_panic_event (this=<optimized out>, event=<optimized out>, ptr=0x0) at arch/powerpc/kernel/setup-common.c:712 There are two issues here: 1. CPU 0 always shows '<unavailable>' frame: This is due to 'thread 0' being initialised in 'crash_target_init', but it's very early in crash init, so it could not get any registers from the vmcore. And, since GDB caches registers (whether it is there or now), it keeps thinking that registers for this thread are unavailable, so all future usage of thread 0 also shows unavailable registers & frame Fix this by refreshing the register cache of all threads in 'gdb_refresh_regcache', at task_init 2. All other CPUs show the same frame: For each thread, GDB depends on crash to give it registers, ie. crash_target::fetch_registers, but this in turn depends on crash's current context GDB internally switches it's thread context internally to each thread one by one, while printing the thread's frame, similarly switch crash's context when the thread context is changed, so that it matches the thread context in gdb (such as, CPU 3 in crash for thread 2(CPU 3) in gdb). Also, since we are switching context multiple times, add an argument to 'set_cpu' to not print the context everytime With these fixed, it will show all threads, as well as correct registers and frame. It might still show similar frame for many threads, due to all of them being on same NMI exception crash path, but if checked with 'info registers', they will have different registers. Cc: Sourabh Jain <[email protected]> Cc: Hari Bathini <[email protected]> Cc: Mahesh J Salgaonkar <[email protected]> Cc: Naveen N. Rao <[email protected]> Cc: Lianbo Jiang <[email protected]> Cc: HAGIO KAZUHITO(萩尾 一仁) <[email protected]> Cc: Tao Liu <[email protected]> Signed-off-by: Aditya Gupta <[email protected]>
- Loading branch information
1 parent
78a8622
commit bb8ea65
Showing
6 changed files
with
124 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters