1.\" 2.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> 3.\" 4.\" SPDX-License-Identifier: BSD-2-Clause 5.\" 6.Dd November 12, 2025 7.Dt DTRACE_PRIV 4 8.Os 9.Sh NAME 10.Nm dtrace_priv 11.Nd a DTrace provider for the kernel privilege checking API 12.Sh SYNOPSIS 13.Nm priv Ns Cm :kernel:priv_check:priv-ok 14.Nm priv Ns Cm :kernel:priv_check:priv-err 15.Sh DESCRIPTION 16The 17.Nm priv 18provider allows for tracing the 19.Xr priv 9 20API. 21.Pp 22The 23.Nm priv Ns Cm :kernel:priv_check:priv-ok 24probe fires upon a successful kernel privilege check. 25.Pp 26The 27.Nm priv Ns Cm :kernel:priv_check:priv-err 28probe fires upon a failed kernel privilege check. 29.Pp 30The only argument to the 31.Nm priv 32probes, 33.Fa args[0] , 34is the requested privilege number 35.Ft int priv . 36.Sh EXAMPLES 37.Ss Example 1: Tracing Kernel Privilege Check Failures 38The following script captures an array of counters, 39one for each stack trace leading to a failed kernel privilege check: 40.Bd -literal -offset 2n 41priv:::priv-err 42{ 43 @traces[stack()] = count(); 44} 45.Ed 46.Sh SEE ALSO 47.Xr dtrace 1 , 48.Xr tracing 7 , 49.Xr priv 9 , 50.Xr SDT 9 51.Sh AUTHORS 52.An -nosplit 53The 54.Nm priv 55provider was written by 56.An Robert N. M. Watson Aq Mt rwatson@FreeBSD.org . 57.Pp 58This manual page was written by 59.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . 60