linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jim.cromie@gmail.com
To: Andrew Halaney <ahalaney@redhat.com>
Cc: Jason Baron <jbaron@akamai.com>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dyndbg: make dyndbg a known cli param
Date: Fri, 10 Sep 2021 21:04:20 -0600	[thread overview]
Message-ID: <CAJfuBxy5LqFZViZ+Hn3Y4-=QXOJwReHhscDNey9v5ZJkHDRF2A@mail.gmail.com> (raw)
In-Reply-To: <20210910201635.4d3fhhrwvcusdwk2@halaneylaptop>

>
> 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).
>

they can both work, because the dot.

\w+.\w+ is separate, which is why it works for loadable modules.

and Ive just re-verified that these both ( bare/global and after $mod. ) work

dyndbg=+pmfl
turns on all builtins

[  128.341650] 8250:serial8250_interrupt:140: serial8250_interrupt(4): end
[  128.344996] 8250:serial8250_interrupt:140: serial8250_interrupt(4): end
^C
bash-5.1# echo -p > /proc/dynamic_debug/control
dyndbg: read 3 bytes from userspace <
-p
>
dyndbg: query 0: <-p> mod:<*>
dyndbg: split into words: <-p>
dyndbg: op=<->
dyndbg: flags=0x1
dyndbg: *flagsp=0x0 *maskp=0xfffffffe
dyndbg: parsed: func=<> file=<> module=<> format=<> lineno=0-0
dyndbg: applied: func=<> file=<> module=<> format=<> lineno=0-0
dyndbg: processed 1 queries, with 3055 matches, 0 errs
bash-5.1# cat /proc/cmdline
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
earlyprintk=serial,ttyS0,115200 console=ttyS0 psmouse.proto=exps
"virtme_stty_con=rows 27 cols 109 iutf8" TERM=xterm-256color
virtme_chdir=home/jimc/projects/lx rootfstype=9p
rootflags=version=9p2000.L,trans=virtio,access=any,msize=200M
raid=noautodetect ro nokaslr dynamic_debug.verbose=3
module.dyndbg=+pmf dyndbg=+pmfl init=/bin/sh -- -c "mount -t tmpfs run
/run;mkdir -p /run/virtme/guesttools;/bin/mount -n -t 9p -o
ro,version=9p2000.L,trans=virtio,access=any,msize=104857600
virtme.guesttools /run/virtme/guesttools;exec
/run/virtme/guesttools/virtme-init"
bash-5.1# ^C
bash-5.1# modprobe i915
dyndbg:  384 debug prints in module drm
dyndbg:  211 debug prints in module drm_kms_helper
dyndbg:    2 debug prints in module ttm
dyndbg:    8 debug prints in module video
dyndbg: 1821 debug prints in module i915

**********************************************************
**   NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE   **
**                                                      **
** trace_printk() being used. Allocating extra memory.  **
**                                                      **
** This means that this is a DEBUG kernel and it is     **
** unsafe for production use.                           **
**                                                      **
** If you see this message and you are not debugging    **
** the kernel, report this immediately to your vendor!  **
**                                                      **
**   NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE   **
**********************************************************
bash-5.1# wc /proc/dynamic_debug/control
5482 47545 613066 /proc/dynamic_debug/control
bash-5.1# grep =p /proc/dynamic_debug/control | wc
      3      21     244
bash-5.1# QEMU: Terminated



bash-5.1# wc /proc/dynamic_debug/control
3056 24089 307832 /proc/dynamic_debug/control
bash-5.1# grep =pfml /proc/dynamic_debug/control | wc
      0       0       0
bash-5.1# cat /proc/cmdline
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
earlyprintk=serial,ttyS0,115200 console=ttyS0 psmouse.proto=exps
"virtme_stty_con=rows 27 cols 109 iutf8" TERM=xterm-256color
virtme_chdir=home/jimc/projects/lx rootfstype=9p
rootflags=version=9p2000.L,trans=virtio,access=any,msize=200M
raid=noautodetect ro nokaslr dynamic_debug.verbose=3
module.dyndbg=+pmf *.dyndbg=+pmfl init=/bin/sh -- -c "mount -t tmpfs
run /run;mkdir -p /run/virtme/guesttools;/bin/mount -n -t 9p -o
ro,version=9p2000.L,trans=virtio,access=any,msize=104857600
virtme.guesttools /run/virtme/guesttools;exec
/run/virtme/guesttools/virtme-init"
bash-5.1# grep =p /proc/dynamic_debug/control | wc
   3039   23944  305800
