From: Doug Anderson <dianders@chromium.org>
To: Sumit Garg <sumit.garg@linaro.org>
Cc: kgdb-bugreport@lists.sourceforge.net,
Daniel Thompson <daniel.thompson@linaro.org>,
Jason Wessel <jason.wessel@windriver.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] kdb: Simplify kdb_defcmd macro logic
Date: Thu, 20 May 2021 10:21:11 -0700 [thread overview]
Message-ID: <CAD=FV=W6gnqDoOCMsDTvP4_yS_szEa2g3_rhDG82ZpDTv6e5MA@mail.gmail.com> (raw)
In-Reply-To: <20210513112842.707103-3-sumit.garg@linaro.org>
Hi,
On Thu, May 13, 2021 at 4:29 AM Sumit Garg <sumit.garg@linaro.org> wrote:
>
> Switch to use a linked list instead of dynamic array which makes
> allocation of kdb macro and traversing the kdb macro commands list
> simpler.
>
> Suggested-by: Daniel Thompson <daniel.thompson@linaro.org>
> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> ---
> kernel/debug/kdb/kdb_main.c | 107 +++++++++++++++++++-----------------
> 1 file changed, 58 insertions(+), 49 deletions(-)
>
> diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
> index de685b2a8ce7..ce7f4c71992d 100644
> --- a/kernel/debug/kdb/kdb_main.c
> +++ b/kernel/debug/kdb/kdb_main.c
> @@ -654,13 +654,16 @@ static void kdb_cmderror(int diag)
> * zero for success, a kdb diagnostic if error
> */
> struct kdb_macro_t {
> - int count;
> - bool usable;
> - kdbtab_t cmd;
> - char **command;
> + kdbtab_t cmd; /* Macro command name */
It's more than just the name, right?
> + struct list_head commands; /* Associated command list */
I get confused between the two different usages of "command". Can we
call the individual entries of a macro "statements". So this would be:
struct list_head statements; /* Associated statement list */
...and the structure below would get renamed as well.
> };
> +
> +struct kdb_macro_cmd_t {
> + char *cmd; /* Command name */
This isn't the "name" of the command, is it? It's the actual statement
that the user entered?
Other than that, this looks like a nice patch to me.
-Doug
prev parent reply other threads:[~2021-05-20 17:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-13 11:28 [PATCH v3 0/2] kdb code refactoring Sumit Garg
2021-05-13 11:28 ` [PATCH v3 1/2] kdb: Get rid of redundant kdb_register_flags() Sumit Garg
2021-05-13 11:31 ` Sumit Garg
2021-05-13 13:19 ` Steven Rostedt
2021-05-20 17:20 ` Doug Anderson
2021-06-17 11:49 ` Sumit Garg
2021-05-13 11:28 ` [PATCH v3 2/2] kdb: Simplify kdb_defcmd macro logic Sumit Garg
2021-05-20 17:21 ` Doug Anderson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAD=FV=W6gnqDoOCMsDTvP4_yS_szEa2g3_rhDG82ZpDTv6e5MA@mail.gmail.com' \
--to=dianders@chromium.org \
--cc=daniel.thompson@linaro.org \
--cc=jason.wessel@windriver.com \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=sumit.garg@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).