Page MenuHomeFreeBSD

Add support for the user cookie to DTrace and TCP
ClosedPublic

Authored by gnn on Jul 8 2016, 12:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 4, 9:46 AM
Unknown Object (File)
Mon, Mar 4, 9:41 AM
Unknown Object (File)
Jan 9 2024, 1:06 PM
Unknown Object (File)
Dec 20 2023, 1:12 AM
Unknown Object (File)
Nov 21 2023, 10:49 AM
Unknown Object (File)
Nov 12 2023, 1:09 PM
Unknown Object (File)
Nov 7 2023, 6:33 PM
Unknown Object (File)
Nov 7 2023, 5:45 AM
Subscribers

Details

Summary

On FreeBSD there is a setsockopt option SO_USER_COOKIE which allows setting a 32 bit value on each socket. This can be used by applications and DTrace as a rendezvous point so that an applicaton's data can more easily be captured at run time. Expose the user cookie via DTrace by updating the translator in tcp.d and add a quick test program, a TCP server, that sets the cookie on each connection accepted.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

gnn retitled this revision from to Add support for the user cookie to DTrace and TCP.
gnn updated this object.
gnn edited the test plan for this revision. (Show Details)
hiren edited edge metadata.

A minor nit inline. Looks good otherwise.

cddl/lib/libdtrace/tcp.d
228 ↗(On Diff #18213)

SO_USER_COOKIE's default value is 0 so we may want to set it to -1 in case of p == null.

This revision is now accepted and ready to land.Jul 8 2016, 5:43 AM
gnn marked an inline comment as done.Jul 8 2016, 11:35 PM

I'll make that change in the commit.

This revision was automatically updated to reflect the committed changes.