From: Greg Kroah-Hartman <gregkh@linuxfoundation•org>
To: linux-kernel@vger•kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
stable@vger•kernel.org,
Marek Lindner <mareklindner@neomailbox•ch>,
Ingo Molnar <mingo@kernel•org>,
Andrew Morton <akpm@linux-foundation•org>,
Simon Wunderlich <sw@simonwunderlich•de>,
Antonio Quartulli <a@unstable•cc>,
"David S. Miller" <davem@davemloft•net>,
Eric Dumazet <edumazet@google•com>,
Jakub Kicinski <kuba@kernel•org>, Paolo Abeni <pabeni@redhat•com>,
b.a.t.m.a.n@lists•open-mesh.org, netdev@vger•kernel.org,
Sven Eckelmann <sven@narfation•org>,
"Steven Rostedt (Google)" <rostedt@goodmis•org>,
Sasha Levin <sashal@kernel•org>
Subject: [PATCH 5.18 1046/1095] batman-adv: tracing: Use the new __vstring() helper
Date: Mon, 15 Aug 2022 20:07:25 +0200 [thread overview]
Message-ID: <20220815180512.360819821@linuxfoundation.org> (raw)
In-Reply-To: <20220815180429.240518113@linuxfoundation.org>
From: Steven Rostedt (Google) <rostedt@goodmis•org>
[ Upstream commit 9abc291812d784bd4a26c01af4ebdbf9f2dbf0bb ]
Instead of open coding a __dynamic_array() with a fixed length (which
defeats the purpose of the dynamic array in the first place). Use the new
__vstring() helper that will use a va_list and only write enough of the
string into the ring buffer that is needed.
Link: https://lkml.kernel.org/r/20220724191650.236b1355@rorschach.local.home
Cc: Marek Lindner <mareklindner@neomailbox•ch>
Cc: Ingo Molnar <mingo@kernel•org>
Cc: Andrew Morton <akpm@linux-foundation•org>
Cc: Simon Wunderlich <sw@simonwunderlich•de>
Cc: Antonio Quartulli <a@unstable•cc>
Cc: "David S. Miller" <davem@davemloft•net>
Cc: Eric Dumazet <edumazet@google•com>
Cc: Jakub Kicinski <kuba@kernel•org>
Cc: Paolo Abeni <pabeni@redhat•com>
Cc: b.a.t.m.a.n@lists•open-mesh.org
Cc: netdev@vger•kernel.org
Acked-by: Sven Eckelmann <sven@narfation•org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis•org>
Signed-off-by: Sasha Levin <sashal@kernel•org>
---
net/batman-adv/trace.h | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/net/batman-adv/trace.h b/net/batman-adv/trace.h
index d673ebdd0426..31c8f922651d 100644
--- a/net/batman-adv/trace.h
+++ b/net/batman-adv/trace.h
@@ -28,8 +28,6 @@
#endif /* CONFIG_BATMAN_ADV_TRACING */
-#define BATADV_MAX_MSG_LEN 256
-
TRACE_EVENT(batadv_dbg,
TP_PROTO(struct batadv_priv *bat_priv,
@@ -40,16 +38,13 @@ TRACE_EVENT(batadv_dbg,
TP_STRUCT__entry(
__string(device, bat_priv->soft_iface->name)
__string(driver, KBUILD_MODNAME)
- __dynamic_array(char, msg, BATADV_MAX_MSG_LEN)
+ __vstring(msg, vaf->fmt, vaf->va)
),
TP_fast_assign(
__assign_str(device, bat_priv->soft_iface->name);
__assign_str(driver, KBUILD_MODNAME);
- WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
- BATADV_MAX_MSG_LEN,
- vaf->fmt,
- *vaf->va) >= BATADV_MAX_MSG_LEN);
+ __assign_vstr(msg, vaf->fmt, vaf->va);
),
TP_printk(
--
2.35.1
parent reply other threads:[~2022-08-15 23:28 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20220815180429.240518113@linuxfoundation.org>]
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=20220815180512.360819821@linuxfoundation.org \
--to=gregkh@linuxfoundation$(echo .)org \
--cc=a@unstable$(echo .)cc \
--cc=akpm@linux-foundation$(echo .)org \
--cc=b.a.t.m.a.n@lists$(echo .)open-mesh.org \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=mareklindner@neomailbox$(echo .)ch \
--cc=mingo@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=rostedt@goodmis$(echo .)org \
--cc=sashal@kernel$(echo .)org \
--cc=stable@vger$(echo .)kernel.org \
--cc=sven@narfation$(echo .)org \
--cc=sw@simonwunderlich$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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