diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-07-06 00:37:41 +0200 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-07-15 19:35:59 +0200 |
commit | 43b2aef3735e0ddb4fc4e6401cd5dc1bf205dead (patch) | |
tree | 7c0946601b3986cc811211d4358ba46169d7c38a | |
parent | tracing/ipv4/ipv6: Use static array for name field in fib*_lookup_table event (diff) | |
download | linux-43b2aef3735e0ddb4fc4e6401cd5dc1bf205dead.tar.xz linux-43b2aef3735e0ddb4fc4e6401cd5dc1bf205dead.zip |
neighbor: tracing: Have neigh_create event use __string()
The dev field of the neigh_create event uses __dynamic_array() with a
fixed size, which defeats the purpose of __dynamic_array(). Looking at the
logic, as it already uses __assign_str(), just use the same logic in
__string to create the size needed. It appears that because "dev" can be
NULL, it needs the check. But __string() can have the same checks as
__assign_str() so use them there too.
Link: https://lkml.kernel.org/r/20220705183741.35387e3f@rorschach.local.home
Cc: David Ahern <dsahern@gmail.com>
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>
-rw-r--r-- | include/trace/events/neigh.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/trace/events/neigh.h b/include/trace/events/neigh.h index 62bb17516713..5eaa1fa99171 100644 --- a/include/trace/events/neigh.h +++ b/include/trace/events/neigh.h @@ -30,7 +30,7 @@ TRACE_EVENT(neigh_create, TP_STRUCT__entry( __field(u32, family) - __dynamic_array(char, dev, IFNAMSIZ ) + __string(dev, dev ? dev->name : "NULL") __field(int, entries) __field(u8, created) __field(u8, gc_exempt) |