From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Fred Herard <fred.herard@oracle.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: [PATCH 10/13] scsi: iscsi: tracing: Use the new __vstring() helper
Date: Tue, 05 Jul 2022 18:45:03 -0400 [thread overview]
Message-ID: <20220705224750.715763972@goodmis.org> (raw)
In-Reply-To: 20220705224453.120955146@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.
Cc: Fred Herard <fred.herard@oracle.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
include/trace/events/iscsi.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/trace/events/iscsi.h b/include/trace/events/iscsi.h
index 87408faf6e4e..8ff2a3ca5d75 100644
--- a/include/trace/events/iscsi.h
+++ b/include/trace/events/iscsi.h
@@ -26,12 +26,12 @@ DECLARE_EVENT_CLASS(iscsi_log_msg,
TP_STRUCT__entry(
__string(dname, dev_name(dev) )
- __dynamic_array(char, msg, ISCSI_MSG_MAX )
+ __vstring(msg, vaf->fmt, vaf->va)
),
TP_fast_assign(
__assign_str(dname, dev_name(dev));
- vsnprintf(__get_str(msg), ISCSI_MSG_MAX, vaf->fmt, *vaf->va);
+ __assign_vstr(msg, vaf->fmt, vaf->va);
),
TP_printk("%s: %s",__get_str(dname), __get_str(msg)
--
2.35.1
next prev parent reply other threads:[~2022-07-05 22:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-05 22:44 [PATCH 00/13] tracing/events: Add __vstring and __assign_vstr helpers Steven Rostedt
2022-07-05 22:44 ` [PATCH 01/13] tracing/events: Add __vstring() and __assign_vstr() helper macros Steven Rostedt
2022-07-07 1:35 ` Chunfeng Yun
2022-07-12 18:00 ` Steven Rostedt
2022-07-13 9:41 ` Chunfeng Yun
2022-07-15 21:42 ` [PATCH 01/13 v2] " Steven Rostedt
2022-07-15 21:44 ` Steven Rostedt
2022-07-05 22:44 ` [PATCH 02/13] tracing/IB/hfi1: Use the new __vstring() helper Steven Rostedt
2022-07-06 4:20 ` kernel test robot
2022-07-05 22:44 ` [PATCH 03/13] tracing/ath: " Steven Rostedt
2022-07-08 6:45 ` Kalle Valo
2022-07-05 22:44 ` [PATCH 04/13] tracing/brcm: " Steven Rostedt
2022-07-06 2:35 ` kernel test robot
2022-07-06 2:50 ` Steven Rostedt
2022-07-06 9:09 ` Arend Van Spriel
2022-07-06 11:51 ` Chen, Rong A
2022-07-08 5:02 ` Kalle Valo
2022-07-05 22:44 ` [PATCH 05/13] tracing/iwlwifi: " Steven Rostedt
2022-07-08 5:03 ` Kalle Valo
2022-07-05 22:44 ` [PATCH 06/13] usb: chipidea: tracing: " Steven Rostedt
2022-07-05 22:45 ` [PATCH 07/13] xhci: " Steven Rostedt
2022-07-05 22:45 ` [PATCH 08/13] USB: mtu3: " Steven Rostedt
2022-07-06 4:30 ` kernel test robot
2022-07-06 10:23 ` kernel test robot
2022-07-14 13:38 ` [PATCH 08/13 v2] " Steven Rostedt
2022-07-14 13:45 ` Greg Kroah-Hartman
2022-07-14 14:35 ` Steven Rostedt
2022-07-05 22:45 ` [PATCH 09/13] usb: musb: " Steven Rostedt
2022-07-05 22:45 ` Steven Rostedt [this message]
2022-07-05 22:45 ` [PATCH 11/13] scsi: qla2xxx: " Steven Rostedt
2022-07-05 22:45 ` [PATCH 12/13] batman-adv: " Steven Rostedt
2022-07-05 22:45 ` [PATCH 13/13] 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=20220705224750.715763972@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=fred.herard@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mingo@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