NetBSD Problem Report #58377
From www@netbsd.org Sat Jun 29 01:44:04 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)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id B9C071A923A
for <gnats-bugs@gnats.NetBSD.org>; Sat, 29 Jun 2024 01:44:03 +0000 (UTC)
Message-Id: <20240629014402.7D98D1A923C@mollari.NetBSD.org>
Date: Sat, 29 Jun 2024 01:44:02 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: if_stats events lack dtrace probes
X-Send-Pr-Version: www-1.0
>Number: 58377
>Category: kern
>Synopsis: if_stats events lack dtrace probes
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Jun 29 01:45:01 +0000 2024
>Closed-Date: Tue Jul 23 20:54:42 +0000 2024
>Last-Modified: Tue Jul 23 20:54:42 +0000 2024
>Originator: Taylor R Campbell
>Release: current, 10, 9, ...
>Organization:
The NetBSDerrs Foundation
>Environment:
>Description:
You can tell how many outgoing packets have been dropped because of output errors on an interface with `netstat -I ifN -n', but that doesn't help to diagnose _why_ the errors happen. Most drivers have multiple reasons for errors, or other events about which we count statistics. It should be possible to dtrace these events, e.g. to record stack traces and not just numbers of events.
>How-To-Repeat:
try to diagnose why oerrors is going up without rebuilding the kernel and rebooting, which might lose the state you needed to diagnose
>Fix:
First approximation: New SDT probe sdt:net:if:stat(struct ifnet *ifp, if_stat_t stat, int64_t delta).
We might potentially want to have a separate probe for each stat, so that you can, e.g., cheaply put probes on oerrors without incurring more than a predicted-not-taken branch on on opkts. But that's a little more work.
>Release-Note:
>Audit-Trail:
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58377 CVS commit: src/sys/net
Date: Sat, 29 Jun 2024 02:18:36 +0000
Module Name: src
Committed By: riastradh
Date: Sat Jun 29 02:18:36 UTC 2024
Modified Files:
src/sys/net: if_stats.c if_stats.h
Log Message:
if_stats(9): New dtrace probes on if_statinc/dec/add/sub.
Note: This doesn't apply to if_statinc/dec/add/sub_ref, because we
don't have the ifp passed through. To be done in a separate commit
which also adjusts all drivers.
PR kern/58377
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/net/if_stats.c
cvs rdiff -u -r1.3 -r1.4 src/sys/net/if_stats.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58377 CVS commit: src/sys
Date: Sat, 29 Jun 2024 12:11:13 +0000
Module Name: src
Committed By: riastradh
Date: Sat Jun 29 12:11:13 UTC 2024
Modified Files:
src/sys/arch/arm/gemini: if_gpn.c
src/sys/arch/arm/xscale: ixp425_if_npe.c
src/sys/arch/mac68k/dev: if_mc.c
src/sys/arch/macppc/dev: am79c950.c
src/sys/arch/mips/alchemy/dev: if_aumac.c
src/sys/arch/mips/atheros/dev: if_ae.c
src/sys/arch/mips/cavium/dev: octeon_gmx.c
src/sys/arch/powerpc/booke/dev: pq3etsec.c
src/sys/arch/sgimips/hpc: if_sq.c
src/sys/dev/cadence: if_cemac.c
src/sys/dev/ic: aic6915.c cs89x0.c dp8390.c dp83932.c elinkxl.c gem.c
hd64570.c hme.c i82557.c mb86960.c rtl8169.c rtl81x9.c smc83c170.c
tulip.c
src/sys/dev/pci: if_age.c if_alc.c if_ale.c if_aq.c if_bge.c if_bnx.c
if_cas.c if_ena.c if_iavf.c if_ixl.c if_rge.c if_sip.c if_ste.c
if_stge.c if_tl.c if_txp.c if_vge.c if_vioif.c if_vmx.c if_vr.c
if_vte.c if_wm.c
src/sys/dev/pci/igc: if_igc.c
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c
src/sys/dev/sbus: qe.c
src/sys/dev/usb: if_cue.c
src/sys/net: if.c if_bridge.c if_stats.h if_vlan.c
src/sys/net/agr: if_agr.c
src/sys/net/lagg: if_lagg.c
Log Message:
if_stats(9): Add ifp argument to if_stat..._ref.
This will enable us to pass the ifp through to a dtrace probe inside.
No functional change intended in this change, but this is an API
change visible to modules so it shouldn't be pulled up.
PR kern/58377
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/gemini/if_gpn.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/arm/xscale/ixp425_if_npe.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/mac68k/dev/if_mc.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/macppc/dev/am79c950.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/mips/alchemy/dev/if_aumac.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/mips/atheros/dev/if_ae.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mips/cavium/dev/octeon_gmx.c
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/powerpc/booke/dev/pq3etsec.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/sgimips/hpc/if_sq.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/cadence/if_cemac.c
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/ic/aic6915.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/ic/cs89x0.c
cvs rdiff -u -r1.100 -r1.101 src/sys/dev/ic/dp8390.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/ic/dp83932.c
cvs rdiff -u -r1.139 -r1.140 src/sys/dev/ic/elinkxl.c
cvs rdiff -u -r1.136 -r1.137 src/sys/dev/ic/gem.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/ic/hd64570.c
cvs rdiff -u -r1.109 -r1.110 src/sys/dev/ic/hme.c
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/ic/i82557.c
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/ic/mb86960.c \
src/sys/dev/ic/smc83c170.c
cvs rdiff -u -r1.175 -r1.176 src/sys/dev/ic/rtl8169.c
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/ic/rtl81x9.c
cvs rdiff -u -r1.211 -r1.212 src/sys/dev/ic/tulip.c
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/if_age.c
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/pci/if_alc.c
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/if_ale.c
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/if_aq.c src/sys/dev/pci/if_cas.c
cvs rdiff -u -r1.391 -r1.392 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/pci/if_bnx.c
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pci/if_ena.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/if_iavf.c
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/pci/if_ixl.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/if_rge.c
cvs rdiff -u -r1.191 -r1.192 src/sys/dev/pci/if_sip.c
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/pci/if_ste.c
cvs rdiff -u -r1.91 -r1.92 src/sys/dev/pci/if_stge.c
cvs rdiff -u -r1.125 -r1.126 src/sys/dev/pci/if_tl.c
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/pci/if_txp.c
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/pci/if_vge.c
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/pci/if_vioif.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/if_vmx.c
cvs rdiff -u -r1.137 -r1.138 src/sys/dev/pci/if_vr.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_vte.c
cvs rdiff -u -r1.798 -r1.799 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/igc/if_igc.c
cvs rdiff -u -r1.116 -r1.117 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.351 -r1.352 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.79 -r1.80 src/sys/dev/sbus/qe.c
cvs rdiff -u -r1.108 -r1.109 src/sys/dev/usb/if_cue.c
cvs rdiff -u -r1.529 -r1.530 src/sys/net/if.c
cvs rdiff -u -r1.189 -r1.190 src/sys/net/if_bridge.c
cvs rdiff -u -r1.4 -r1.5 src/sys/net/if_stats.h
cvs rdiff -u -r1.171 -r1.172 src/sys/net/if_vlan.c
cvs rdiff -u -r1.56 -r1.57 src/sys/net/agr/if_agr.c
cvs rdiff -u -r1.70 -r1.71 src/sys/net/lagg/if_lagg.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58377 CVS commit: src/sys/sys
Date: Sat, 29 Jun 2024 13:04:20 +0000
Module Name: src
Committed By: riastradh
Date: Sat Jun 29 13:04:20 UTC 2024
Modified Files:
src/sys/sys: param.h
Log Message:
Welcome to NetBSD 10.99.11, courtesy of sdt:::set-error probe.
PR kern/58378
(and also if_stat..._ref API change, PR kern/58377)
To generate a diff of this commit:
cvs rdiff -u -r1.733 -r1.734 src/sys/sys/param.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58377 CVS commit: src/sys/net
Date: Mon, 1 Jul 2024 13:13:37 +0000
Module Name: src
Committed By: riastradh
Date: Mon Jul 1 13:13:37 UTC 2024
Modified Files:
src/sys/net: if_stats.h
Log Message:
if_stats(9): New dtrace probes on if_statinc/dec/add/sub_ref.
PR kern/58377
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/net/if_stats.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Tue, 23 Jul 2024 20:54:42 +0000
State-Changed-Why:
fixed in HEAD, kernel revbump means no pullup
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.