Skip to content

Commit

Permalink
neighbor: tracing: Have neigh_create event use __string()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt (Google) committed Jul 15, 2022
1 parent fca8300 commit 43b2aef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/trace/events/neigh.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 43b2aef

Please sign in to comment.