NetBSD Problem Report #57986

From www@netbsd.org  Sun Mar  3 00:48:10 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A89B91A9239
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  3 Mar 2024 00:48:10 +0000 (UTC)
Message-Id: <20240303004809.23DEA1A923A@mollari.NetBSD.org>
Date: Sun,  3 Mar 2024 00:48:09 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: kernel lock can't be dtraced
X-Send-Pr-Version: www-1.0

>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.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.