HomeFreeBSD

sdt: Fix aframe handling after commit ddf0ed09bd8f

Description

sdt: Fix aframe handling after commit ddf0ed09bd8f

DTrace probes have an "aframes" attribute, used when unwinding the stack
from dtrace_probe(). It counts the number of leading frames to skip
when returning a stack trace, thus is used to hide internal functions.
Commit ddf0ed09bd8f set the aframes value for SDT probes to 0, which was
correct for an earlier iteration of the patch, but now doesn't take
sdt_probe()/sdt_probe6() into account.

Fix the aframes definition for SDT probes. Also try to improve
lockstat(1) output by adding an additional aframe for lockstat probes,
which otherwise show internal mtx(9), rwlock(9), etc. functions as the
probe "caller". This is not quite correct as the number of frames to
skip may differ depending on the lock type and kernel configuration (see
e.g., the MUTEX_NOINLINE kernel option), but this is not a new problem.

Reported by: mjg
Fixes: ddf0ed09bd8f ("sdt: Implement SDT probes using hot-patching")

Details

Provenance
markjAuthored on Jul 8 2024, 3:40 PM
Parents
rGfa6cbe8d60b1: sdt: Use a multibyte nop for tracepoints on amd64
Branches
Unknown
Tags
Unknown