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)
Fri, Nov 15, 1:59 AM
Unknown Object (File)
Sep 21 2024, 1:18 AM
Unknown Object (File)
Sep 8 2024, 8:56 AM
Unknown Object (File)
Sep 8 2024, 5:00 AM
Unknown Object (File)
Sep 8 2024, 4:46 AM
Unknown Object (File)
Sep 5 2024, 6:22 PM
Unknown Object (File)
Aug 30 2024, 2:37 AM
Unknown Object (File)
Aug 28 2024, 3:35 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.