diff options
author | Olof Johansson <olof@lixom.net> | 2007-10-11 20:20:07 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-10-12 00:05:18 -0400 |
commit | d0c3d534a4388a465101b634a95f2ec586415254 (patch) | |
tree | e6acdc89adcb9057b7bbaeba55332fdcb97c2ceb /arch/powerpc/kernel/traps.c | |
parent | b63db45ca44a805ef21eb10a3750e88419156423 (diff) |
[POWERPC] Implement logging of unhandled signals
Implement show_unhandled_signals sysctl + support to print when a process
is killed due to unhandled signals just as i386 and x86_64 does.
Default to having it off, unlike x86 that defaults on.
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/traps.c')
-rw-r--r-- | arch/powerpc/kernel/traps.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 2f1857c9819f..bf9e39c6e296 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -172,11 +172,21 @@ int die(const char *str, struct pt_regs *regs, long err) | |||
172 | void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) | 172 | void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) |
173 | { | 173 | { |
174 | siginfo_t info; | 174 | siginfo_t info; |
175 | const char fmt32[] = KERN_INFO "%s[%d]: unhandled signal %d " \ | ||
176 | "at %08lx nip %08lx lr %08lx code %x\n"; | ||
177 | const char fmt64[] = KERN_INFO "%s[%d]: unhandled signal %d " \ | ||
178 | "at %016lx nip %016lx lr %016lx code %x\n"; | ||
175 | 179 | ||
176 | if (!user_mode(regs)) { | 180 | if (!user_mode(regs)) { |
177 | if (die("Exception in kernel mode", regs, signr)) | 181 | if (die("Exception in kernel mode", regs, signr)) |
178 | return; | 182 | return; |
179 | } | 183 | } else if (show_unhandled_signals && |
184 | unhandled_signal(current, signr) && | ||
185 | printk_ratelimit()) { | ||
186 | printk(regs->msr & MSR_SF ? fmt64 : fmt32, | ||
187 | current->comm, current->pid, signr, | ||
188 | addr, regs->nip, regs->link, code); | ||
189 | } | ||
180 | 190 | ||
181 | memset(&info, 0, sizeof(info)); | 191 | memset(&info, 0, sizeof(info)); |
182 | info.si_signo = signr; | 192 | info.si_signo = signr; |