[3/3] powerpc/watchdog: Print the NIP in soft_nmi_interrupt()

Message ID 1507783474-28210-3-git-send-email-mpe@ellerman.id.au
State New
Headers show
Series
  • [1/3] powerpc/watchdog: Tweak watchdog printks
Related show

Commit Message

Michael Ellerman Oct. 12, 2017, 4:44 a.m.
When a CPU detects its locked up via soft_nmi_interrupt() we have
pt_regs, so print the regs->nip, which points to where we took the
soft-NMI.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/watchdog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nicholas Piggin Oct. 12, 2017, 8:18 a.m. | #1
On Thu, 12 Oct 2017 15:44:34 +1100
Michael Ellerman <mpe@ellerman.id.au> wrote:

> When a CPU detects its locked up via soft_nmi_interrupt() we have
> pt_regs, so print the regs->nip, which points to where we took the
> soft-NMI.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
>  arch/powerpc/kernel/watchdog.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
> index 2494cbe34132..4594ba0979e4 100644
> --- a/arch/powerpc/kernel/watchdog.c
> +++ b/arch/powerpc/kernel/watchdog.c
> @@ -235,7 +235,7 @@ void soft_nmi_interrupt(struct pt_regs *regs)
>  		}
>  		set_cpu_stuck(cpu, tb);
>  
> -		pr_emerg("CPU %d self-detected hard LOCKUP\n", cpu);
> +		pr_emerg("CPU %d self-detected hard LOCKUP @ %pS\n", cpu, (void *)regs->nip);
>  		print_modules();
>  		print_irqtrace_events(current);
>  		show_regs(regs);

These patches all look fine to me, but we should be printing nip
with show_regs, so why here too?

Thanks,
Nick
Michael Ellerman Oct. 12, 2017, 12:01 p.m. | #2
Nicholas Piggin <npiggin@gmail.com> writes:

> On Thu, 12 Oct 2017 15:44:34 +1100
> Michael Ellerman <mpe@ellerman.id.au> wrote:
>
>> When a CPU detects its locked up via soft_nmi_interrupt() we have
>> pt_regs, so print the regs->nip, which points to where we took the
>> soft-NMI.
>> 
>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>> ---
>>  arch/powerpc/kernel/watchdog.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
>> index 2494cbe34132..4594ba0979e4 100644
>> --- a/arch/powerpc/kernel/watchdog.c
>> +++ b/arch/powerpc/kernel/watchdog.c
>> @@ -235,7 +235,7 @@ void soft_nmi_interrupt(struct pt_regs *regs)
>>  		}
>>  		set_cpu_stuck(cpu, tb);
>>  
>> -		pr_emerg("CPU %d self-detected hard LOCKUP\n", cpu);
>> +		pr_emerg("CPU %d self-detected hard LOCKUP @ %pS\n", cpu, (void *)regs->nip);
>>  		print_modules();
>>  		print_irqtrace_events(current);
>>  		show_regs(regs);
>
> These patches all look fine to me, but we should be printing nip
> with show_regs, so why here too?

Because we can? :)

But maybe it's overkill.

We also have issues with loglevels, where sometimes you don't see the
regs, and just the EMERG lines, so it helps then.

But possibly we should fix that by making show_regs() EMERG, though
other arches don't seem to.

cheers

Patch

diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
index 2494cbe34132..4594ba0979e4 100644
--- a/arch/powerpc/kernel/watchdog.c
+++ b/arch/powerpc/kernel/watchdog.c
@@ -235,7 +235,7 @@  void soft_nmi_interrupt(struct pt_regs *regs)
 		}
 		set_cpu_stuck(cpu, tb);
 
-		pr_emerg("CPU %d self-detected hard LOCKUP\n", cpu);
+		pr_emerg("CPU %d self-detected hard LOCKUP @ %pS\n", cpu, (void *)regs->nip);
 		print_modules();
 		print_irqtrace_events(current);
 		show_regs(regs);