[PATCH v2] driver core: add driver name to probe debug print
Francesco Valla <[email protected]> Fri, 03 Jul 2026 17:10:21 +0200
| Newsgroups | org.kernel.vger.linux-embedded,dev.linux.lists.driver-core,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
The initcall_debug command line option is a useful tool while debugging and optimizing the initialization of a new system, mainly because it allows to see probe failures and deferrals without recompiling the kernel (e.g., with CONFIG_DEBUG_DRIVER). However, matching a device with the driver it is being probed with can become difficult, since some devices use names that are not explicit, at least at a first sight (e.g.: '1-0:1.0' or '1-0060'). Add the driver name alongside the device name, to allow for an immediate match between the two. Suggested-by: Tim Bird <[email protected]> Signed-off-by: Francesco Valla <[email protected]> --- Hello, this very small patch comes from a discussion started at the end of 2024 after a Boot Time SIG meeting [1]; I decided to reduce the patch proposed there by Tim to the bare minimum, as this should already be enough information for a developer to work with. Thank you! Regards, Francesco [1] https://lore.kernel.org/linux-embedded/MW5PR13MB563277AF5972FD2B56026CF9FD3C2@MW5PR13MB5632.namprd13.prod.outlook.com/ --- Changes in v2: - Moved driver name in the existent print instead of introducing a new one. - Link to v1: https://patch.msgid.link/[email protected] To: Greg Kroah-Hartman <[email protected]> To: "Rafael J. Wysocki" <[email protected]> To: Danilo Krummrich <[email protected]> Cc: [email protected] Cc: [email protected] --- drivers/base/dd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 60c005223844..f6525a7ee8c5 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -790,8 +790,8 @@ static int really_probe_debug(struct device *dev, const struct device_driver *dr * CONFIG_DYNAMIC_DEBUG and we want a simple 'initcall_debug' on the * kernel commandline to print this all the time at the debug level. */ - printk(KERN_DEBUG "probe of %s returned %d after %lld usecs\n", - dev_name(dev), ret, ktime_us_delta(rettime, calltime)); + printk(KERN_DEBUG "probe of %s with driver %s returned %d after %lld usecs\n", + dev_name(dev), drv->name, ret, ktime_us_delta(rettime, calltime)); return ret; } --- base-commit: d2c9a99135da931377240942d44f3dea104cedb8 change-id: 20260628-probe_driver-3f14e94573f6 Best regards, -- Francesco Valla <[email protected]>