From: Steven Rostedt <rostedt@goodmis.org>
To: Daniel Thompson <daniel.thompson@linaro.org>
Cc: kgdb-bugreport@lists.sourceforge.net,
Jason Wessel <jason.wessel@windriver.com>,
patches@linaro.org, linaro-kernel@lists.linaro.org,
linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.cz>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>,
John Stultz <john.stultz@linaro.org>,
Anton Vorontsov <anton.vorontsov@linaro.org>,
Colin Cross <ccross@android.com>,
kernel-team@android.com
Subject: Re: [RFC v3 7/9] kdb: Categorize kdb commands (similar to SysRq categorization)
Date: Fri, 25 Apr 2014 12:57:35 -0400 [thread overview]
Message-ID: <20140425125735.334add30@gandalf.local.home> (raw)
In-Reply-To: <1398443370-12668-8-git-send-email-daniel.thompson@linaro.org>
On Fri, 25 Apr 2014 17:29:28 +0100
Daniel Thompson <daniel.thompson@linaro.org> wrote:
> This patch introduces several new flags to collect kdb commands into
> groups (later allowing them to be optionally disabled).
>
> This follows similar prior art to enable/disable magic sysrq
> commands.
>
> The commands have been categorized as follows:
>
> Always on: go (w/o args), env, set, help, ?, cpu (w/o args), sr,
> dmesg, disable_nmi, defcmd, summary, grephelp
> Mem read: md, mdr, mdp, mds, ef, bt (with args), per_cpu
> Mem write: mm
> Reg read: rd
> Reg write: go (with args), rm
> Inspect: bt (w/o args), btp, bta, btc, btt, ps, pid, lsmod
> Flow ctrl: bp, bl, bph, bc, be, bd, ss
> Signal: kill
> Reboot: reboot
> All: cpu, kgdb, (and all of the above), nmi_console
>
> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
> ---
> include/linux/kdb.h | 52 ++++++++++++++++++++++-
> kernel/debug/kdb/kdb_bp.c | 21 ++++++----
> kernel/debug/kdb/kdb_main.c | 100 +++++++++++++++++++++++++++++---------------
> kernel/trace/trace_kdb.c | 2 +-
> 4 files changed, 132 insertions(+), 43 deletions(-)
>
> diff --git a/include/linux/kdb.h b/include/linux/kdb.h
> index 4b656d6..2f65c7a 100644
> --- a/include/linux/kdb.h
> +++ b/include/linux/kdb.h
> @@ -14,10 +14,58 @@
> */
>
> typedef enum {
> - KDB_REPEAT_NO_ARGS = 0x1, /* Repeat the command w/o arguments */
> - KDB_REPEAT_WITH_ARGS = 0x2, /* Repeat the command w/ its arguments */
> + KDB_ENABLE_ALL = 0x00000001, /* Enable everything */
> + KDB_ENABLE_MEM_READ = 0x00000002,
> + KDB_ENABLE_MEM_WRITE = 0x00000004,
> + KDB_ENABLE_REG_READ = 0x00000008,
> + KDB_ENABLE_REG_WRITE = 0x00000010,
> + KDB_ENABLE_INSPECT = 0x00000020,
> + KDB_ENABLE_FLOW_CTRL = 0x00000040,
> + KDB_ENABLE_SIGNAL = 0x00000080,
> + KDB_ENABLE_REBOOT = 0x00000100,
> + /* User exposed values stop here, all remaining flags are
> + * exclusively used to describe a commands behaviour.
> + */
> +
> + KDB_ENABLE_ALWAYS_SAFE = 0x00000200,
> + KDB_ENABLE_MASK = 0x000003ff,
> +
> + KDB_ENABLE_ALL_NO_ARGS = KDB_ENABLE_ALL << 16,
> + KDB_ENABLE_MEM_READ_NO_ARGS = KDB_ENABLE_MEM_READ << 16,
> + KDB_ENABLE_MEM_WRITE_NO_ARGS = KDB_ENABLE_MEM_WRITE << 16,
> + KDB_ENABLE_REG_READ_NO_ARGS = KDB_ENABLE_REG_READ << 16,
> + KDB_ENABLE_REG_WRITE_NO_ARGS = KDB_ENABLE_REG_WRITE << 16,
> + KDB_ENABLE_INSPECT_NO_ARGS = KDB_ENABLE_INSPECT << 16,
> + KDB_ENABLE_FLOW_CTRL_NO_ARGS = KDB_ENABLE_FLOW_CTRL << 16,
> + KDB_ENABLE_SIGNAL_NO_ARGS = KDB_ENABLE_SIGNAL << 16,
> + KDB_ENABLE_REBOOT_NO_ARGS = KDB_ENABLE_REBOOT << 16,
> + KDB_ENABLE_ALWAYS_SAFE_NO_ARGS = KDB_ENABLE_ALWAYS_SAFE << 16,
> + KDB_ENABLE_MASK_NO_ARGS = KDB_ENABLE_MASK << 16,
I would recommend defining a KDB_NO_ARGS_SHIFT to be 16 and use that
instead of having a magic number 16 to deal with. This also makes it
easier if you need to shift a bit more in the future.
KDB_ENABLE_ALL_NO_ARGS = KDB_ENABLE_ALL << KDB_NO_ARGS_SHIFT,
Although, I'm not sure why you just didn't have a KDB_ENABLE_ARGS flag,
and then you don't need to repeat all the flags again. Seems rather
silly.
KDB_ENABLE_ALL_NO_ARGS would then be just
KDB_ENABLE_ALL|KDB_ENABLE_NO_ARGS.
Or can you have multiple settings? That is, MEM_READ and
MEM_WRITE_NO_ARGS both set such that you can't just have a simple args
or no args command for the entire flags?
-- Steve
> +
> + KDB_REPEAT_NO_ARGS = 0x40000000, /* Repeat the command w/o arguments */
> + KDB_REPEAT_WITH_ARGS = 0x80000000, /* Repeat the command with args */
> } kdb_cmdflags_t;
>
next prev parent reply other threads:[~2014-04-25 16:57 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-02 15:43 [RFC v2 00/10] kdb: Kiosk (reduced capabilities) mode Daniel Thompson
2014-04-02 15:43 ` [RFC v2 01/10] sysrq: Implement __handle_sysrq_nolock to avoid recursive locking in kdb Daniel Thompson
2014-04-02 15:43 ` [RFC v2 02/10] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2014-04-02 15:43 ` [RFC v2 03/10] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2014-04-02 15:43 ` [RFC v2 04/10] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2014-04-02 15:43 ` [RFC v2 05/10] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2014-04-02 15:43 ` [RFC v2 06/10] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2014-04-02 15:43 ` [RFC v2 07/10] kdb: Mark safe commands as KDB_SAFE and KDB_SAFE_NO_ARGS Daniel Thompson
2014-04-02 15:43 ` [RFC v2 08/10] kdb: Add kiosk mode Daniel Thompson
2014-04-02 15:43 ` [RFC v2 09/10] kdb: Improve usability of help text when running in " Daniel Thompson
2014-04-02 15:44 ` [RFC v2 10/10] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
2014-04-25 16:29 ` [RFC v3 0/9] kdb: Allow selective reduction in capabilities (was "kiosk mode") Daniel Thompson
2014-04-25 16:29 ` [RFC v3 1/9] sysrq: Implement __handle_sysrq_nolock to avoid recursive locking in kdb Daniel Thompson
2014-04-25 16:45 ` Steven Rostedt
2014-04-28 10:24 ` Daniel Thompson
2014-04-28 17:44 ` Colin Cross
2014-04-28 20:12 ` Daniel Thompson
2014-04-29 8:59 ` Daniel Thompson
2014-04-29 16:33 ` Colin Cross
2014-04-25 16:29 ` [RFC v3 2/9] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2014-04-25 16:29 ` [RFC v3 3/9] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2014-04-25 16:29 ` [RFC v3 4/9] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2014-04-25 16:29 ` [RFC v3 5/9] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2014-04-25 16:29 ` [RFC v3 6/9] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2014-04-25 16:29 ` [RFC v3 7/9] kdb: Categorize kdb commands (similar to SysRq categorization) Daniel Thompson
2014-04-25 16:57 ` Steven Rostedt [this message]
2014-04-28 10:30 ` Daniel Thompson
2014-04-25 16:29 ` [RFC v3 8/9] kdb: Add enable mask for groups of commands Daniel Thompson
2014-04-25 16:29 ` [RFC v3 9/9] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 0/9] kdb: Allow selective reduction in capabilities (was "kiosk mode") Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 1/9] sysrq: Implement __handle_sysrq_nolock to avoid recursive locking in kdb Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 2/9] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 3/9] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 4/9] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 5/9] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 6/9] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 7/9] kdb: Categorize kdb commands (similar to SysRq categorization) Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 8/9] kdb: Add enable mask for groups of commands Daniel Thompson
2014-05-06 13:03 ` [PATCH v4 9/9] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 0/8] kdb: Allow selective reduction in capabilities (was "kiosk mode") Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 1/8] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 2/8] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 3/8] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 4/8] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 5/8] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 6/8] kdb: Categorize kdb commands (similar to SysRq categorization) Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 7/8] kdb: Add enable mask for groups of commands Daniel Thompson
2014-06-19 13:19 ` [PATCH v5 8/8] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 0/8] kdb: Allow selective reduction in capabilities Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 1/8] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 2/8] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 3/8] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 4/8] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 5/8] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 6/8] kdb: Categorize kdb commands (similar to SysRq categorization) Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 7/8] kdb: Add enable mask for groups of commands Daniel Thompson
2014-07-11 11:33 ` [RESEND PATCH v5 3.16-rc4 8/8] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
2014-07-11 13:16 ` [RESEND PATCH v5 3.16-rc4 0/8] kdb: Allow selective reduction in capabilities Jason Wessel
2014-08-19 14:01 ` [RESEND PATCH v5 3.17-rc1 " Daniel Thompson
2014-08-19 14:01 ` [RESEND PATCH v5 3.17-rc1 1/8] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2014-08-19 14:01 ` [RESEND PATCH v5 3.17-rc1 2/8] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2014-08-19 14:01 ` [RESEND PATCH v5 3.17-rc1 3/8] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2014-08-19 14:01 ` [RESEND PATCH v5 3.17-rc1 4/8] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2014-08-19 14:01 ` [RESEND PATCH v5 3.17-rc1 5/8] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2014-08-19 14:02 ` [RESEND PATCH v5 3.17-rc1 6/8] kdb: Categorize kdb commands (similar to SysRq categorization) Daniel Thompson
2014-08-19 14:02 ` [RESEND PATCH v5 3.17-rc1 7/8] kdb: Add enable mask for groups of commands Daniel Thompson
2014-08-19 14:02 ` [RESEND PATCH v5 3.17-rc1 8/8] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 0/8] kdb: Allow selective reduction in capabilities Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 1/8] kdb: Remove currently unused kdbtab_t->cmd_flags Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 2/8] kdb: Rename kdb_repeat_t to kdb_cmdflags_t, cmd_repeat to cmd_flags Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 3/8] kdb: Rename kdb_register_repeat() to kdb_register_flags() Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 4/8] kdb: Use KDB_REPEAT_* values as flags Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 5/8] kdb: Remove KDB_REPEAT_NONE flag Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 6/8] kdb: Categorize kdb commands (similar to SysRq categorization) Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 7/8] kdb: Add enable mask for groups of commands Daniel Thompson
2015-01-07 16:34 ` [RESEND PATCH v5 3.19-rc2 8/8] kdb: Allow access to sensitive commands to be restricted by default Daniel Thompson
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=20140425125735.334add30@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=anton.vorontsov@linaro.org \
--cc=ccross@android.com \
--cc=daniel.thompson@linaro.org \
--cc=fweisbec@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jason.wessel@windriver.com \
--cc=john.stultz@linaro.org \
--cc=jslaby@suse.cz \
--cc=kernel-team@android.com \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=patches@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
all inboxes | Powered by JetHome®