* [PATCH] Add hard/soft lockup debugger entry points
@ 2016-01-26 2:36 Jeff Merkey
2016-01-26 2:47 ` Chris Metcalf
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Jeff Merkey @ 2016-01-26 2:36 UTC (permalink / raw)
To: linux-kernel
Cc: Andrew Morton, Don Zickus, Ulrich Obergfell, Aaron Tomlin,
Michal Hocko, Frederic Weisbecker, Tejun Heo, Hidehiro Kawai,
Chris Metcalf
This patch adds an export which can be set by system debuggers to direct
the hard lockup and soft lockup detector to trigger an INT3 exception
and enter a debugger if one is active. It is assumed that if someone
sets this variable, then an int3 handler of some sort will be actively
loaded or registered via the notify die handler chain.
This addition is extremely useful for debugging hard and soft lockups
real time and quickly from a console debugger.
Signed-off-by: Jeff Merkey <linux.mdb@gmail.com>
---
kernel/watchdog.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index b3ace6e..f927722 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -108,6 +108,9 @@ static DEFINE_PER_CPU(struct perf_event *, watchdog_ev);
#endif
static unsigned long soft_lockup_nmi_warn;
+int debug_watchdog_lockups;
+EXPORT_SYMBOL_GPL(debug_watchdog_lockups);
+
/* boot commands */
/*
* Should we panic when a soft-lockup or hard-lockup occurs:
@@ -358,6 +361,9 @@ static void watchdog_overflow_callback(struct perf_event *event,
else
dump_stack();
+ if (debug_watchdog_lockups)
+ __asm__ __volatile__ ("int $0x03");
+
/*
* Perform all-CPU dump only once to avoid multiple hardlockups
* generating interleaving traces
@@ -478,6 +484,9 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
else
dump_stack();
+ if (debug_watchdog_lockups)
+ __asm__ __volatile__ ("int $0x03");
+
if (softlockup_all_cpu_backtrace) {
/* Avoid generating two back traces for current
* given that one is already made above
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Add hard/soft lockup debugger entry points
2016-01-26 2:36 [PATCH] Add hard/soft lockup debugger entry points Jeff Merkey
@ 2016-01-26 2:47 ` Chris Metcalf
2016-01-26 2:58 ` Jeff Merkey
2016-01-26 4:02 ` kbuild test robot
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Chris Metcalf @ 2016-01-26 2:47 UTC (permalink / raw)
To: Jeff Merkey, linux-kernel
Cc: Andrew Morton, Don Zickus, Ulrich Obergfell, Aaron Tomlin,
Michal Hocko, Frederic Weisbecker, Tejun Heo, Hidehiro Kawai
On 1/25/2016 9:36 PM, Jeff Merkey wrote:
> This patch adds an export which can be set by system debuggers to direct
> the hard lockup and soft lockup detector to trigger an INT3 exception
> and enter a debugger if one is active. It is assumed that if someone
> sets this variable, then an int3 handler of some sort will be actively
> loaded or registered via the notify die handler chain.
>
> This addition is extremely useful for debugging hard and soft lockups
> real time and quickly from a console debugger.
>
> Signed-off-by: Jeff Merkey<linux.mdb@gmail.com>
> ---
> kernel/watchdog.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
Introducing Intel-specific assembly into generic code won't work. You would
need to add a framework to allow platforms to specify a debugging instruction
or maybe leverage some existing framework like arch_kgdb_breakpoint.
--
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Add hard/soft lockup debugger entry points
2016-01-26 2:47 ` Chris Metcalf
@ 2016-01-26 2:58 ` Jeff Merkey
0 siblings, 0 replies; 7+ messages in thread
From: Jeff Merkey @ 2016-01-26 2:58 UTC (permalink / raw)
To: Chris Metcalf
Cc: linux-kernel, Andrew Morton, Don Zickus, Ulrich Obergfell,
Aaron Tomlin, Michal Hocko, Frederic Weisbecker, Tejun Heo,
Hidehiro Kawai
On 1/25/16, Chris Metcalf <cmetcalf@ezchip.com> wrote:
> On 1/25/2016 9:36 PM, Jeff Merkey wrote:
>> This patch adds an export which can be set by system debuggers to direct
>> the hard lockup and soft lockup detector to trigger an INT3 exception
>> and enter a debugger if one is active. It is assumed that if someone
>> sets this variable, then an int3 handler of some sort will be actively
>> loaded or registered via the notify die handler chain.
>>
>> This addition is extremely useful for debugging hard and soft lockups
>> real time and quickly from a console debugger.
>>
>> Signed-off-by: Jeff Merkey<linux.mdb@gmail.com>
>> ---
>> kernel/watchdog.c | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>
> Introducing Intel-specific assembly into generic code won't work. You would
> need to add a framework to allow platforms to specify a debugging
> instruction
> or maybe leverage some existing framework like arch_kgdb_breakpoint.
>
> --
> Chris Metcalf, EZChip Semiconductor
> http://www.ezchip.com
>
>
Yep. I'll start on v2.
Jeff
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Add hard/soft lockup debugger entry points
2016-01-26 2:36 [PATCH] Add hard/soft lockup debugger entry points Jeff Merkey
2016-01-26 2:47 ` Chris Metcalf
@ 2016-01-26 4:02 ` kbuild test robot
2016-01-26 4:23 ` kbuild test robot
2016-01-26 4:27 ` kbuild test robot
3 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2016-01-26 4:02 UTC (permalink / raw)
To: Jeff Merkey
Cc: kbuild-all, linux-kernel, Andrew Morton, Don Zickus,
Ulrich Obergfell, Aaron Tomlin, Michal Hocko, Frederic Weisbecker,
Tejun Heo, Hidehiro Kawai, Chris Metcalf
[-- Attachment #1: Type: text/plain, Size: 970 bytes --]
Hi Jeff,
[auto build test ERROR on v4.5-rc1]
[also build test ERROR on next-20160125]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Jeff-Merkey/Add-hard-soft-lockup-debugger-entry-points/20160126-103801
config: powerpc-defconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc
All errors (new ones prefixed by >>):
{standard input}: Assembler messages:
>> {standard input}:550: Error: unrecognized opcode: `int'
{standard input}:1121: Error: unrecognized opcode: `int'
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 21912 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Add hard/soft lockup debugger entry points
2016-01-26 2:36 [PATCH] Add hard/soft lockup debugger entry points Jeff Merkey
2016-01-26 2:47 ` Chris Metcalf
2016-01-26 4:02 ` kbuild test robot
@ 2016-01-26 4:23 ` kbuild test robot
2016-01-26 4:27 ` kbuild test robot
3 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2016-01-26 4:23 UTC (permalink / raw)
To: Jeff Merkey
Cc: kbuild-all, linux-kernel, Andrew Morton, Don Zickus,
Ulrich Obergfell, Aaron Tomlin, Michal Hocko, Frederic Weisbecker,
Tejun Heo, Hidehiro Kawai, Chris Metcalf
[-- Attachment #1: Type: text/plain, Size: 916 bytes --]
Hi Jeff,
[auto build test ERROR on v4.5-rc1]
[also build test ERROR on next-20160125]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Jeff-Merkey/Add-hard-soft-lockup-debugger-entry-points/20160126-103801
config: arm64-defconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64
All errors (new ones prefixed by >>):
/tmp/cc3NhccY.s: Assembler messages:
>> /tmp/cc3NhccY.s:1030: Error: unknown mnemonic `int' -- `int $0x03'
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 20865 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Add hard/soft lockup debugger entry points
2016-01-26 2:36 [PATCH] Add hard/soft lockup debugger entry points Jeff Merkey
` (2 preceding siblings ...)
2016-01-26 4:23 ` kbuild test robot
@ 2016-01-26 4:27 ` kbuild test robot
2016-01-26 4:55 ` Jeff Merkey
3 siblings, 1 reply; 7+ messages in thread
From: kbuild test robot @ 2016-01-26 4:27 UTC (permalink / raw)
To: Jeff Merkey
Cc: kbuild-all, linux-kernel, Andrew Morton, Don Zickus,
Ulrich Obergfell, Aaron Tomlin, Michal Hocko, Frederic Weisbecker,
Tejun Heo, Hidehiro Kawai, Chris Metcalf
[-- Attachment #1: Type: text/plain, Size: 905 bytes --]
Hi Jeff,
[auto build test ERROR on v4.5-rc1]
[also build test ERROR on next-20160125]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Jeff-Merkey/Add-hard-soft-lockup-debugger-entry-points/20160126-103801
config: sparc64-defconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sparc64
All errors (new ones prefixed by >>):
{standard input}: Assembler messages:
>> {standard input}:335: Error: Unknown opcode: `int'
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 16661 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Add hard/soft lockup debugger entry points
2016-01-26 4:27 ` kbuild test robot
@ 2016-01-26 4:55 ` Jeff Merkey
0 siblings, 0 replies; 7+ messages in thread
From: Jeff Merkey @ 2016-01-26 4:55 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, linux-kernel, Andrew Morton, Don Zickus,
Ulrich Obergfell, Aaron Tomlin, Michal Hocko, Frederic Weisbecker,
Tejun Heo, Hidehiro Kawai, Chris Metcalf
On 1/25/16, kbuild test robot <lkp@intel.com> wrote:
> Hi Jeff,
>
> [auto build test ERROR on v4.5-rc1]
> [also build test ERROR on next-20160125]
> [if your patch is applied to the wrong git tree, please drop us a note to
> help improving the system]
>
> url:
> https://github.com/0day-ci/linux/commits/Jeff-Merkey/Add-hard-soft-lockup-debugger-entry-points/20160126-103801
> config: sparc64-defconfig (attached as .config)
> reproduce:
> wget
> https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
> -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=sparc64
>
> All errors (new ones prefixed by >>):
>
> {standard input}: Assembler messages:
>>> {standard input}:335: Error: Unknown opcode: `int'
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology
> Center
> https://lists.01.org/pipermail/kbuild-all Intel
> Corporation
>
I am resubmitting this with the correct arch_hw_bp. Wow, That test
robot is very efficient.
Jeff
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-01-26 4:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-26 2:36 [PATCH] Add hard/soft lockup debugger entry points Jeff Merkey
2016-01-26 2:47 ` Chris Metcalf
2016-01-26 2:58 ` Jeff Merkey
2016-01-26 4:02 ` kbuild test robot
2016-01-26 4:23 ` kbuild test robot
2016-01-26 4:27 ` kbuild test robot
2016-01-26 4:55 ` Jeff Merkey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox