From: David Ahern <dsahern@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>,
LKML <linux-kernel@vger.kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH v2] tracing/ipv4/ipv6: Use static array for name field in fib*_lookup_table event
Date: Mon, 4 Jul 2022 13:09:01 -0600 [thread overview]
Message-ID: <38135333-b277-1b1b-8346-1da2e1f114a7@gmail.com> (raw)
In-Reply-To: <20220704091436.3705edbf@rorschach.local.home>
On 7/4/22 7:14 AM, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
>
> The fib_lookup_table and fib6_lookup_table events declare name as a
> dynamic_array, but also give it a fixed size, which defeats the purpose of
> the dynamic array, especially since the dynamic array also includes meta
> data in the event to specify its size.
>
> Since the size of the name is at most 16 bytes (defined by IFNAMSIZ),
> it is not worth spending the effort to determine the size of the string.
>
> Just use a fixed size array and copy into it. This will save 4 bytes that
> are used for the meta data that saves the size and position of a dynamic
> array, and even slightly speed up the event processing.
>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> Changes since v1: https://lkml.kernel.org/r/20220703102359.30f12e39@rorschach.local.home
> - Just use a fixed size array instead of calculating the
> size needed for the dynamic allocation.
>
> include/trace/events/fib.h | 6 +++---
> include/trace/events/fib6.h | 8 ++++----
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
Reviewed-by: David Ahern <dsahern@kernel.org>
next prev parent reply other threads:[~2022-07-04 19:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 13:14 Steven Rostedt
2022-07-04 19:09 ` David Ahern [this message]
2022-07-05 14:00 ` Steven Rostedt
2022-07-05 19:18 ` 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=38135333-b277-1b1b-8346-1da2e1f114a7@gmail.com \
--to=dsahern@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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
all inboxes | Powered by JetHome®