Skip to contentSkip to conversation

driver probe error reporting

DISCUSSION Ben Dooks 3 participants 7 messages Dec 15, 2008 – Dec 17, 2008

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

This runs on from the discussion in [1] on how drivers (especially one using a variant of the device driver framework) report errors on probe. There are two main classes of errors, the type which happen at probe time (device not responding, not enough memory, etc) and errors that are due to configuration such as missing device configuration data.

It has been suggested that using dev_err() to report any configuration data error is a bloat of code as a properly debugged kernel should never find itself in this state.

Unfortunatley the only diagnostic dev_xxx() macro is dev_dbg() which is only available if the the driver code itself defines DEBUG. I would think it would be better to have a macro that can be turned on/off by a kernel configuration for when debugging which turns on the messages that are important to developers creating new machine/arch support but disabled for shipping kernels.

Basically, what are people's thoughts on a "Verbose probe error" configuration option in the "Kernel hacking" submenu with its own dev_probe_err() or similar macro?

[1] http://groups.google.com/group/fa.linux.kernel/browse_thread/thread/ce6260537381dd94/7ed3f699db907357?show_docid=7ed3f699db907357

Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
#1 lore raw
Quoted 11 lines · Ben Dooks

This runs on from the discussion in [1] on how drivers (especially one using a variant of the device driver framework) report errors on probe. There are two main classes of errors, the type which happen at probe time (device not responding, not enough memory, etc) and errors that are due to configuration such as missing device configuration data.

It has been suggested that using dev_err() to report any configuration data error is a bloat of code as a properly debugged kernel should never find itself in this state.

Quoted 6 lines

Unfortunatley the only diagnostic dev_xxx() macro is dev_dbg() which is only available if the the driver code itself defines DEBUG. I would think it would be better to have a macro that can be turned on/off by a kernel configuration for when debugging which turns on the messages that are important to developers creating new machine/arch support but disabled for shipping kernels.

Not anymore, dev_dbg() can be dynamically switched on and off at runtime in 2.6.28.

Quoted 3 lines

Basically, what are people's thoughts on a "Verbose probe error" configuration option in the "Kernel hacking" submenu with its own dev_probe_err() or similar macro?

It is not needed, see the above :)

thanks,

greg k-h

#2 lore raw
Quoted 19 lines · Greg KH
Quoted 11 lines · Ben Dooks

This runs on from the discussion in [1] on how drivers (especially one using a variant of the device driver framework) report errors on probe. There are two main classes of errors, the type which happen at probe time (device not responding, not enough memory, etc) and errors that are due to configuration such as missing device configuration data.

It has been suggested that using dev_err() to report any configuration data error is a bloat of code as a properly debugged kernel should never find itself in this state.

Quoted 6 lines

Unfortunatley the only diagnostic dev_xxx() macro is dev_dbg() which is only available if the the driver code itself defines DEBUG. I would think it would be better to have a macro that can be turned on/off by a kernel configuration for when debugging which turns on the messages that are important to developers creating new machine/arch support but disabled for shipping kernels.

Quoted 2 lines

Not anymore, dev_dbg() can be dynamically switched on and off at runtime in 2.6.28.

IMO, there's a problem with that, because it turns on _all_ of the debug info from the entire kernel, which is _never_ necessary. Almost always you need debug output for specific subsystem, if not for specific driver, and all of the superfluous debug data resulting from the "dynamic printk" only makes things harder.

Thanks,
Rafael

#3 lore raw
Quoted 20 lines · Rafael J. Wysocki
Quoted 19 lines · Greg KH
Quoted 17 lines · Ben Dooks

This runs on from the discussion in [1] on how drivers (especially one using a variant of the device driver framework) report errors on probe. There are two main classes of errors, the type which happen at probe time (device not responding, not enough memory, etc) and errors that are due to configuration such as missing device configuration data.

It has been suggested that using dev_err() to report any configuration data error is a bloat of code as a properly debugged kernel should never find itself in this state.

Unfortunatley the only diagnostic dev_xxx() macro is dev_dbg() which is only available if the the driver code itself defines DEBUG. I would think it would be better to have a macro that can be turned on/off by a kernel configuration for when debugging which turns on the messages that are important to developers creating new machine/arch support but disabled for shipping kernels.

Quoted 5 lines
Quoted 2 lines

Not anymore, dev_dbg() can be dynamically switched on and off at runtime in 2.6.28.

IMO, there's a problem with that, because it turns on _all_ of the debug info from the entire kernel, which is _never_ necessary.

No, it is turned on and off on a per-module basis, not for the whole kernel (although that is possible if you so desire.)

So this should not be an issue.

thanks,

greg k-h

#4 lore raw
Quoted 24 lines · Greg KH
Quoted 23 lines · Rafael J. Wysocki
Quoted 21 lines · Greg KH
Quoted 11 lines · Ben Dooks

