linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Halaney <ahalaney@redhat.com>
To: jbaron@akamai.com
Cc: linux-kernel@vger.kernel.org, Andrew Halaney <ahalaney@redhat.com>
Subject: [PATCH] dyndbg: make dyndbg a known cli param
Date: Thu,  9 Sep 2021 11:17:55 -0500	[thread overview]
Message-ID: <20210909161755.61743-1-ahalaney@redhat.com> (raw)

Right now dyndbg shows up as an unknown parameter if used on boot:

    Unknown command line parameters: dyndbg=module params +p ; module sys +p

That's because it is unknown, it doesn't sit in the __param
section, so the processing done to warn users supplying an unknown
parameter doesn't think it is legitimate.

Install a dummy handler to register it. This was chosen instead of the
approach the (deprecated) ddebug_query param takes, which is to
have a real handler that copies the string taking up a KiB memory.

Fixes: 86d1919a4fb0 ("init: print out unknown kernel parameters")
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
---

This is the last valid param I know of that was getting flagged on boot
if used correctly. Please let me know if the alternative approach of
actually copying the string is preferred and I'll spin that up instead.

Sort of an aside, but what's the policy for removing deprecated cli
params? ddebug_query has been deprecated for a very long time now, but I
am not sure if removing params like that is considered almost as bad as
breaking userspace considering some systems might update their kernels
but not the bootloader supplying the param.

 lib/dynamic_debug.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index cb5abb42c16a..84c16309cc63 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -761,6 +761,18 @@ static __init int ddebug_setup_query(char *str)
 
 __setup("ddebug_query=", ddebug_setup_query);
 
+/*
+ * Install a noop handler to make dyndbg look like a normal kernel cli param.
+ * This avoids warnings about dyndbg being an unknown cli param when supplied
+ * by a user.
+ */
+static __init int dyndbg_setup(char *str)
+{
+	return 1;
+}
+
+__setup("dyndbg=", dyndbg_setup);
+
 /*
  * File_ops->write method for <debugfs>/dynamic_debug/control.  Gathers the
  * command text from userspace, parses and executes it.
-- 
2.31.1


             reply	other threads:[~2021-09-09 16:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 16:17 Andrew Halaney [this message]
2021-09-09 21:34 ` [PATCH] dyndbg: make dyndbg a known cli param Jason Baron
2021-09-10 14:00   ` Andrew Halaney
     [not found]   ` <CAJfuBxzX9nEvxC1s-4uRCzLwN0=3gbFT__9vO_coEM5CrpnJng@mail.gmail.com>
2021-09-10 18:24     ` Andrew Halaney
2021-09-10 19:31       ` jim.cromie
2021-09-10 20:16         ` Andrew Halaney
2021-09-10 20:28           ` Andrew Halaney
2021-09-10 22:02           ` jim.cromie
2021-09-11  3:04           ` jim.cromie
2021-09-13 20:10             ` Andrew Halaney

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=20210909161755.61743-1-ahalaney@redhat.com \
    --to=ahalaney@redhat.com \
    --cc=jbaron@akamai.com \
    --cc=linux-kernel@vger.kernel.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).