Page MenuHomeFreeBSD

[RFC] ktrace: log genio events on failed write
ClosedPublic

Authored by kevans on Feb 9 2024, 4:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 12, 8:29 AM
Unknown Object (File)
Sun, May 5, 5:18 PM
Unknown Object (File)
Thu, May 2, 7:34 AM
Unknown Object (File)
Thu, May 2, 7:34 AM
Unknown Object (File)
Thu, May 2, 4:34 AM
Unknown Object (File)
Wed, May 1, 11:27 AM
Unknown Object (File)
Apr 27 2024, 8:01 AM
Unknown Object (File)
Apr 27 2024, 8:01 AM

Details

Summary

Visibility into the contents of the buffer when a write(2) has failed
can be immensely useful in debugging IPC issues -- pushing this to
discuss the idea, or maybe an alternative where we can set a flag like
KTRFAC_ERRIO to enable it.

When a genio event is potentially raised after an error, currently we'll
just free the uio and return. However, such data can be useful when
debugging communication between processes to, e.g., understand what the
remote side should have grabbed before closing a pipe. Tap out the
entire buffer on failure rather than simply discarding it.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kevans requested review of this revision.Feb 9 2024, 4:21 AM
kib added inline comments.
sys/kern/kern_ktrace.c
770
This revision was not accepted when it landed; it landed in state Needs Review.Mar 5 2024, 5:46 AM
This revision was automatically updated to reflect the committed changes.