Re: [PATCH v6 3/4] net: dropreason: use new __print_sym() in tracing

From: Adrián Moreno

Date: Tue Sep 22 2026 - 10:53:45 EST


On Tue, Sep 22, 2026 at 12:23:55AM +0200, Ilya Maximets wrote:
> On 9/22/26 12:03 AM, Matthieu Baerts wrote:
> > Hi Johannes,
> >
> > (+Cc openvswitch devs)
> >
> > On 21/09/2026 12:06, Johannes Berg wrote:
> >> From: Johannes Berg <johannes.berg@xxxxxxxxx>
> >>
> >> The __print_symbolic() could only ever print the core
> >> drop reasons, since that's the way the infrastructure
> >> works. Now that we have __print_sym() with all the
> >> advantages mentioned in that commit, convert to that
> >> and get all the drop reasons from all subsystems. As
> >> we already have a list of them, that's really easy.
> >>
> >> This is a little bit of .text (~100 bytes in my build)
> >> and saves a lot of .data (~17k).
> > Thank you for working on that! But it looks like it breaks the
> > openvswitch test:
> >
> > https://netdev-ctrl.bots.linux.dev/logview.html?f=%2Flogs%2Fvmksft%2Fnet%2Fresults%2F833743%2F9-openvswitch-sh%2Fstdout#L168
> >
> > Maybe the test needs to be adapted to get the same info differently?
> > (and adding CONFIG_TRACEPOINTS to the selftest config file)
> The parsing in the test will definitely need to be updated, i.e.,
> the numbers swapped with the names of the drop reasons.
>
> IIUC, this change only affects the printing and doesn't affect debugging
> tools like retis that attempt to surface the drop reasons. But, maybe
> Adrian and Antoine (CCed) may want to have a glance as well.
>

I don't think this will affect retis in a bad way. We collect the list
of drop reasons by inspecting the BTF enums. It generally works but we
need to keep track of new subsystems enums being added so a
dynamically-generated full-list of drop reasons is interesting.

IIUC, the only way for userspace to read this list is by looking at the
event format and parse the printf line, right? Any ideas to make this
more machine-friendly?

Thanks
--
Adrián