From nobody Wed Feb 18 19:41:53 2026 X-Original-To: dev-commits-src-main@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 4fGRjb3QrNz6SjCf for ; Wed, 18 Feb 2026 19:42:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) (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 4fGRjZ47yQz3m0y for ; Wed, 18 Feb 2026 19:42:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-c54f700b5b1so110643a12.0 for ; Wed, 18 Feb 2026 11:42:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771443724; cv=none; d=google.com; s=arc-20240605; b=LkXG6unTjzBMVyYJEL+wIkJOpHlKK/ihj+TbROk1ngI/5W1mOFDQNe4v55ri+wv/nV sVWQkS206VwmbA9fCk2Fjny7V8gSQim0KOxadidvYXhAIEPZTApyx9clt8eY28unvRIM 4gv/pPjAETrwrpiSb/MYmrhJWTSBpemF9qg8feX7QeegHRc0F4ZCYHSuW/iRmZuYUE2R 83SQOVeqA5R2JcIbUEoSWEUvT94c/Cv0D8CCkd+47kZ2v/fV/3pNq+KhSu/vuxddEs9h 7aiTaFMt9ET0qt3USJjK+CI3LGYBc6DWK1QPpvrTWzfmfVAdksYhjZfC5su1gQjfby85 QKSQ== 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=I/qZzvm+cXX2ITyl2v+LIo4fr0eJ6wYuKaB96WIPKv8=; b=IJEK7TjES3VBQByK8/jUV6491aLBBaZ+hNvg57BbteFD9PfDYFwmJvVmEVcOAF+wKH QwDcEeGQKtn2mc6GAptp1Aw2gSVRto99Jy+o18VsH0ryw/VblC1Pzl64aGdK9FBkCEuh HTmLYx1ePjGh2cLCL14uMzJYTkEEy1rNmqEBLMMqVCbIn3SFMACnYH5BhJWZm1h592m5 SYP7yGNQ9pb2OQ3bNK1QB7jTdjzp42mqEzTcWnTK7ARQBHNRwoq3fTssua/QQ3ShAQkz run0CTCj91NelioeWjx44ptqfcqBmN2hCDPEXZYLFFCwfId1HCNf03tn3qnNpkZo5xYi bsrA==; 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=DwtwhWfAWWpNW8/UZr42XMBkeUmT23U6etMaqu9k1ncNwjXVtRzwIyZV8Q3XwEQE0t zY0qd0ehtIzEWzXhdhzIql1RJzJOF8/I0b8f1noqyLYMy4iGzdYxRQcGP8Xy7+VdW8Bx JWi1KdXZwaT24yu3rqzSJvcZCDqAjCWi9l2WXP7XeXM1yT8I3a0Vf+hEstBP7EM75veh ilDS0CrANwi98VOSiYrLcnYM6u8dtja1iZi8911ahnNNPfpvjWXRDMyHMM4MCvg4ki2i +Qus2H1Owu3DA5bATPhEibvoCBYYCVhxJUiXS18jKekzGp5W0tmgxbgJmE5lQ3SIr7pa HUsw== X-Forwarded-Encrypted: i=1; AJvYcCXAuPCStjSyAnX8GBVxx7gguZkdolxMIPfhmvuSb9SmGKkrwB5bk0mai2cXRjyR2+oP5gcP/84umy8hiCFCSPIEnQSy1A==@freebsd.org X-Gm-Message-State: AOJu0YxJEsHEliCFEozVGzDSV7OoPRx6L8ZoH1rDxcsv2wMziFJDTqSh e6bqGRSdVEbFBc90NYjlv+UTyrzWR6qmIP+4LtadygQcZ5sh2r+pYxJ8aAw3R3o6qEOvgSgdjFG PR/SmWYoK9UvIIhmpQf/0Dy6GLfabZCLidCE74yJgHw== X-Gm-Gg: AZuq6aL+bIk1ilvsiodxkKHo05WLaED7+Jw+rpyYkYlTeFXmW/J+dxQNQuwE88s/CLD osz/wjO8nPhri0+GuDN2XJvVZqwijeRXlzEzbuBW+Kk5RhBYeq5l0aOMx8jWllfUCtkueQjfcTD Uz1HxRwWPEptYy+uUNrd98CX4W5l8Ngnqjzz3415iEs9TzlxG5lBRcEWSFC1Gii3H2csJOtxGXG WgauunI1HhfwE4hJrGg6QzfnNmUgn9ux0FlYXOoVl8UOMJFW1l4VqynJVXb5SASwsWghyCR73tr jw+lvWA1DCR2dQPB2R48iU6S40YgFK//UNEkXRlJSYZoj+Caeldm 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 4fGRjZ47yQz3m0y 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--