NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/57986: kernel lock can't be dtraced



>Number:         57986
>Category:       kern
>Synopsis:       kernel lock can't be dtraced
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 03 00:50:00 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current, 10
>Organization:
The NetBSD Kernellock
>Environment:
>Description:
Tried to use dtrace to put probes on kernel lock usage, in an attempt to measure who's holding the kernel lock for how long:

# dtrace -x cleanrate=50hz -n 'fbt::_kernel_lock:return { self->starttime = timestamp } fbt::_kernel_unlock:entry /self->starttime/ { @[caller] = max(timestamp - self->starttime); self->starttime = 0 } tick-10s, END { printa("\n%a
%@u", @) }'
dtrace: invalid probe specifier fbt::_kernel_lock:return { self->starttime = timestamp } fbt::_kernel_unlock:entry /self->starttime/ { @[caller] = max(timestamp - self->starttime); self->starttime = 0 } tick-10s, END { printa("\n%a %@u", @) }: probe description fbt::_kernel_lock:return does not match any probes

This used to work in netbsd-9:
https://mail-index.netbsd.org/tech-kern/2022/10/30/msg028499.html
>How-To-Repeat:
dtrace fbt::_kernel_lock:return
>Fix:
Yes, please!

Either:

(a) fix whatever broke fdt on _kernel_lock return, or
(b) sprinkle sdt probes.

Performance may not be great for sdt probes, but it's the legacy kernel lock -- we should discourage using it anyway.



Home | Main Index | Thread Index | Old Index