mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH v3] kdb: Simplify kdb commands registration
       [not found] <1611915427-3196-1-git-send-email-sumit.garg@linaro.org>
@ 2021-02-08  9:43 ` Daniel Thompson
  2021-02-08  9:48   ` Sumit Garg
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Thompson @ 2021-02-08  9:43 UTC (permalink / raw)
  To: Sumit Garg; +Cc: kgdb-bugreport, jason.wessel, dianders, linux-kernel

On Fri, Jan 29, 2021 at 03:47:07PM +0530, Sumit Garg wrote:
> @@ -1011,25 +1005,17 @@ int kdb_parse(const char *cmdstr)
>  		++argv[0];
>  	}
>  
> -	for_each_kdbcmd(tp, i) {
> -		if (tp->cmd_name) {
> -			/*
> -			 * If this command is allowed to be abbreviated,
> -			 * check to see if this is it.
> -			 */
> -
> -			if (tp->cmd_minlen
> -			 && (strlen(argv[0]) <= tp->cmd_minlen)) {
> -				if (strncmp(argv[0],
> -					    tp->cmd_name,
> -					    tp->cmd_minlen) == 0) {
> -					break;
> -				}
> -			}
> -
> -			if (strcmp(argv[0], tp->cmd_name) == 0)
> +	list_for_each_entry(tp, &kdb_cmds_head, list_node) {
> +		/*
> +		 * If this command is allowed to be abbreviated,
> +		 * check to see if this is it.
> +		 */
> +		if (tp->cmd_minlen && (strlen(argv[0]) <= tp->cmd_minlen) &&
> +		    (strncmp(argv[0], tp->cmd_name, tp->cmd_minlen) == 0))
>  				break;

Looks like you forgot to unindent this line.

I will fix it up but... checkpatch would have found this.


Daniel.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] kdb: Simplify kdb commands registration
  2021-02-08  9:43 ` [PATCH v3] kdb: Simplify kdb commands registration Daniel Thompson
@ 2021-02-08  9:48   ` Sumit Garg
  2021-02-08 13:48     ` Daniel Thompson
  0 siblings, 1 reply; 4+ messages in thread
From: Sumit Garg @ 2021-02-08  9:48 UTC (permalink / raw)
  To: Daniel Thompson
  Cc: kgdb-bugreport, Jason Wessel, Douglas Anderson,
	Linux Kernel Mailing List

On Mon, 8 Feb 2021 at 15:13, Daniel Thompson <daniel.thompson@linaro.org> wrote:
>
> On Fri, Jan 29, 2021 at 03:47:07PM +0530, Sumit Garg wrote:
> > @@ -1011,25 +1005,17 @@ int kdb_parse(const char *cmdstr)
> >               ++argv[0];
> >       }
> >
> > -     for_each_kdbcmd(tp, i) {
> > -             if (tp->cmd_name) {
> > -                     /*
> > -                      * If this command is allowed to be abbreviated,
> > -                      * check to see if this is it.
> > -                      */
> > -
> > -                     if (tp->cmd_minlen
> > -                      && (strlen(argv[0]) <= tp->cmd_minlen)) {
> > -                             if (strncmp(argv[0],
> > -                                         tp->cmd_name,
> > -                                         tp->cmd_minlen) == 0) {
> > -                                     break;
> > -                             }
> > -                     }
> > -
> > -                     if (strcmp(argv[0], tp->cmd_name) == 0)
> > +     list_for_each_entry(tp, &kdb_cmds_head, list_node) {
> > +             /*
> > +              * If this command is allowed to be abbreviated,
> > +              * check to see if this is it.
> > +              */
> > +             if (tp->cmd_minlen && (strlen(argv[0]) <= tp->cmd_minlen) &&
> > +                 (strncmp(argv[0], tp->cmd_name, tp->cmd_minlen) == 0))
> >                               break;
>
> Looks like you forgot to unindent this line.
>
> I will fix it up but... checkpatch would have found this.
>

Ah, I missed to run checkpatch on v3. Thanks for fixing this up.

-Sumit

>
> Daniel.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] kdb: Simplify kdb commands registration
  2021-02-08  9:48   ` Sumit Garg
@ 2021-02-08 13:48     ` Daniel Thompson
  2021-02-09 11:07       ` Sumit Garg
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Thompson @ 2021-02-08 13:48 UTC (permalink / raw)
  To: Sumit Garg
  Cc: kgdb-bugreport, Jason Wessel, Douglas Anderson,
	Linux Kernel Mailing List

On Mon, Feb 08, 2021 at 03:18:19PM +0530, Sumit Garg wrote:
> On Mon, 8 Feb 2021 at 15:13, Daniel Thompson <daniel.thompson@linaro.org> wrote:
> >
> > On Fri, Jan 29, 2021 at 03:47:07PM +0530, Sumit Garg wrote:
> > > @@ -1011,25 +1005,17 @@ int kdb_parse(const char *cmdstr)
> > >               ++argv[0];
> > >       }
> > >
> > > -     for_each_kdbcmd(tp, i) {
> > > -             if (tp->cmd_name) {
> > > -                     /*
> > > -                      * If this command is allowed to be abbreviated,
> > > -                      * check to see if this is it.
> > > -                      */
> > > -
> > > -                     if (tp->cmd_minlen
> > > -                      && (strlen(argv[0]) <= tp->cmd_minlen)) {
> > > -                             if (strncmp(argv[0],
> > > -                                         tp->cmd_name,
> > > -                                         tp->cmd_minlen) == 0) {
> > > -                                     break;
> > > -                             }
> > > -                     }
> > > -
> > > -                     if (strcmp(argv[0], tp->cmd_name) == 0)
> > > +     list_for_each_entry(tp, &kdb_cmds_head, list_node) {
> > > +             /*
> > > +              * If this command is allowed to be abbreviated,
> > > +              * check to see if this is it.
> > > +              */
> > > +             if (tp->cmd_minlen && (strlen(argv[0]) <= tp->cmd_minlen) &&
> > > +                 (strncmp(argv[0], tp->cmd_name, tp->cmd_minlen) == 0))
> > >                               break;
> >
> > Looks like you forgot to unindent this line.
> >
> > I will fix it up but... checkpatch would have found this.
> >
> 
> Ah, I missed to run checkpatch on v3. Thanks for fixing this up.

Unfortunately, it's not just checkpatch. This patch also causes a
large number of test suite regressions. In particular it looks like
kgdbwait does not work with this patch applied.

The problem occurs on multiple architectures all with
close-to-defconfig kernels. However to share one specific
failure, x86_64_defconfig plus the following is not bootable:

    ../scripts/config --enable DEBUG_INFO --enable DEBUG_FS \
      --enable KALLSYMS_ALL --enable MAGIC_SYSRQ --enable KGDB \
      --enable KGDB_TESTS --enable KGDB_KDB --enable KDB_KEYBOARD \
      --enable LKDTM

Try:

    qemu-system-x86_64 \
      -enable-kvm -m 1G -smp 2 -nographic
      -kernel arch/x86/boot/bzImage \
      -append "console=ttyS0,115200 kgdboc=ttyS0 kgdbwait"


Daniel.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] kdb: Simplify kdb commands registration
  2021-02-08 13:48     ` Daniel Thompson
@ 2021-02-09 11:07       ` Sumit Garg
  0 siblings, 0 replies; 4+ messages in thread
From: Sumit Garg @ 2021-02-09 11:07 UTC (permalink / raw)
  To: Daniel Thompson
  Cc: kgdb-bugreport, Jason Wessel, Douglas Anderson,
	Linux Kernel Mailing List

On Mon, 8 Feb 2021 at 19:18, Daniel Thompson <daniel.thompson@linaro.org> wrote:
>
> On Mon, Feb 08, 2021 at 03:18:19PM +0530, Sumit Garg wrote:
> > On Mon, 8 Feb 2021 at 15:13, Daniel Thompson <daniel.thompson@linaro.org> wrote:
> > >
> > > On Fri, Jan 29, 2021 at 03:47:07PM +0530, Sumit Garg wrote:
> > > > @@ -1011,25 +1005,17 @@ int kdb_parse(const char *cmdstr)
> > > >               ++argv[0];
> > > >       }
> > > >
> > > > -     for_each_kdbcmd(tp, i) {
> > > > -             if (tp->cmd_name) {
> > > > -                     /*
> > > > -                      * If this command is allowed to be abbreviated,
> > > > -                      * check to see if this is it.
> > > > -                      */
> > > > -
> > > > -                     if (tp->cmd_minlen
> > > > -                      && (strlen(argv[0]) <= tp->cmd_minlen)) {
> > > > -                             if (strncmp(argv[0],
> > > > -                                         tp->cmd_name,
> > > > -                                         tp->cmd_minlen) == 0) {
> > > > -                                     break;
> > > > -                             }
> > > > -                     }
> > > > -
> > > > -                     if (strcmp(argv[0], tp->cmd_name) == 0)
> > > > +     list_for_each_entry(tp, &kdb_cmds_head, list_node) {
> > > > +             /*
> > > > +              * If this command is allowed to be abbreviated,
> > > > +              * check to see if this is it.
> > > > +              */
> > > > +             if (tp->cmd_minlen && (strlen(argv[0]) <= tp->cmd_minlen) &&
> > > > +                 (strncmp(argv[0], tp->cmd_name, tp->cmd_minlen) == 0))
> > > >                               break;
> > >
> > > Looks like you forgot to unindent this line.
> > >
> > > I will fix it up but... checkpatch would have found this.
> > >
> >
> > Ah, I missed to run checkpatch on v3. Thanks for fixing this up.
>
> Unfortunately, it's not just checkpatch. This patch also causes a
> large number of test suite regressions. In particular it looks like
> kgdbwait does not work with this patch applied.
>
> The problem occurs on multiple architectures all with
> close-to-defconfig kernels. However to share one specific
> failure, x86_64_defconfig plus the following is not bootable:
>
>     ../scripts/config --enable DEBUG_INFO --enable DEBUG_FS \
>       --enable KALLSYMS_ALL --enable MAGIC_SYSRQ --enable KGDB \
>       --enable KGDB_TESTS --enable KGDB_KDB --enable KDB_KEYBOARD \
>       --enable LKDTM
>
> Try:
>
>     qemu-system-x86_64 \
>       -enable-kvm -m 1G -smp 2 -nographic
>       -kernel arch/x86/boot/bzImage \
>       -append "console=ttyS0,115200 kgdboc=ttyS0 kgdbwait"
>

Thanks Daniel for this report. I am able to reproduce it with
"kgdbwait" and will investigate it.

-Sumit

>
> Daniel.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-09 11:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1611915427-3196-1-git-send-email-sumit.garg@linaro.org>
2021-02-08  9:43 ` [PATCH v3] kdb: Simplify kdb commands registration Daniel Thompson
2021-02-08  9:48   ` Sumit Garg
2021-02-08 13:48     ` Daniel Thompson
2021-02-09 11:07       ` Sumit Garg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®