The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2] driver core: add driver name to probe debug print
@ 2026-07-03 15:10 Francesco Valla
  2026-07-03 16:59 ` Danilo Krummrich
  0 siblings, 1 reply; 2+ messages in thread
From: Francesco Valla @ 2026-07-03 15:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
  Cc: Tim Bird, driver-core, linux-kernel, linux-embedded,
	Francesco Valla

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 <tim.bird@sony.com>
Signed-off-by: Francesco Valla <francesco@valla.it>
---
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/20260629-probe_driver-v1-1-fc58117581b5@valla.it

To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
To: Danilo Krummrich <dakr@kernel.org>
Cc: driver-core@lists.linux.dev
Cc: linux-kernel@vger.kernel.org
---
 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 <francesco@valla.it>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] driver core: add driver name to probe debug print
  2026-07-03 15:10 [PATCH v2] driver core: add driver name to probe debug print Francesco Valla
@ 2026-07-03 16:59 ` Danilo Krummrich
  0 siblings, 0 replies; 2+ messages in thread
From: Danilo Krummrich @ 2026-07-03 16:59 UTC (permalink / raw)
  To: Francesco Valla
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Tim Bird, driver-core,
	linux-kernel, linux-embedded

On Fri Jul 3, 2026 at 5:10 PM CEST, Francesco Valla wrote:
> 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 <tim.bird@sony.com>
> Signed-off-by: Francesco Valla <francesco@valla.it>

Acked-by: Danilo Krummrich <dakr@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-03 16:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-03 15:10 [PATCH v2] driver core: add driver name to probe debug print Francesco Valla
2026-07-03 16:59 ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox