* Re: Re: [PATCH] mips: add arch_trigger_all_cpu_backtrace() function
@ 2014-10-22 6:54 Eunbong Song
2014-10-22 7:11 ` John Crispin
0 siblings, 1 reply; 5+ messages in thread
From: Eunbong Song @ 2014-10-22 6:54 UTC (permalink / raw)
To: John Crispin, ralf@linux-mips.org
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
> Hi Eubong,
> one small question inline ...
>> +void arch_trigger_all_cpu_backtrace(bool); +#define
>> arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
> What is the purpose of this define ? is this maybe a leftover from
> some regex/cleanups ?
Hi John.
Actually, I just follow the same function of sparc architecture.
You can find this in arch/sparc/include/asm/irq_64.h as below
void arch_trigger_all_cpu_backtrace(bool);
#define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
I guess this is used for conditional compile.
See below.
include/linux/nmi.h
#ifdef arch_trigger_all_cpu_backtrace
static inline bool trigger_all_cpu_backtrace(void)
{
arch_trigger_all_cpu_backtrace(true);
return true;
}
static inline bool trigger_allbutself_cpu_backtrace(void)
{
arch_trigger_all_cpu_backtrace(false);
return true;
}
#else
static inline bool trigger_all_cpu_backtrace(void)
{
return false;
}
static inline bool trigger_allbutself_cpu_backtrace(void)
{
return false;
}
#endif
Thanks.
> John
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mips: add arch_trigger_all_cpu_backtrace() function
2014-10-22 6:54 Re: [PATCH] mips: add arch_trigger_all_cpu_backtrace() function Eunbong Song
@ 2014-10-22 7:11 ` John Crispin
2014-10-22 22:29 ` James Hogan
0 siblings, 1 reply; 5+ messages in thread
From: John Crispin @ 2014-10-22 7:11 UTC (permalink / raw)
To: eunb.song, ralf@linux-mips.org
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
On 22/10/2014 08:54, Eunbong Song wrote:
>
>> Hi Eubong,
>
>> one small question inline ...
>
>>> +void arch_trigger_all_cpu_backtrace(bool); +#define
>>> arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
>
>> What is the purpose of this define ? is this maybe a leftover from
>> some regex/cleanups ?
>
> Hi John.
> Actually, I just follow the same function of sparc architecture.
> You can find this in arch/sparc/include/asm/irq_64.h as below
>
> void arch_trigger_all_cpu_backtrace(bool);
> #define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
>
> I guess this is used for conditional compile.
> See below.
> include/linux/nmi.h
> #ifdef arch_trigger_all_cpu_backtrace
> static inline bool trigger_all_cpu_backtrace(void)
> {
> arch_trigger_all_cpu_backtrace(true);
>
> return true;
> }
> static inline bool trigger_allbutself_cpu_backtrace(void)
> {
> arch_trigger_all_cpu_backtrace(false);
> return true;
> }
> #else
> static inline bool trigger_all_cpu_backtrace(void)
> {
> return false;
> }
> static inline bool trigger_allbutself_cpu_backtrace(void)
> {
> return false;
> }
> #endif
>
> Thanks.
>> John
>
i don't see how this is required for conditional compiles. the code
define a->a which is bogus i think.
John
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mips: add arch_trigger_all_cpu_backtrace() function
2014-10-22 7:11 ` John Crispin
@ 2014-10-22 22:29 ` James Hogan
2014-10-22 22:29 ` James Hogan
0 siblings, 1 reply; 5+ messages in thread
From: James Hogan @ 2014-10-22 22:29 UTC (permalink / raw)
To: John Crispin
Cc: eunb.song, ralf@linux-mips.org, linux-mips@linux-mips.org,
linux-kernel@vger.kernel.org
Hi John,
On Wed, Oct 22, 2014 at 09:11:39AM +0200, John Crispin wrote:
> On 22/10/2014 08:54, Eunbong Song wrote:
> >>> +void arch_trigger_all_cpu_backtrace(bool); +#define
> >>> arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
> >
> >> What is the purpose of this define ? is this maybe a leftover from
> >> some regex/cleanups ?
> >
> > Hi John.
> > Actually, I just follow the same function of sparc architecture.
> > You can find this in arch/sparc/include/asm/irq_64.h as below
> >
> > void arch_trigger_all_cpu_backtrace(bool);
> > #define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
> >
> > I guess this is used for conditional compile.
> > See below.
> > include/linux/nmi.h
> > #ifdef arch_trigger_all_cpu_backtrace
> > static inline bool trigger_all_cpu_backtrace(void)
> > {
> > arch_trigger_all_cpu_backtrace(true);
> >
> > return true;
> > }
> > static inline bool trigger_allbutself_cpu_backtrace(void)
> > {
> > arch_trigger_all_cpu_backtrace(false);
> > return true;
> > }
> > #else
> > static inline bool trigger_all_cpu_backtrace(void)
> > {
> > return false;
> > }
> > static inline bool trigger_allbutself_cpu_backtrace(void)
> > {
> > return false;
> > }
> > #endif
> >
> > Thanks.
> >> John
> >
>
> i don't see how this is required for conditional compiles. the code
> define a->a which is bogus i think.
It's a pretty common pattern in the asm headers, in order to allow
generic code to use the preprocessor to see whether it was defined or
not.
Cheers
James
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mips: add arch_trigger_all_cpu_backtrace() function
2014-10-22 22:29 ` James Hogan
@ 2014-10-22 22:29 ` James Hogan
0 siblings, 0 replies; 5+ messages in thread
From: James Hogan @ 2014-10-22 22:29 UTC (permalink / raw)
To: John Crispin
Cc: eunb.song, ralf@linux-mips.org, linux-mips@linux-mips.org,
linux-kernel@vger.kernel.org
Hi John,
On Wed, Oct 22, 2014 at 09:11:39AM +0200, John Crispin wrote:
> On 22/10/2014 08:54, Eunbong Song wrote:
> >>> +void arch_trigger_all_cpu_backtrace(bool); +#define
> >>> arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
> >
> >> What is the purpose of this define ? is this maybe a leftover from
> >> some regex/cleanups ?
> >
> > Hi John.
> > Actually, I just follow the same function of sparc architecture.
> > You can find this in arch/sparc/include/asm/irq_64.h as below
> >
> > void arch_trigger_all_cpu_backtrace(bool);
> > #define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
> >
> > I guess this is used for conditional compile.
> > See below.
> > include/linux/nmi.h
> > #ifdef arch_trigger_all_cpu_backtrace
> > static inline bool trigger_all_cpu_backtrace(void)
> > {
> > arch_trigger_all_cpu_backtrace(true);
> >
> > return true;
> > }
> > static inline bool trigger_allbutself_cpu_backtrace(void)
> > {
> > arch_trigger_all_cpu_backtrace(false);
> > return true;
> > }
> > #else
> > static inline bool trigger_all_cpu_backtrace(void)
> > {
> > return false;
> > }
> > static inline bool trigger_allbutself_cpu_backtrace(void)
> > {
> > return false;
> > }
> > #endif
> >
> > Thanks.
> >> John
> >
>
> i don't see how this is required for conditional compiles. the code
> define a->a which is bogus i think.
It's a pretty common pattern in the asm headers, in order to allow
generic code to use the preprocessor to see whether it was defined or
not.
Cheers
James
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: [PATCH] mips: add arch_trigger_all_cpu_backtrace() function
@ 2014-10-23 0:29 Eunbong Song
0 siblings, 0 replies; 5+ messages in thread
From: Eunbong Song @ 2014-10-23 0:29 UTC (permalink / raw)
To: James Hogan
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org,
linux-kernel@vger.kernel.org
>> This patch adds arch_trigger_all_cpu_backtrace() for mips architecture.
> Don't forget your Signed-off-by
I'm sorry fot this.
>> +static void arch_dump_stack(void *info)
>> +{
>> + struct pt_regs *regs;
>> +
>> + regs = get_irq_regs();
>> +
>> + if(regs)
>> + show_regs(regs);
>> +
>> + dump_stack();
>> +}
>> +
>> +void arch_trigger_all_cpu_backtrace(bool include_self)
>> +{
>> + smp_call_function(arch_dump_stack, NULL, 1);
> should this call arch_dump_stack directly too if include_self?
Currently, in case of mips there is no case include_self is true, so this is not a problem.
arch_trigger_all_cpu_backtrace can only be called from trigger_allbutself_cpu_backtrace() in kernel/watchdog.c.
But as you said, if the case will be added, we should consider that.
Thanks.
> Cheers
> James
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-10-23 0:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-22 6:54 Re: [PATCH] mips: add arch_trigger_all_cpu_backtrace() function Eunbong Song
2014-10-22 7:11 ` John Crispin
2014-10-22 22:29 ` James Hogan
2014-10-22 22:29 ` James Hogan
-- strict thread matches above, loose matches on Subject: below --
2014-10-23 0:29 Eunbong Song
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox