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)
Apr 10 2024, 4:30 AM
Unknown Object (File)
Mar 25 2024, 10:39 PM
Unknown Object (File)
Mar 5 2024, 6:47 AM
Unknown Object (File)
Mar 2 2024, 4:45 PM
Unknown Object (File)
Feb 15 2024, 9:30 PM

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.