Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1320969 > unrolled thread

[PATCH 27/31] Add debugger entry points for M68K

Started byJeffrey Merkey <jeffmerkey@gmail.com>
First post2016-01-28 20:50 +0100
Last post2016-01-28 22:30 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 27/31] Add debugger entry points for M68K Jeffrey Merkey <jeffmerkey@gmail.com> - 2016-01-28 20:50 +0100
    Re: [PATCH 27/31] Add debugger entry points for M68K Jeffrey Merkey <jeffmerkey@gmail.com> - 2016-01-28 21:50 +0100
    Re: [PATCH 27/31] Add debugger entry points for M68K Geert Uytterhoeven <geert@linux-m68k.org> - 2016-01-28 21:50 +0100
    Re: [PATCH 27/31] Add debugger entry points for M68K kbuild test robot <lkp@intel.com> - 2016-01-28 22:30 +0100

#1320969 — [PATCH 27/31] Add debugger entry points for M68K

FromJeffrey Merkey <jeffmerkey@gmail.com>
Date2016-01-28 20:50 +0100
Subject[PATCH 27/31] Add debugger entry points for M68K
Message-ID<qW0JP-8ef-7@gated-at.bofh.it>
This patch series adds an export which can be set by system debuggers to
direct the hard lockup and soft lockup detector to trigger a breakpoint
exception and enter a debugger if one is active.  It is assumed that if
someone sets this variable, then an breakpoint 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: Jeffrey Merkey <jeffmerkey@gmail.com>
---
 arch/m68k/include/asm/kdebug.h | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 arch/m68k/include/asm/kdebug.h

diff --git a/arch/m68k/include/asm/kdebug.h b/arch/m68k/include/asm/kdebug.h
new file mode 100644
index 0000000..5d09de1
--- /dev/null
+++ b/arch/m68k/include/asm/kdebug.h
@@ -0,0 +1,4 @@
+
+static inline void arch_breakpoint(void)
+{
+}
-- 
1.8.3.1

[toc] | [next] | [standalone]


#1321045

FromJeffrey Merkey <jeffmerkey@gmail.com>
Date2016-01-28 21:50 +0100
Message-ID<qW1FU-qH-31@gated-at.bofh.it>
In reply to#1320969
On 1/28/16, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Hi Jeffrey,
>
> CC linux-arch
>
> On Thu, Jan 28, 2016 at 8:47 PM, Jeffrey Merkey <jeffmerkey@gmail.com>
> wrote:
>> This patch series adds an export which can be set by system debuggers to
>> direct the hard lockup and soft lockup detector to trigger a breakpoint
>> exception and enter a debugger if one is active.  It is assumed that if
>> someone sets this variable, then an breakpoint 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.
>
> As there's no cover letter, I'm giving my (mostly general) comments in a
> reply to this patch.
>
>> Signed-off-by: Jeffrey Merkey <jeffmerkey@gmail.com>
>> ---
>>  arch/m68k/include/asm/kdebug.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>>  create mode 100644 arch/m68k/include/asm/kdebug.h
>>
>> diff --git a/arch/m68k/include/asm/kdebug.h
>> b/arch/m68k/include/asm/kdebug.h
>> new file mode 100644
>> index 0000000..5d09de1
>> --- /dev/null
>> +++ b/arch/m68k/include/asm/kdebug.h
>> @@ -0,0 +1,4 @@
>> +
>> +static inline void arch_breakpoint(void)
>> +{
>> +}
>
> No include guards in the newly added header files?
>
> This new file will conflict with arch/m68k/include/asm/Kbuild, which has:
>
>     generic-y += kdebug.h
>
> What about putting the dummy arch_breakpoint() in
> include/asm-generic/kdebug.h
> instead, like
>
>     #ifndef arch_breakpoint
>     static inline void arch_breakpoint(void)
>     {
>     }
>     #endif
>
> Architectures providing their own version have to #define arch_breakpoint.
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 --
> geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker.
> But
> when I'm talking to journalists I just say "programmer" or something like
> that.
>                                 -- Linus Torvalds
>

That's a great idea and suggestion.  I'll move it to the asm-generic
directory and files and look it implementing it as a macro.  This
suggestion is added to the list of changes for the next version of
this patch series.

:-)

Jeff

[toc] | [prev] | [next] | [standalone]


#1321046

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-01-28 21:50 +0100
Message-ID<qW1FU-qH-29@gated-at.bofh.it>
In reply to#1320969
Hi Jeffrey,

CC linux-arch

On Thu, Jan 28, 2016 at 8:47 PM, Jeffrey Merkey <jeffmerkey@gmail.com> wrote:
> This patch series adds an export which can be set by system debuggers to
> direct the hard lockup and soft lockup detector to trigger a breakpoint
> exception and enter a debugger if one is active.  It is assumed that if
> someone sets this variable, then an breakpoint 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.

