On Wed, 27 Dec 2006, Bill Sommerfeld wrote:

On Wed, 2006-12-27 at 17:07 +0200, Cyril Plisko wrote:
Wouldn't it be beneficial for the kernel to have some
sort of generic DPRINTF/dprintf functionality, available to all
the components ?

Absolutely.

IMHO, besides overall cleanness it will
also allow developers to concentrate on their specific tasks
instead of re-inventing the wheel again and again.

May be there is something similar on the way already ?

I'm not aware of any work in progress.   Go for it;

I bet if you do a survey of the debug macros you can come up with
something which is a superset of all of them (and make it less likely
that someone will need to reinvent this wheel again..).

Bonus points if it plays well with dtrace and mdb.

I remember there once was a zfs_dprintf() which mapped to a DTrace SDT probe. It's gone now, anyone know why ?

The problem with a "generizised" dprintf() is: How do you pass a module-specific "debug level" parameter ? Always pass it ?

There are two 'dprintf' variants in the kernel sources. One that's conditionally compiled in (like the ACPI module's one that spams my /var/adm/messages on a debug kernel all the time), and one that does checks 'if (mod_debuglevel > xx)' to allow runtime enabling.

A lot of work consolidating this. I'm all for it, provided in the end I can selectively, for my module only, switch the dprintf's on or off. A broad "all or nothing" approach is counterproductive.

FrankH.






                                                - Bill

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to