Page MenuHomeFreeBSD

Expand sbufs to be able to output directly to the log+console interface
AcceptedPublic

Authored by scottl on Feb 14 2017, 10:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 27, 1:28 PM
Unknown Object (File)
Wed, Jun 25, 7:41 AM
Unknown Object (File)
Sun, Jun 22, 1:21 AM
Unknown Object (File)
Sat, Jun 21, 8:48 AM
Unknown Object (File)
Tue, Jun 17, 10:47 AM
Unknown Object (File)
Tue, Jun 17, 6:19 AM
Unknown Object (File)
Mon, Jun 16, 3:04 PM
Unknown Object (File)
Jun 6 2025, 4:04 PM
Subscribers

Details

Reviewers
ken
imp
Group Reviewers
manpages
Summary

Refactor putbuf() so that it can be used as a generic output sink. Add
sbuf_putbuf() to utilize this. This allows buffers to be written
atomically without bouncing through the buffer length limitations of
printf() and PRINTF_BUFR_SIZE.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7782
Build 7929: arc lint + arc unit

Event Timeline

scottl retitled this revision from to Expand sbufs to be able to output directly to the log+console interface.
scottl updated this object.
scottl edited the test plan for this revision. (Show Details)
scottl added reviewers: ken, imp.
imp edited edge metadata.

Looks reasonable, assuming the code cut and paste into prf_putbuf was correct to start with.

This revision is now accepted and ready to land.Feb 16 2017, 7:32 AM
ken edited edge metadata.

I think this looks good, but we should also look at what it would take to put a drain mode in as well.

scottl edited edge metadata.

Update patch to provide a kernel version and userland version
of sbuf_putbuf()

This revision now requires review to proceed.Feb 27 2017, 10:23 PM

Need input on naming. sbuf_putbuf() was named since it wraps putbuf(). Is this the best name, though? Also, should it be kernel only, and the userland be something else that suggests printing to stdout vs stderr vs some other file descriptor?

imp edited edge metadata.

I can't think of a better name....

This revision is now accepted and ready to land.Feb 27 2017, 11:22 PM
In D9601#202724, @imp wrote:

I can't think of a better name....

dj_mc_sbuf_putbuff_iii_this_time_its_personal_esq is the obvious choice.

Please remember to bump .Dd, and credit me in the comments for the name.