As there's no cover letter, I'm giving my (mostly general) comments in a
reply to this patch.

> Signed-off-by: Jeffrey Merkey <jeffmerkey@gmail.com>
> ---
>  arch/m68k/include/asm/kdebug.h | 4 ++++
>  1 file changed, 4 insertions(+)
>  create mode 100644 arch/m68k/include/asm/kdebug.h
>
> diff --git a/arch/m68k/include/asm/kdebug.h b/arch/m68k/include/asm/kdebug.h
> new file mode 100644
> index 0000000..5d09de1
> --- /dev/null
> +++ b/arch/m68k/include/asm/kdebug.h
> @@ -0,0 +1,4 @@
> +
> +static inline void arch_breakpoint(void)
> +{
> +}

No include guards in the newly added header files?

This new file will conflict with arch/m68k/include/asm/Kbuild, which has:

    generic-y += kdebug.h

What about putting the dummy arch_breakpoint() in include/asm-generic/kdebug.h
instead, like

    #ifndef arch_breakpoint
    static inline void arch_breakpoint(void)
    {
    }
    #endif

Architectures providing their own version have to #define arch_breakpoint.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

[toc] | [prev] | [next] | [standalone]


#1321072

Fromkbuild test robot <lkp@intel.com>
Date2016-01-28 22:30 +0100
Message-ID<qW2iC-UG-17@gated-at.bofh.it>
In reply to#1320969

[Multipart message — attachments visible in raw view] — view raw

Hi Jeffrey,

[auto build test ERROR on v4.5-rc1]
[also build test ERROR on next-20160128]
[cannot apply to tip/x86/core]
[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/Jeffrey-Merkey/Add-hard-soft-lockup-debugger-entry-points/20160129-035852
config: m68k-sun3_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=m68k 

All error/warnings (new ones prefixed by >>):

   In file included from kernel/notifier.c:1:0:
>> include/linux/kdebug.h:20:16: warning: 'enum die_val' declared inside parameter list
            struct pt_regs *regs, long err, int trap, int sig);
                   ^
>> include/linux/kdebug.h:20:16: warning: its scope is only this definition or declaration, which is probably not what you want
>> kernel/notifier.c:537:16: warning: 'enum die_val' declared inside parameter list
            struct pt_regs *regs, long err, int trap, int sig)
                   ^
>> kernel/notifier.c:536:37: error: parameter 1 ('val') has incomplete type
    int notrace notify_die(enum die_val val, const char *str,
                                        ^
   kernel/notifier.c: In function 'notify_die':
>> kernel/notifier.c:550:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^

vim +20 include/linux/kdebug.h

1eeb66a1 Christoph Hellwig 2007-05-08   4  #include <asm/kdebug.h>
1eeb66a1 Christoph Hellwig 2007-05-08   5  
fe9844d5 Andrew Morton     2007-07-31   6  struct notifier_block;
fe9844d5 Andrew Morton     2007-07-31   7  
1eeb66a1 Christoph Hellwig 2007-05-08   8  struct die_args {
1eeb66a1 Christoph Hellwig 2007-05-08   9  	struct pt_regs *regs;
1eeb66a1 Christoph Hellwig 2007-05-08  10  	const char *str;
1eeb66a1 Christoph Hellwig 2007-05-08  11  	long err;
1eeb66a1 Christoph Hellwig 2007-05-08  12  	int trapnr;
1eeb66a1 Christoph Hellwig 2007-05-08  13  	int signr;
1eeb66a1 Christoph Hellwig 2007-05-08  14  };
1eeb66a1 Christoph Hellwig 2007-05-08  15  
1eeb66a1 Christoph Hellwig 2007-05-08  16  int register_die_notifier(struct notifier_block *nb);
1eeb66a1 Christoph Hellwig 2007-05-08  17  int unregister_die_notifier(struct notifier_block *nb);
1eeb66a1 Christoph Hellwig 2007-05-08  18  
1eeb66a1 Christoph Hellwig 2007-05-08  19  int notify_die(enum die_val val, const char *str,
1eeb66a1 Christoph Hellwig 2007-05-08 @20  	       struct pt_regs *regs, long err, int trap, int sig);
1eeb66a1 Christoph Hellwig 2007-05-08  21  
1eeb66a1 Christoph Hellwig 2007-05-08  22  #endif /* _LINUX_KDEBUG_H */

:::::: The code at line 20 was first introduced by commit
:::::: 1eeb66a1bb973534dc3d064920a5ca683823372e move die notifier handling to common code

:::::: TO: Christoph Hellwig <hch@lst.de>
:::::: CC: Linus Torvalds <torvalds@woody.linux-foundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web