lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 02 Feb 2024 08:48:39 +0100
From: Tobias Waldekranz <tobias@...dekranz.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, jiri@...nulli.us, ivecera@...hat.com,
 netdev@...r.kernel.org, roopa@...dia.com, razor@...ckwall.org,
 bridge@...ts.linux.dev, rostedt@...dmis.org, mhiramat@...nel.org,
 linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH v2 net-next 2/5] net: switchdev: Add helpers to display
 switchdev objects as strings

On tor, feb 01, 2024 at 20:49, Jakub Kicinski <kuba@...nel.org> wrote:
> On Tue, 30 Jan 2024 21:19:34 +0100 Tobias Waldekranz wrote:
>> Useful both in error messages and in tracepoints.
>
> Are you printing things together into one big string?
> Seems like leaving a lot of features on the table.
> trace point events can be filtered, not to mention attaching
> to them with bpftrace. 

My thinking was that __entry->msg was mostly for use by the tracepoint's
printf, and that if you are using some dynamic tracer, __entry->info
points to the verbatim notification which you can use to apply arbitrary
filtering.

> There's also a built-in way to show traces how to convert numerical ids
> to strings for the basic output - __print_symbolic().
> None of that can help here?

Originally, I did use it to display the `val` argument to the
tracepoint, but the problem with that macro is that it wants the mapping
table as an inline list of tuples, and the list must _not_ include a
trailing comma. This means that SWITCHDEV_TYPE_MAPPER can't use the
trailing-comment-after-the-last-item trick, which introduced an
asymmetry with the other mappers that I did not like.

At first, I thought about adding some variant of __print_symbolic that
would take a pointer to an existing table instead. Then I realized that
I would still need some separate stringer helper to put together the
rest of the printed message from the TLV-ish layout of
switchdev_notifier_info.

At that point, it seems more reasonable to just collect all logic of
turning switchdev related structs into strings in one place - with the
added benefit that drivers could use them to log richer error messages.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