Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Sep 2024 17:29:15 +0100
From:      Warner Losh <imp@bsdimp.com>
To:        Mark Johnston <markj@freebsd.org>
Cc:        Warner Losh <imp@freebsd.org>, src-committers@freebsd.org,  dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org,  Bram <bram@cbbg.nl>
Subject:   Re: git: 94567c8641e2 - main - netstat: Resolve duplicate "dropped-packets" key from libxo output
Message-ID:  <CANCZdfrDq28V0caVeUSwmLzNWCcTwK7zkPdMZS%2Bz611XnNncWw@mail.gmail.com>
In-Reply-To: <ZvA1CjfQ0HN69UrE@nuc>
References:  <202409201558.48KFwAEN048834@gitrepo.freebsd.org> <Zu_xk5GoyC2ykk7Q@nuc> <CANCZdfqAaAGc2ES8gtOX6Tx2WZsSthGdcSxUNtcZWKqYDwKzSQ@mail.gmail.com> <ZvA1CjfQ0HN69UrE@nuc>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000a36e150622b7c631
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sun, Sep 22, 2024 at 4:17=E2=80=AFPM Mark Johnston <markj@freebsd.org> w=
rote:

> On Sun, Sep 22, 2024 at 02:19:54PM +0100, Warner Losh wrote:
> > On Sun, Sep 22, 2024 at 11:29=E2=80=AFAM Mark Johnston <markj@freebsd.o=
rg>
> wrote:
> >
> > > On Fri, Sep 20, 2024 at 03:58:10PM +0000, Warner Losh wrote:
> > > > The branch main has been updated by imp:
> > > >
> > > > URL:
> > >
> https://cgit.FreeBSD.org/src/commit/?id=3D94567c8641e235763b5b2926416d89d=
36654cde1
> > > >
> > > > commit 94567c8641e235763b5b2926416d89d36654cde1
> > > > Author:     Bram <bram@cbbg.nl>
> > > > AuthorDate: 2024-07-23 08:57:42 +0000
> > > > Commit:     Warner Losh <imp@FreeBSD.org>
> > > > CommitDate: 2024-09-20 15:06:26 +0000
> > > >
> > > >     netstat: Resolve duplicate "dropped-packets" key from libxo
> output
> > > >
> > > >     The current libxo output uses the "dropped-packets" key for bot=
h
> > > incoming and
> > > >     outgoing packets. This commit distinguishes between the two by
> > > adding an "in"
> > > >     and "out" suffix. The original "dropped-packets" key is kept fo=
r
> > > backwards
> > > >     compatibility for now.
> > > >
> > > >     PR: 244589
> > > >     Reviewed by: imp, zlei
> > > >     Pull Request: https://github.com/freebsd/freebsd-src/pull/1331
> > > > ---
> > > >  usr.bin/netstat/if.c | 10 ++++++++--
> > > >  1 file changed, 8 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
> > > > index 172ea5324ccb..f0af785bce04 100644
> > > > --- a/usr.bin/netstat/if.c
> > > > +++ b/usr.bin/netstat/if.c
> > > > @@ -501,8 +501,11 @@ intpr(void (*pfunc)(char *), int af)
> > > >                   IFA_STAT(ipackets), link|network, 1);
> > > >               show_stat("lu", nerr_len, "received-errors",
> > > IFA_STAT(ierrors),
> > > >                   link, 1);
> > > > +             /* Below is kept for backwards compatibility. Will be
> > > removed in the future. */
> > > >               show_stat("lu", nerr_len, "dropped-packets",
> > > IFA_STAT(iqdrops),
> > > >                   link, 1);
> > > > +             show_stat("lu", nerr_len, "dropped-packets-in",
> > > IFA_STAT(iqdrops),
> > > > +                 link, 1);
> > >
> > > This breaks plain netstat output, causing a bunch of network tests to
> > > fail.  For instance, "netstat -Wf link -I re0" now prints an extra
> > > column.
> > >
> > > I think we should not bother with backwards compat unless libxo is
> > > emitting structured output.  This can be implemented using the "e"
> > > format modifier described in the xo_format modified, but I'm not sure
> > > how to plumb it through show_stat().
> > >
> > > Let's revert until this is fixed?
> > >
> >
> > Works for me. I hadn't noticed before the push. Thanks for bringing it
> up.
>
> Thanks, the tests seem to be fixed now.
>

Thanks for the quick shout out it was a problem...

