From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
David Ahern <dsahern@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
David Ahern <dsahern@kernel.org>
Subject: [for-next][PATCH 05/23] neighbor: tracing: Have neigh_create event use __string()
Date: Thu, 14 Jul 2022 12:43:01 -0400 [thread overview]
Message-ID: <20220714164328.829739741@goodmis.org> (raw)
In-Reply-To: 20220714164256.403842845@goodmis.org
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
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>
---
include/trace/events/neigh.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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)
--
2.35.1
next prev parent reply other threads:[~2022-07-14 16:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220714164256.403842845@goodmis.org>
2022-07-14 16:42 ` [for-next][PATCH 03/23] tracing: devlink: Use static array for string in devlink_trap_report even Steven Rostedt
2022-07-14 18:40 ` Ido Schimmel
2022-07-14 19:05 ` Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 04/23] tracing/ipv4/ipv6: Use static array for name field in fib*_lookup_table event Steven Rostedt
2022-07-14 16:43 ` Steven Rostedt [this message]
2022-07-14 16:43 ` [for-next][PATCH 08/23] tracing/ath: Use the new __vstring() helper Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 09/23] tracing/brcm: " Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 10/23] tracing/iwlwifi: " Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 17/23] batman-adv: tracing: " Steven Rostedt
2022-07-24 21:31 ` Sven Eckelmann
2022-07-24 23:12 ` Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 18/23] mac80211: " Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220714164328.829739741@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=dsahern@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).