All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Baron <jbaron@akamai.com>
To: gregkh@linuxfoundation.org
Cc: ahalaney@redhat.com, jim.cromie@gmail.com, corbet@lwn.net,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 1/3] dyndbg: make dyndbg a known cli param
Date: Wed, 13 Oct 2021 11:40:20 -0400	[thread overview]
Message-ID: <1634139622-20667-2-git-send-email-jbaron@akamai.com> (raw)
In-Reply-To: <1634139622-20667-1-git-send-email-jbaron@akamai.com>

From: Andrew Halaney <ahalaney@redhat.com>

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

    Unknown command line parameters: dyndbg=+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. dynamic debug needs to search
the whole command line for modules listed that are currently builtin,
so there's no real work to be done in this callback.

Fixes: 86d1919a4fb0 ("init: print out unknown kernel parameters")
Tested-by: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
Signed-off-by: Jason Baron <jbaron@akamai.com>
---
 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
@@ -762,6 +762,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.7.4


  reply	other threads:[~2021-10-13 15:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13 15:40 [PATCH v3 0/3] Trivial dynamic debug fixups Jason Baron
2021-10-13 15:40 ` Jason Baron [this message]
2021-10-13 15:40 ` [PATCH v3 2/3] dyndbg: Remove support for ddebug_query param Jason Baron
2021-10-13 15:40 ` [PATCH v3 3/3] Documentation: dyndbg: Improve cli param examples Jason Baron
  -- strict thread matches above, loose matches on Subject: below --
2021-09-20 20:54 [PATCH v3 0/3] Trivial dynamic debug fixups Andrew Halaney
2021-09-20 20:54 ` [PATCH v3 1/3] dyndbg: make dyndbg a known cli param Andrew Halaney
2021-09-22 18:23   ` jim.cromie

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=1634139622-20667-2-git-send-email-jbaron@akamai.com \
    --to=jbaron@akamai.com \
    --cc=ahalaney@redhat.com \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jim.cromie@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.