neighbor: tracing: Have neigh_create event use __string()
Subsystems (3)
Steven Rostedt
maintainerPATCH 1/1 neighbor: tracing: Have neigh_create event use __string()
From: "Steven Rostedt (Google)" <[email protected]>
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.
---
[ This is simpler logic than the fib* events, so I figured just
convert to __string() instead of a static __array() ]
include/trace/events/neigh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/trace/events/neigh.h +1 -1
@@ -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)
Signature · 1 line
2.35.1
Quoted 9 lines · Steven Rostedt
From: "Steven Rostedt (Google)" <[email protected]>
The dev field of the
neigh_createevent 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__stringto 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.
Quoted 9 lines
Cc David Ahern <[email protected]>Cc David S. Miller <[email protected]>Signed-off-by Steven Rostedt (Google) <[email protected]>---
[ This is simpler logic than the fib* events, so I figured just
convert to__string()instead of a static__array()]
agreed.
Jakub Kicinski
maintainerQuoted 9 lines · On Tue, 5 Jul 2022 18:37:41 -0400 Steven Rostedt wrote:
From: "Steven Rostedt (Google)" <[email protected]>
The dev field of the
neigh_createevent 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__stringto 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.
Quoted 8 lines
Cc David Ahern <[email protected]>Cc David S. Miller <[email protected]>Signed-off-by Steven Rostedt (Google) <[email protected]>---
[ This is simpler logic than the fib* events, so I figured just
convert to__string()instead of a static__array()]
This one is also going via your tree?
Steven Rostedt
maintainerQuoted 5 lines · On Thu, 7 Jul 2022 17:21:01 -0700 Jakub Kicinski <[email protected]> wrote:
Quoted 3 lines
[ This is simpler logic than the fib* events, so I figured just
convert to__string()instead of a static__array()]This one is also going via your tree?
Yep, I can pull it in too.
-- Steve
Quoted 6 lines · On Thu, 7 Jul 2022 20:56:22 -0400 Steven Rostedt wrote:
Quoted 4 lines
Quoted 2 lines
[ This is simpler logic than the fib* events, so I figured just
convert to__string()instead of a static__array()]This one is also going via your tree?
Yep, I can pull it in too.