From nobody Wed Feb 18 19:41:53 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fGRjX0XJ1z6SjJ2 for ; Wed, 18 Feb 2026 19:42:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fGRjW4zrjz3lmb for ; Wed, 18 Feb 2026 19:42:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-352f60d6c2fso85567a91.1 for ; Wed, 18 Feb 2026 11:42:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771443724; cv=none; d=google.com; s=arc-20240605; b=HpDiz+AZMrsdpibym/GN/iAcYK13qg4KorKm3oBKV/UMkOM181du4Vhz5lfs21Z18h q66B3m+pJjnJl1ZfUKFNIIGDobiF4Bnm8Q7YDh8mp0tPqM96P4VHfOcF3KHkU85tUs7a XQGAfz/GNuwGQvacf31PpdYSTIzLFBnvku6LDVXe1pyz6QJ3BGzKbkwQ7VZaK3Y9eVNZ QbU8tBCWH3wmfvJoQOc6VDQbIhsyWEQdOhULl6LVWexxqTZ9kc+4P23slahBRhawCYm1 Mla7tyFqfTP2ONs/KPeoDwSvcGhCgN3tOSCu+I3HUWVkS7SqYQxzXxru7bhHYrjwe1SN KmmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=dtBh2QJwsg6LBIPxXRD85Oy4l5Cmw9XDc8w8G/peSR0=; fh=7ototWon0C9uWfHuW5o37ABi8nXZzeSN/coRE81/AZA=; b=S4UjmLTb1X1MFB2ICAfW8H+oiXQkEIYqycfdh/+W+MbBp6bhHS51awGLct6qXAJPnX IVW4r7Bv2JlRe1V5i5v8NOYdoXuJi901hYWFiwITOQ82OH/jKapegUHmIbQpbg7kp19N VOZdsOBQrd8EtCUtNmorEqm6lpNs/bYywNGZlY/i+b45W+5ri1pDF2sACcR6sFyymveR fHhu/Uf2GT4rPfm0KqF4k+NNUJNWts3r8vIO1+82R3acaVdooHFhCpHfNiYUMQBfRMlr Y1yywFujv45FOjaAzO//kkyhlNB48zXAfwqWYHanZIRctwzmzxSJ8x+gJIZWb+TdX5pp JaTw==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1771443724; x=1772048524; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dtBh2QJwsg6LBIPxXRD85Oy4l5Cmw9XDc8w8G/peSR0=; b=URN+/Gd3mwEM9681P3Ghn9FtqcQggAW0D/X3p2vdTFM007YwdZfCXoLEnaFOuK0vqc ikIu10rnEgcFPxgQuFQvBif1PPy8WrzlGczg7t+P/4bw8giMvPwdruRb01VeMbeLOCvw s0kdb/N++IBOm9qM/QKMgoK+n92AVPkPXDnMytBmTMMrEVhHDezkjP/1GMP2zACHhCY8 JaWJyfX17H4A29WN0Qv9J0qbC3Af5LUCDWBvD6n95Li2QnWcddgGWV8+2Cm/IurwVvUJ XfXFmauWHe62L9f4mx4ARzjQXQeEptUYIX5PCT3+uPWtfbda5Ge2RRNrHZaBAroHRf/9 NxBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771443724; x=1772048524; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dtBh2QJwsg6LBIPxXRD85Oy4l5Cmw9XDc8w8G/peSR0=; b=Q9nhWwF8O4iBbn9S+XyElx4UpP7dgYoe7O1fzaGsgSCLF8C0amGz0kcqG4OGsX776g lOHUFN1e65ir+Sb7JyQjUjhNVwz0uGY5aivBQLNa//Qz8L/L1yoqkejvjpo4OfEkrIXX /jMGWf13rzautCX6mHuDZC3utdjXAZxqT9Om2rJ2Pb9IA1zc+jRXVaGT7srwoddLRHG4 RmQFCOPJMLq4Om4iqCG0+6Nr6alAHzWpFLQqBrF91yBTM/sNaykYq/55a8hpqgS8RnSb d0jeFPZR4yc2c703ZMYk+Bo+CLyHGlAH8Z5i3485dInjAxAmQ3qkiOmgIlcB0DasvwRe fKHg== X-Forwarded-Encrypted: i=1; AJvYcCUl6bWRJTa5MrTuQYMqRlJHNEwckfHxGMD39JXO0dHaan7Ggj5OLoQXXXQ2V2f6CrN6NfiQZD6SasyNOK6MmUNLzd90@freebsd.org X-Gm-Message-State: AOJu0YykTses4raNUDAIRG6bgBqUGb9UM5ZafZOUD2lLlzXJagcNaSQb 86Bw5hd7zFrMhIRA14OZFEaGfs+r6pO7xm3mMmn7Yk9DHZ9nf9SB/TnbTsRy/F0S5/CXtCdsgTr bVfoK6rSuO8BCwp582OALIarzpo/Rpb3nOreRZG1nfg== X-Gm-Gg: AZuq6aJYBJJMu6acW31egtvcCa5RcPpso/pVvEFvk4ndPqbGaDWPMkXgoDV0TBgLImS XOOYHoBVT7fAmXKtyM8P0a4xh6MkBbKcuE0jLESpCI79vZwHFMheXJ5PkqsB2md78BN6C+fjGag RaR+k7RmpUP25omg1z+NIyRwcCOSOIA3ekJUCT96RZ6kIBya1yuzRf9JICRYQ0C/7jYO0aURktr fqyfLQHgawwNPwKoYGwET9m7AwV9fnfXNz/QKUNxXroeXIEX52BLwSV1tG8yjv2OvQ7X7XGNfVf UcDOTC6w21Fh7hV+mvUNX82dM6pQEktBZvGauLW/cZlxdQECwErh X-Received: by 2002:a17:90b:1345:b0:343:f509:aa4a with SMTP id 98e67ed59e1d1-358450ebeb4mr14554266a91.36.1771443724189; Wed, 18 Feb 2026 11:42:04 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <6995eeee.37508.1de1224c@gitrepo.freebsd.org> <06f7c9c0-a681-4573-8b1d-83b65f825d5b@FreeBSD.org> In-Reply-To: <06f7c9c0-a681-4573-8b1d-83b65f825d5b@FreeBSD.org> From: Warner Losh Date: Wed, 18 Feb 2026 12:41:53 -0700 X-Gm-Features: AaiRm534rTOj3L-gtOWn8cYZWBUezibaNOso53_PU_csKYmDpfv5tjR_GW3KP0c Message-ID: Subject: Re: git: 8e593a1f1432 - main - fortune: fix netstat tip To: John Baldwin Cc: Warner Losh , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000eb8d83064b1e615b" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4fGRjW4zrjz3lmb X-Spamd-Bar: ---- --000000000000eb8d83064b1e615b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 18, 2026, 11:51=E2=80=AFAM John Baldwin wrote= : > On 2/18/26 11:55, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D8e593a1f143203cace2e14bd6629a8e= bdf9b47dc > > > > commit 8e593a1f143203cace2e14bd6629a8ebdf9b47dc > > Author: Warner Losh > > AuthorDate: 2026-02-10 14:59:58 +0000 > > Commit: Warner Losh > > CommitDate: 2026-02-18 16:39:28 +0000 > > > > fortune: fix netstat tip > > > > netstati 8 reports in bytes per second (averaged over 8 > > seconds) rather than bits per second because it reports the total > > in bits over the 8 seconds... > > > > Sponsored by: Netflix > > Eh, I originally thought this too, but the original hint is right. netst= at > doesn't report a per-second average, just the delta, so when using '8' it > is showing the number of bytes sent/received in the 8 second interval whi= ch > effectively multiplies the per-second rate by 8, so if it is a constant > rate you get the bits-per-second as the output. > > Relevant code from sidewaysintpr() in if.c: > > fill_iftot(new); > > xo_open_instance("stats"); > show_stat("lu", 10, "received-packets", > new->ift_ip - old->ift_ip, 1, 1); > show_stat("lu", 5, "received-errors", > new->ift_ie - old->ift_ie, 1, 1); > show_stat("lu", 5, "dropped-packets", > new->ift_id - old->ift_id, 1, 1); > show_stat("lu", 10, "received-bytes", > new->ift_ib - old->ift_ib, 1, 0); > show_stat("lu", 10, "sent-packets", > new->ift_op - old->ift_op, 1, 1); > show_stat("lu", 5, "send-errors", > new->ift_oe - old->ift_oe, 1, 1); > show_stat("lu", 10, "sent-bytes", > new->ift_ob - old->ift_ob, 1, 0); > show_stat("NRSlu", 5, "collisions", > new->ift_co - old->ift_co, 1, 1); > if (dflag) > show_stat("LSlu", 5, "dropped-packets", > new->ift_od - old->ift_od, 1, 1); > xo_close_instance("stats"); > xo_emit("\n"); > xo_flush(); > > (Note no scaling, just 'new - old') > Oh. Damn. I'll revert --=20 > John Baldwin > > --000000000000eb8d83064b1e615b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, Feb 18, 2026, 11:51=E2= =80=AFAM John Baldwin <jhb@freebsd.or= g> wrote:
On 2/18/26 11:55, = Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D8e593a1f143203cace2e14bd6629a8= ebdf9b47dc
>
> commit 8e593a1f143203cace2e14bd6629a8ebdf9b47dc
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2026-02-10 14:59:58 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2026-02-18 16:39:28 +0000
>
>=C2=A0 =C2=A0 =C2=A0 fortune: fix netstat tip
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 netstati <mumble> 8 reports in bytes per sec= ond (averaged over 8
>=C2=A0 =C2=A0 =C2=A0 seconds) rather than bits per second because it re= ports the total
>=C2=A0 =C2=A0 =C2=A0 in bits over the 8 seconds...
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Netflix