This runs on from the discussion in [1] on how drivers (especially one using a variant of the device driver framework) report errors on probe. There are two main classes of errors, the type which happen at probe time (device not responding, not enough memory, etc) and errors that are due to configuration such as missing device configuration data.

It has been suggested that using dev_err() to report any configuration data error is a bloat of code as a properly debugged kernel should never find itself in this state.

Quoted 6 lines

Unfortunatley the only diagnostic dev_xxx() macro is dev_dbg() which is only available if the the driver code itself defines DEBUG. I would think it would be better to have a macro that can be turned on/off by a kernel configuration for when debugging which turns on the messages that are important to developers creating new machine/arch support but disabled for shipping kernels.

Not anymore, dev_dbg() can be dynamically switched on and off at runtime in 2.6.28.

Quoted 7 lines
Quoted 2 lines

IMO, there's a problem with that, because it turns on _all_ of the debug info from the entire kernel, which is _never_ necessary.

No, it is turned on and off on a per-module basis, not for the whole kernel (although that is possible if you so desire.)

So this should not be an issue.

Well, recently I've been debugging suspend-resume quite a lot and I had to compile it out. I use verbose PM debugging for that, which is based on dev_dbg(), and it is very inconvenient with dynamic printk.

Thanks,
Rafael

#5 lore raw
Quoted 28 lines · Rafael J. Wysocki
Quoted 27 lines · Greg KH
Quoted 25 lines · Rafael J. Wysocki
Quoted 19 lines · Greg KH
Quoted 11 lines · Ben Dooks

This runs on from the discussion in [1] on how drivers (especially one using a variant of the device driver framework) report errors on probe. There are two main classes of errors, the type which happen at probe time (device not responding, not enough memory, etc) and errors that are due to configuration such as missing device configuration data.

It has been suggested that using dev_err() to report any configuration data error is a bloat of code as a properly debugged kernel should never find itself in this state.

Quoted 6 lines

Unfortunatley the only diagnostic dev_xxx() macro is dev_dbg() which is only available if the the driver code itself defines DEBUG. I would think it would be better to have a macro that can be turned on/off by a kernel configuration for when debugging which turns on the messages that are important to developers creating new machine/arch support but disabled for shipping kernels.

Quoted 2 lines

Not anymore, dev_dbg() can be dynamically switched on and off at runtime in 2.6.28.

IMO, there's a problem with that, because it turns on _all_ of the debug info from the entire kernel, which is _never_ necessary.

Quoted 8 lines
Quoted 4 lines

No, it is turned on and off on a per-module basis, not for the whole kernel (although that is possible if you so desire.)

So this should not be an issue.

Well, recently I've been debugging suspend-resume quite a lot and I had to compile it out. I use verbose PM debugging for that, which is based on dev_dbg(), and it is very inconvenient with dynamic printk.

I'm confused, if you enable dynamic printk, it uses dev_dbg(). And then you can turn it on or off on a per-module basis.

What are you suggesting we do instead?

thanks,

greg k-h

#6 lore raw
Quoted 34 lines · Greg KH
Quoted 33 lines · Rafael J. Wysocki
Quoted 31 lines · Greg KH
Quoted 20 lines · Rafael J. Wysocki
Quoted 19 lines · Greg KH
Quoted 17 lines · Ben Dooks

This runs on from the discussion in [1] on how drivers (especially one using a variant of the device driver framework) report errors on probe. There are two main classes of errors, the type which happen at probe time (device not responding, not enough memory, etc) and errors that are due to configuration such as missing device configuration data.

It has been suggested that using dev_err() to report any configuration data error is a bloat of code as a properly debugged kernel should never find itself in this state.

Unfortunatley the only diagnostic dev_xxx() macro is dev_dbg() which is only available if the the driver code itself defines DEBUG. I would think it would be better to have a macro that can be turned on/off by a kernel configuration for when debugging which turns on the messages that are important to developers creating new machine/arch support but disabled for shipping kernels.

Quoted 5 lines
Quoted 2 lines

Not anymore, dev_dbg() can be dynamically switched on and off at runtime in 2.6.28.

IMO, there's a problem with that, because it turns on _all_ of the debug info from the entire kernel, which is _never_ necessary.

No, it is turned on and off on a per-module basis, not for the whole kernel (although that is possible if you so desire.)

So this should not be an issue.

Quoted 8 lines
Quoted 3 lines

Well, recently I've been debugging suspend-resume quite a lot and I had to compile it out. I use verbose PM debugging for that, which is based on dev_dbg(), and it is very inconvenient with dynamic printk.

I'm confused, if you enable dynamic printk, it uses dev_dbg(). And then you can turn it on or off on a per-module basis.

What are you suggesting we do instead?

For suspend-resume debugging I need dev_dbg() to work for all devices, but only in a couple of specific code paths.

Well, I probably could enable it right before suspend and disable right after the resume. I'll try that and see if I can filter the noise out this way.

Thanks,
Rafael