Skip to content

Commit b4c9712

Browse files
Yue Huwilldeacon
authored andcommitted
arm64: traps: Add str of description to panic() in die()
Currently, there are different description strings in die() such as die("Oops",,), die("Oops - BUG",,). And panic() called by die() will always show "Fatal exception" or "Fatal exception in interrupt". Note that panic() will run any panic handler via panic_notifier_list. And the string above will be formatted and placed in static buf[] which will be passed to handler. So panic handler can not distinguish which Oops it is from the buf if we want to do some things like reserve the string in memory or panic statistics. It's not benefit to debug. We need to add more codes to troubleshoot. Let's utilize existing resource to make debug much simpler. Signed-off-by: Yue Hu <huyue2@yulong.com> Link: https://lore.kernel.org/r/20200804085347.10720-1-zbestahu@gmail.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent f75aef3 commit b4c9712

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/arm64/kernel/traps.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ void die(const char *str, struct pt_regs *regs, int err)
200200
oops_exit();
201201

202202
if (in_interrupt())
203-
panic("Fatal exception in interrupt");
203+
panic("%s: Fatal exception in interrupt", str);
204204
if (panic_on_oops)
205-
panic("Fatal exception");
205+
panic("%s: Fatal exception", str);
206206

207207
raw_spin_unlock_irqrestore(&die_lock, flags);
208208

0 commit comments

Comments
 (0)