Eh, I originally thought this too, but the original hint is right.=C2=A0 ne= tstat
doesn't report a per-second average, just the delta, so when using '= ;8' it
is showing the number of bytes sent/received in the 8 second interval which=
effectively multiplies the per-second rate by 8, so if it is a constant
rate you get the bits-per-second as the output.

Relevant code from sidewaysintpr() in if.c:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 fill_iftot(new);

=C2=A0 =C2=A0 =C2=A0 =C2=A0 xo_open_instance("stats");
=C2=A0 =C2=A0 =C2=A0 =C2=A0 show_stat("lu", 10, "received-pa= ckets",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 new->ift_ip - old->ift_ip, = 1, 1);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 show_stat("lu", 5, "received-err= ors",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 new->ift_ie - old->ift_ie, = 1, 1);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 show_stat("lu", 5, "dropped-pack= ets",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 new->ift_id - old->ift_id, = 1, 1);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 show_stat("lu", 10, "received-by= tes",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 new->ift_ib - old->ift_ib, = 1, 0);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 show_stat("lu", 10, "sent-packet= s",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 new->ift_op - old->ift_op, = 1, 1);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 show_stat("lu", 5, "send-errors&= quot;,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 new->ift_oe - old->ift_oe, = 1, 1);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 show_stat("lu", 10, "sent-bytes&= quot;,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 new->ift_ob - old->ift_ob, = 1, 0);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 show_stat("NRSlu", 5, "collision= s",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 new->ift_co - old->ift_co, = 1, 1);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (dflag)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 show_stat("LSl= u", 5, "dropped-packets",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 new-&= gt;ift_od - old->ift_od, 1, 1);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 xo_close_instance("stats");
=C2=A0 =C2=A0 =C2=A0 =C2=A0 xo_emit("\n");
=C2=A0 =C2=A0 =C2=A0 =C2=A0 xo_flush();

(Note no scaling, just 'new - old')

Oh. Damn. I'll revert
<= div dir=3D"auto">
--
John Baldwin

--000000000000eb8d83064b1e615b--