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)
Dec 20 2023, 7:46 AM
Unknown Object (File)
Mar 23 2023, 4:19 PM
Unknown Object (File)
Mar 6 2023, 1:40 PM
Unknown Object (File)
Apr 22 2017, 5:16 AM
Unknown Object (File)
Apr 10 2017, 10:57 PM
Unknown Object (File)
Mar 6 2017, 9:28 PM
Unknown Object (File)
Feb 16 2017, 10:04 AM
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.