Re: [PATCH] dyndbg: make dyndbg a known cli param

From: jim . cromie
Date: Fri Sep 10 2021 - 18:03:20 EST


On Fri, Sep 10, 2021 at 2:16 PM Andrew Halaney <ahalaney@xxxxxxxxxx> wrote:
>
> On Fri, Sep 10, 2021 at 01:31:22PM -0600, jim.cromie@xxxxxxxxx wrote:
> > On Fri, Sep 10, 2021 at 12:24 PM Andrew Halaney <ahalaney@xxxxxxxxxx> wrote:
> > >
> > > On Fri, Sep 10, 2021 at 11:14:45AM -0600, jim.cromie@xxxxxxxxx wrote:
> > > > On Thu, Sep 9, 2021 at 3:34 PM Jason Baron <jbaron@xxxxxxxxxx> wrote:
> > > >
> > > > >
> > > > >
> > > > > On 9/9/21 12:17 PM, Andrew Halaney wrote:
> > > > > > 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.
> > > > > >
> > > >
> > > >
> > > > your usage is incorrect for what youre trying to do in that example
> > > > what you need is:
> > > >
> > > > params.dyndbg=+p sys.dyndbg=+p
> > > >
> > > > dyndbg is properly unknown as a kernel param, it isnt one.
> > > > ( it was called a "fake" module param when added.)
> > > > $module.dyndbg is good, since its after the $module. (and the dot)
> > > > it also then inherits the "scan bootargs for relevant ones on module load"
> > > > behavior
> > > >
> > > >
> > >
> > > That example is (slightly altered) from
> > > Documentation/admin-guide/dynamic-debug-howto.rst,
> >
> > oh dear, I see the lines youre referring to.
> > I am surprised.
> > fyi, those lines are:
> > // enable pr_debugs in 2 builtins, #cmt is stripped
> > dyndbg="module params +p #cmt ; module sys +p"
> >
> > is your patchset removing those lines ?
> > if so, ack that part.
> >
> > > I can change the example used to be a little less confusing (using the
> > > module keyword is confusing, I could use something like
> > > func or file instead of what the docs use as an example).
> >
> > yes please, I saw bad usage, thought faulty premise.
> >
> > > Is that what you're after, a better example usage of dyndbg= being
> > > whined about in dmesg for the commit message, or am I misunderstanding?
> >
> > I guess Im inured to it. Heres my regular version with a similar addition.
> >
> > Unknown command line parameters:
> > virtme_link_mods=/home/jimc/projects/lx/wk-next/builds/local-i915m/.virtme_mods/lib/modules/0.0.0
> > virtme_initmount0=/root virtme_initmount1=/root/sbin
> > virtme_stty_con=rows 27 cols 109 iutf8
> > virtme_chdir=home/jimc/projects/lx dyndbg=+p
> >
> > most of them do something, just not for the kernel.
> >
> > I dont think this is worth explicitly silencing.
> > rather rip out the misleading doc.
> >
>
> Ohhhhh, ok now I think I'm following what you and Jason are saying.
>
> dyndbg= parameter does need to process the whole cli, for cases like
> when $module.dyndbg= is supplied but $module is a builtin. And you are
> saying that this syntax (although it works)
> 'dyndbg="module params +p #cmt ; module sys +p"' is not the intended
> usage.
>
> So converting dyndbg= to act like ddebug_query= won't work because
> $module.dyndbg="+p" should work if $module is builtin or a module
> (settles my open discussion with Jason).

yes, $mod.dyndbg=+p works now whether $mod is builtin or loadable.
that must stick.

if bare dyndbg="str" works like an alias for ddebug_query=
(its amazing what one forgets)
then I agree the warning is misleading.