Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

driver core: Don't require dynamic_debug for initcall_debug probe timing

Don't require the use of dynamic debug (or modification of the kernel to
add a #define DEBUG to the top of this file) to get the printk message
about driver probe timing. This printk is only emitted when
initcall_debug is enabled on the kernel commandline, and it isn't
immediately obvious that you have to do something else to debug boot
timing issues related to driver probe. Add a comment too so it doesn't
get converted back to pr_debug().

Fixes: eb7fbc9fb118 ("driver core: Add missing '\n' in log messages")
Cc: stable <stable@kernel.org>
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Brian Norris <briannorris@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20230412225842.3196599-1-swboyd@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Stephen Boyd and committed by
Greg Kroah-Hartman
e2f06aa8 bedee105

+6 -1
+6 -1
drivers/base/dd.c
··· 735 735 calltime = ktime_get(); 736 736 ret = really_probe(dev, drv); 737 737 rettime = ktime_get(); 738 - pr_debug("probe of %s returned %d after %lld usecs\n", 738 + /* 739 + * Don't change this to pr_debug() because that requires 740 + * CONFIG_DYNAMIC_DEBUG and we want a simple 'initcall_debug' on the 741 + * kernel commandline to print this all the time at the debug level. 742 + */ 743 + printk(KERN_DEBUG "probe of %s returned %d after %lld usecs\n", 739 744 dev_name(dev), ret, ktime_us_delta(rettime, calltime)); 740 745 return ret; 741 746 }