bash-5.1# grep =pmfl /proc/dynamic_debug/control |wc
   3039   23944  305800
bash-5.1# echo -p > /proc/dynamic_debug/control
dyndbg: read 3 bytes from userspace <
-p
>
dyndbg: query 0: <-p> mod:<*>
dyndbg: split into words: <-p>
dyndbg: op=<->
dyndbg: flags=0x1
dyndbg: *flagsp=0x0 *maskp=0xfffffffe
dyndbg: parsed: func=<> file=<> module=<> format=<> lineno=0-0
dyndbg: applied: func=<> file=<> module=<> format=<> lineno=0-0
dyndbg: processed 1 queries, with 3055 matches, 0 errs
bash-5.1# grep =pmfl /proc/dynamic_debug/control |wc
      0       0       0



> I'm going to hold my ground and try and silence the warning, because I
> think the kernel parameters interface is well defined enough (kernel
> params go before the -- i.e. "these are kernel params -- these are for init"
>


Policy zone: DMA32
Kernel command line:
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
earlyprintk=serial,ttyS0,115200 console=ttyS0 psmouse.proto=exps
"virtme_stty_con=rows 27 cols 109 iutf8" TERM=xterm-256color
virtme_chdir=home/jimc/projects/lx rootfstype=9p
rootflags=version=9p2000.L,trans=virtio,access=any,msize=200M
raid=noautodetect ro nokaslr dynamic_debug.verbose=3
module.dyndbg=+pmf init=/bin/sh -- -c "mount -t tmpfs run /run;mkdir
-p /run/virtme/guesttools;/bin/mount -n -t 9p -o
ro,version=9p2000.L,trans=virtio,access=any,msize=104857600
virtme.guesttools /run/virtme/guesttools;exec
/run/virtme/guesttools/virtme-init"
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
Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)


in the above, I see unknown complaints about items after the --

But I agree the warning is misleading.




> With that in mind I'll make a v2 series out of this doing:
>   1. Clean up the doc to show intended usage on cli, something like
>      (params.dyndbg="+p" sys.dyndbg="+p" dyndbg="file init/main.c +p #cmt ; func pc87360_init_device +p")

how about 1 builtin, 1 loadable, and use a wildcard somewhere,
to hint that theres more than 2 ways to make a "group"

>   2. Remove ddebug_query per Jason's approval

sorry for not keeping up - is the problem the static storage ?
is there a way to fix that for all setup= stuff ?
if you could make ddebug_query into an alias for dyndbg it might fix
the narrow case.


>   3. Silence the param with this patch here, with a commit message
>      updated explaining why dyndbg= needs to be able to process the whole
>      cli, per Jason
>
> Please lemme know if there are any strong objections in the meantime and
> thanks for the feedback!
>
> >
> > > I agree that dyndbg right now (both dyndbg= and $module.dyndbg=) are
> > > "fake" params, but I'd like to remove that message for dyndbg= as it is
> > > misleading. The code for module loading luckily already handles it all
> > > properly and doesn't warn on proper usage:

s/luckily/serendipitously/ - the way fake just worked was an aha for me.

just dont kill the fake-ness while quieting the warning

thanks
JIm

  parent reply	other threads:[~2021-09-11  3:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 16:17 [PATCH] dyndbg: make dyndbg a known cli param Andrew Halaney
2021-09-09 21:34 ` 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 [this message]
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='CAJfuBxy5LqFZViZ+Hn3Y4-=QXOJwReHhscDNey9v5ZJkHDRF2A@mail.gmail.com' \
    --to=jim.cromie@gmail.com \
    --cc=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).