From: Steven Rostedt <rostedt@goodmis•org>
To: linux-kernel@vger•kernel.org
Cc: Ingo Molnar <mingo@kernel•org>,
Andrew Morton <akpm@linux-foundation•org>,
Marek Lindner <mareklindner@neomailbox•ch>,
Simon Wunderlich <sw@simonwunderlich•de>,
Antonio Quartulli <a@unstable•cc>,
Sven Eckelmann <sven@narfation•org>,
"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
Subject: [for-next][PATCH 17/23] batman-adv: tracing: Use the new __vstring() helper
Date: Thu, 14 Jul 2022 12:43:13 -0400 [thread overview]
Message-ID: <20220714164331.060725040@goodmis.org> (raw)
In-Reply-To: 20220714164256.403842845@goodmis.org
From: "Steven Rostedt (Google)" <rostedt@goodmis•org>
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/20220705224751.080390002@goodmis.org
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: Sven Eckelmann <sven@narfation•org>
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
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis•org>
---
net/batman-adv/trace.h | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/batman-adv/trace.h b/net/batman-adv/trace.h
index d673ebdd0426..67d2a8a0196c 100644
--- a/net/batman-adv/trace.h
+++ b/net/batman-adv/trace.h
@@ -40,16 +40,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
next prev parent reply other threads:[~2022-07-14 16:44 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 ` [for-next][PATCH 05/23] neighbor: tracing: Have neigh_create event use __string() Steven Rostedt
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 ` Steven Rostedt [this message]
2022-07-24 21:31 ` [for-next][PATCH 17/23] batman-adv: tracing: " 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=20220714164331.060725040@goodmis.org \
--to=rostedt@goodmis$(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=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