Messages in this thread | | | Date | Mon, 4 Jul 2022 13:09:01 -0600 | Subject | Re: [PATCH v2] tracing/ipv4/ipv6: Use static array for name field in fib*_lookup_table event | From | David Ahern <> |
| |
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>
| |