]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
device_printf: Use sbuf for more coherent prints on SMP
authorcem <cem@FreeBSD.org>
Tue, 7 May 2019 17:47:20 +0000 (17:47 +0000)
committercem <cem@FreeBSD.org>
Tue, 7 May 2019 17:47:20 +0000 (17:47 +0000)
commit38fa0aaa51eff2a1630b8d8d8c762831a846b206
tree6168ea2d5cc5ae447ebe8c6c3fdd7fe381bb879a
parentc7029e0b4afa0b78324326fabadeafeaa2221d0b
device_printf: Use sbuf for more coherent prints on SMP

device_printf does multiple calls to printf allowing other console messages to
be inserted between the device name, and the rest of the message.  This change
uses sbuf to compose to two into a single buffer, and prints it all at once.

It exposes an sbuf drain function (drain-to-printf) for common use.

Update documentation to match; some unit tests included.

Submitted by: jmg
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16690
lib/libsbuf/Symbol.map
lib/libsbuf/tests/sbuf_core_test.c
lib/libsbuf/tests/sbuf_stdio_test.c
share/man/man9/Makefile
share/man/man9/sbuf.9
sys/kern/kern_sysctl.c
sys/kern/subr_bus.c
sys/kern/subr_prf.c
sys/sys/sbuf.h