--000000000000a36e150622b7c631
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Sun, Sep 22, 2024 at 4:17=E2=80=AF=
PM Mark Johnston &lt;<a href=3D"mailto:markj@freebsd.org">markj@freebsd.org=
</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:=
0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">=
On Sun, Sep 22, 2024 at 02:19:54PM +0100, Warner Losh wrote:<br>
&gt; On Sun, Sep 22, 2024 at 11:29=E2=80=AFAM Mark Johnston &lt;<a href=3D"=
mailto:markj@freebsd.org" target=3D"_blank">markj@freebsd.org</a>&gt; wrote=
:<br>
&gt; <br>
&gt; &gt; On Fri, Sep 20, 2024 at 03:58:10PM +0000, Warner Losh wrote:<br>
&gt; &gt; &gt; The branch main has been updated by imp:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; URL:<br>
&gt; &gt; <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D94567c8641e2=
35763b5b2926416d89d36654cde1" rel=3D"noreferrer" target=3D"_blank">https://=
cgit.FreeBSD.org/src/commit/?id=3D94567c8641e235763b5b2926416d89d36654cde1<=
/a><br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; commit 94567c8641e235763b5b2926416d89d36654cde1<br>
&gt; &gt; &gt; Author:=C2=A0 =C2=A0 =C2=A0Bram &lt;<a href=3D"mailto:bram@c=
bbg.nl" target=3D"_blank">bram@cbbg.nl</a>&gt;<br>
&gt; &gt; &gt; AuthorDate: 2024-07-23 08:57:42 +0000<br>
&gt; &gt; &gt; Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&g=
t;<br>
&gt; &gt; &gt; CommitDate: 2024-09-20 15:06:26 +0000<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0netstat: Resolve duplicate &quot;dropped-=
packets&quot; key from libxo output<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0The current libxo output uses the &quot;d=
ropped-packets&quot; key for both<br>
&gt; &gt; incoming and<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0outgoing packets. This commit distinguish=
es between the two by<br>
&gt; &gt; adding an &quot;in&quot;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0and &quot;out&quot; suffix. The original =
&quot;dropped-packets&quot; key is kept for<br>
&gt; &gt; backwards<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0compatibility for now.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0PR: 244589<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0Reviewed by: imp, zlei<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0Pull Request: <a href=3D"https://github.c=
om/freebsd/freebsd-src/pull/1331" rel=3D"noreferrer" target=3D"_blank">http=
s://github.com/freebsd/freebsd-src/pull/1331</a><br>
&gt; &gt; &gt; ---<br>
&gt; &gt; &gt;=C2=A0 usr.bin/netstat/if.c | 10 ++++++++--<br>
&gt; &gt; &gt;=C2=A0 1 file changed, 8 insertions(+), 2 deletions(-)<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c<br>
&gt; &gt; &gt; index 172ea5324ccb..f0af785bce04 100644<br>
&gt; &gt; &gt; --- a/usr.bin/netstat/if.c<br>
&gt; &gt; &gt; +++ b/usr.bin/netstat/if.c<br>
&gt; &gt; &gt; @@ -501,8 +501,11 @@ intpr(void (*pfunc)(char *), int af)<br=
>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0IFA_STAT(ipackets), link|network, 1);<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_s=
tat(&quot;lu&quot;, nerr_len, &quot;received-errors&quot;,<br>
&gt; &gt; IFA_STAT(ierrors),<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0link, 1);<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Below is=
 kept for backwards compatibility. Will be<br>
&gt; &gt; removed in the future. */<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_s=
tat(&quot;lu&quot;, nerr_len, &quot;dropped-packets&quot;,<br>
&gt; &gt; IFA_STAT(iqdrops),<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0link, 1);<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show_stat(&=
quot;lu&quot;, nerr_len, &quot;dropped-packets-in&quot;,<br>
&gt; &gt; IFA_STAT(iqdrops),<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0link, 1);<br>
&gt; &gt;<br>
&gt; &gt; This breaks plain netstat output, causing a bunch of network test=
s to<br>
&gt; &gt; fail.=C2=A0 For instance, &quot;netstat -Wf link -I re0&quot; now=
 prints an extra<br>
&gt; &gt; column.<br>
&gt; &gt;<br>
&gt; &gt; I think we should not bother with backwards compat unless libxo i=
s<br>
&gt; &gt; emitting structured output.=C2=A0 This can be implemented using t=
he &quot;e&quot;<br>
&gt; &gt; format modifier described in the xo_format modified, but I&#39;m =
not sure<br>
&gt; &gt; how to plumb it through show_stat().<br>
&gt; &gt;<br>
&gt; &gt; Let&#39;s revert until this is fixed?<br>
&gt; &gt;<br>
&gt; <br>
&gt; Works for me. I hadn&#39;t noticed before the push. Thanks for bringin=
g it up.<br>
<br>
Thanks, the tests seem to be fixed now.<br></blockquote><div><br></div><div=
>Thanks for the quick shout out it was a problem...=C2=A0</div></div></div>

--000000000000a36e150622b7c631--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrDq28V0caVeUSwmLzNWCcTwK7zkPdMZS%2Bz611XnNncWw>