diff options
author | Conrad Meyer <cem@FreeBSD.org> | 2019-05-07 17:47:20 +0000 |
---|---|---|
committer | Conrad Meyer <cem@FreeBSD.org> | 2019-05-07 17:47:20 +0000 |
commit | 7d7db5298d505495426c2f0790707757fd7c6acb (patch) | |
tree | 6168ea2d5cc5ae447ebe8c6c3fdd7fe381bb879a /sys/sys/sbuf.h | |
parent | 5350e15d0d85c3ffb021adab9304b7e4b1ab7f08 (diff) | |
download | src-7d7db5298d505495426c2f0790707757fd7c6acb.tar.gz src-7d7db5298d505495426c2f0790707757fd7c6acb.zip |
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
Notes
Notes:
svn path=/head/; revision=347229
Diffstat (limited to 'sys/sys/sbuf.h')
-rw-r--r-- | sys/sys/sbuf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h index 8e958cbefe9a..b4d274158ab0 100644 --- a/sys/sys/sbuf.h +++ b/sys/sys/sbuf.h @@ -103,6 +103,7 @@ void sbuf_start_section(struct sbuf *, ssize_t *); ssize_t sbuf_end_section(struct sbuf *, ssize_t, size_t, int); void sbuf_hexdump(struct sbuf *, const void *, int, const char *, int); +int sbuf_printf_drain(void *arg, const char *data, int len); void sbuf_putbuf(struct sbuf *); #ifdef _KERNEL |