[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=W6gnqDoOCMsDTvP4_yS_szEa2g3_rhDG82ZpDTv6e5MA@mail.gmail.com>
Date: Thu, 20 May 2021 10:21:11 -0700
From: Doug Anderson <dianders@...omium.org>
To: Sumit Garg <sumit.garg@...aro.org>
Cc: kgdb-bugreport@...ts.sourceforge.net,
Daniel Thompson <daniel.thompson@...aro.org>,
Jason Wessel <jason.wessel@...driver.com>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/2] kdb: Simplify kdb_defcmd macro logic
Hi,
On Thu, May 13, 2021 at 4:29 AM Sumit Garg <sumit.garg@...aro.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@...aro.org>
> Signed-off-by: Sumit Garg <sumit.garg@...aro.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
Powered by blists - more mailing lists