From: Ido Schimmel <idosch@idosch.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH v2] tracing: devlink: Use static array for string in devlink_trap_report even
Date: Wed, 13 Jul 2022 09:34:09 +0300 [thread overview]
Message-ID: <Ys5nYctVGd6WD70M@shredder> (raw)
In-Reply-To: <20220712185820.002d9fb5@gandalf.local.home>
On Tue, Jul 12, 2022 at 06:58:20PM -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
>
> The trace event devlink_trap_report uses the __dynamic_array() macro to
> determine the size of the input_dev_name field. This is because it needs
> to test the dev field for NULL, and will use "NULL" if it is. But it also
> has the size of the dynamic array as a fixed IFNAMSIZ bytes. This defeats
> the purpose of the dynamic array, as this will reserve that amount of
> bytes on the ring buffer, and to make matters worse, it will even save
> that size in the event as the event expects it to be dynamic (for which it
> is not).
>
> Since IFNAMSIZ is just 16 bytes, just make it a static array and this will
> remove the meta data from the event that records the size.
>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Leon Romanovsky <leon@kernel.org>
> Cc: Jiri Pirko <jiri@nvidia.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
next prev parent reply other threads:[~2022-07-13 6:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-12 22:58 [PATCH v2] tracing: devlink: Use static array for string in devlink_trap_report even Steven Rostedt
2022-07-13 6:34 ` Ido Schimmel [this message]
2022-07-13 19:51 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ys5nYctVGd6WD70M@shredder \
--to=idosch@idosch.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).