Hopefully useful: macro-controlled logger
Konstantin Belousov
kostikbel at gmail.com
Sun Dec 10 10:46:00 UTC 2017
On Sun, Dec 10, 2017 at 12:00:41PM +0300, Michael Zhilin wrote:
> Hi Eric!
>
> Nice! This minimalistic and powerful approach looks very nice.
>
> We have similar thing in one of kernel driver:
> https://github.com/freebsd/freebsd/blob/master/sys/dev/bhnd/bhnd_debug.h
>
> In my opinion such kind of thing is demanded.
We already have ktr(4). If it is too limited for some use, it should be
extended instead of adding parallel half-done implementation.
Kernel printf(9) introduces too much serialization which makes it impossible
to reproduce an issue sometimes (or often). Also, kernel consoles are slow
due to the nature of the hardware, and serialization blocks other threads
trying to log while current message is printed.
ktr(4) avoids both of the problems.
More information about the freebsd-hackers
mailing list