1.\" 2.\" Copyright (c) 2025-2026 Mateusz Piotrowski <0mp@FreeBSD.org> 3.\" 4.\" SPDX-License-Identifier: BSD-2-Clause 5.\" 6.Dd May 7, 2026 7.Dt DTRACE_MIB 4 8.Os 9.Sh NAME 10.Nm dtrace_mib 11.Nd a DTrace provider for Management Information Base 12.Sh SYNOPSIS 13.Cm mib: Ns Ar module Ns Cm \&:count: Ns Ar counter 14.Pp 15In 16.Xr config 5 : 17.Cd "options KDTRACE_MIB_SDT" 18.Sh DESCRIPTION 19The 20.Nm mib 21provider allows tracing of Management Information Base stats counters. 22.Pp 23The list of instrumented 24.Ar module Ns s 25includes: 26.Bl -tag -offset indent -width ipcomp -compact 27.It Cm ah 28IP Authentication Header (RFC 2402), 29.Xr ipsec 4 30.It Cm esp 31IP Encapsulating Security Payload (RFC 1827, RFC 2406), 32.Xr ipsec 4 33.It Cm icmp 34.Xr icmp 4 35.It Cm icmp6 36.Xr icmp6 4 37.It Cm ip 38.Xr ip 4 39.It Cm ip6 40.Xr ip6 4 41.It Cm ipcomp 42IP Payload Compression Protocol, 43.Xr ipsec 4 44.It Cm ipsec 45.Xr ipsec 4 46.It Cm tcp 47.Xr tcp 4 48.It Cm udp 49.Xr udp 4 50.El 51.Pp 52The 53.Cm mib: Ns Ar module Ns Cm \&:count: Ns Ar counter 54probes fire when the 55.Ar counter 56in 57.Ar module Ns s 58increases. 59.Pp 60The first probe argument, 61.Vt uint64_t Va args[0] , 62is the increment that the 63.Ar counter 64will increase by. 65.Pp 66Note that some probes like 67.Cm mib:esp:count:esps_hist 68or 69.Cm mib:icmp6:count:icp6s_outhist 70provide additional probe-specific arguments. 71.Sh EXAMPLES 72.Ss Example 1 : Tracing IP Stats Counters 73When debugging network issues one common clue is an unexpectedly 74incrementing error counter. 75This is helpful, in that it gives us an 76idea of what might be going wrong, but often these counters may be 77incremented in different functions. 78.Pp 79Trace all 80.Nm mib 81probes in the 82.Xr ip 4 83module and print the current count and a stack trace: 84.Pp 85.Bd -literal -offset 2n 86# dtrace -n 'mib:ip:count: { printf("%d", arg0); stack(); }' 87dtrace: description 'mib:ip:count: ' matched 29 probes 88CPU ID FUNCTION:NAME 89 7 98784 count:ips_localout 1 90 kernel`ip_output+0x17a2 91 kernel`udp_send+0xaca 92 kernel`sosend_dgram+0x315 93 kernel`sousrsend+0x79 94 kernel`kern_sendit+0x1be 95 kernel`sendit+0x1ab 96 kernel`sys_sendmsg+0x5b 97 kernel`amd64_syscall+0x169 98 kernel`0xffffffff81094b8b 99.Ed 100.Sh SEE ALSO 101.Xr dtrace 1 , 102.Xr dtrace_ip 4 , 103.Xr dtrace_tcp 4 , 104.Xr dtrace_udp 4 , 105.Xr tracing 7 , 106.Xr sysctl 8 107.Sh STANDARDS 108The probe descriptions in 109the 110.Fx 111.Nm mib 112provider are not compatible with those in the Solaris/illumos mib provider. 113.Sh AUTHORS 114.An -nosplit 115The 116.Nm mib 117provider was added to 118.Fx 119by 120.An Kristof Provost Aq Mt kp@FreeBSD.org . 121.Pp 122This manual page was written by 123.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . 124