Unable to add dyndbg to command line

Bug #1838070 reported by Jeffrey Hugo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I'm running Ubuntu 18.04.2 LTS
Version 2.02-2ubuntu8.13 of grub is installed.

When I update my grub.cfg to include dyndbg, such as:

linux /boot/vmlinuz-5.2.0+ root=UUID=e31d3503-30d5-4021-89ea-0ac921ce153f ro console=ttyS0 ignore_loglevel dyndbg="module e1000"

the quotes are not handled properly.

The resulting kernel boot gets -

cat /proc/cmdline | more
BOOT_IMAGE=/boot/vmlinuz-5.2.0+ root=UUID=e31d3503-30d5-4021-89ea-0ac921ce153f ro console=ttyS0 ignore_loglevel "dyndbg=module e1000 +p"

As you can see, the first quote in the dyndbg param moved, thus invalidating the command line, and resulting in dyndbg not taking effect.

Revision history for this message
TJ (tj) wrote :

This is correct. The essential thing to understand is the kernel's command-line uses space as the separator between options so:

option1=1 option2=2 option3=3
option1=1 option2="2" option3="3 or 4"
option1=1 "option2=2" "option3=3 or 4"

are all identical.

What you are seeing in /proc/cmdline is the *kernel* writing out each option and, when an option contains a space, it surrounds the option with double-quotes.

Consider that the "=" symbol has no special meaning in the context of the command line although individual modules *may* use it to separate key=value options themselves.

Changed in grub2 (Ubuntu):
status: New → Invalid
Revision history for this message
TJ (tj) wrote :

The reason your "dyndbg=module e1000" does not work is because dyndbg=... is only processed at boot time and therefore only affects *built-in* modules. e1000 is a dynamically loaded module not a built-in.

What you need is the module.dyndbg=... form as in:

"e1000.dyndbg=+p"

See especially line 259, 291 of:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/dynamic-debug-howto.rst

Revision history for this message
Tomáš Virtus (virtustom) wrote :

This is not correct. The advice applies only to enabling debug messages in modules, but how does one enable debug messages kernel image? For example one could want to see debug messages from kernel/module.c which is not in any module, and the kernel parameter would be:

  dyndbg="file kernel/module.c +p"

but grub turns that into

  "dyndbg=file kernel/module.c +p"

which kernel fails to parse.

There are other reports on the web:
http://savannah.gnu.org/bugs/?44580
https://access.redhat.com/solutions/1152603
https://lists.ozlabs.org/pipermail/petitboot/2016-September/000477.html

Changed in grub2 (Ubuntu):
status: Invalid → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.