HomeFreeBSD

dtrace: Use a size_t to represent a buffer size in the printm action

Description

dtrace: Use a size_t to represent a buffer size in the printm action

printm is specific to the FreeBSD dtrace port. I believe it's
effectively the same as tracemem(), though printm apparently predates
it. It stores the size of the buffer of traced data inline. Currently
it represents that size using a uintptr_t, which isn't really right and
poses challenges when porting to CHERI because
DTRACE_STORE(uintptr_t, ... requires the destination to be suitably
aligned, but this isn't necessary since we're just storing a size.

Convert to using a size_t. This should be a no-op since
sizeof(uintptr_t) == sizeof(size_t) on non-CHERI platforms (and besides
that I don't see a reason to use printm() when tracemem() is available
and is simpler to use.)

Reviewed by: Domagoj Stolfa, avg
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D52055

(cherry picked from commit 3877025f52ee205fe99ad4ff68229933d57e4bcb)

Details

Provenance
markjAuthored on Sep 10 2025, 2:33 PM
Reviewer
avg
Differential Revision
D52055: dtrace: Use a size_t to represent a buffer size in the printm action
Parents
rG4008dd50c8f9: re: Make sure re_rxeof() is called in net epoch context
Branches
Unknown
Tags
Unknown