tracing/ipv4/ipv6: Use static array for name field in fib*_lookup_table event
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Mon, 4 Jul 2022 13:14:36 +0000 (09:14 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 15 Jul 2022 17:35:59 +0000 (13:35 -0400)
commitfca8300f68fe3fbb2fcda862f0f114011715b3bc
tree1b04c42045f28a8643c4b586a5f7a572d04eaddb
parent2a04b8d846dca196342862caecadd2a78460d8dc
tracing/ipv4/ipv6: Use static array for name field in fib*_lookup_table event

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.

Link: https://lkml.kernel.org/r/20220704091436.3705edbf@rorschach.local.home
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Acked-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
include/trace/events/fib.h
include/trace/events/fib6.h