All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Chunfeng Yun <chunfeng.yun@mediatek.com>
Cc: <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	<linux-usb@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [for-next][PATCH 13/23] USB: mtu3: tracing: Use the new __vstring() helper
Date: Fri, 15 Jul 2022 17:24:23 -0400	[thread overview]
Message-ID: <20220715172423.6b57b9eb@gandalf.local.home> (raw)
In-Reply-To: <962e59c25e981676014157cd111db9e16e237339.camel@mediatek.com>

On Fri, 15 Jul 2022 18:01:44 +0800
Chunfeng Yun <chunfeng.yun@mediatek.com> wrote:

>  irq/254-1120100-137     [000] d..1.   266.629662: mtu3_log:
> 11201000.usb: ep0_state SETUPr-speed
> 
> "r-speed" seems the remain of last log;

I found an off-by-one bug in the vstring patch. I'll rebase, test and try
again.

In the mean time, care to add this on top to make sure it's fixed?

Thanks!

-- Steve

diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
index e6f8ba52a958..b18759a673c6 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -922,16 +922,16 @@ perf_trace_buf_submit(void *raw_data, int size, int rctx, u16 type,
  * gcc warns that you can not use a va_list in an inlined
  * function. But lets me make it into a macro :-/
  */
-#define __trace_event_vstr_len(fmt, va)		\
-({						\
-	va_list __ap;				\
-	int __ret;				\
-						\
-	va_copy(__ap, *(va));			\
-	__ret = vsnprintf(NULL, 0, fmt, __ap);	\
-	va_end(__ap);				\
-						\
-	min(__ret, TRACE_EVENT_STR_MAX);	\
+#define __trace_event_vstr_len(fmt, va)			\
+({							\
+	va_list __ap;					\
+	int __ret;					\
+							\
+	va_copy(__ap, *(va));				\
+	__ret = vsnprintf(NULL, 0, fmt, __ap) + 1;	\
+	va_end(__ap);					\
+							\
+	min(__ret, TRACE_EVENT_STR_MAX);		\
 })
 
 #endif /* _LINUX_TRACE_EVENT_H */

WARNING: multiple messages have this Message-ID (diff)
From: Steven Rostedt <rostedt@goodmis.org>
To: Chunfeng Yun <chunfeng.yun@mediatek.com>
Cc: <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	<linux-usb@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [for-next][PATCH 13/23] USB: mtu3: tracing: Use the new __vstring() helper
Date: Fri, 15 Jul 2022 17:24:23 -0400	[thread overview]
Message-ID: <20220715172423.6b57b9eb@gandalf.local.home> (raw)
In-Reply-To: <962e59c25e981676014157cd111db9e16e237339.camel@mediatek.com>

On Fri, 15 Jul 2022 18:01:44 +0800
Chunfeng Yun <chunfeng.yun@mediatek.com> wrote:

>  irq/254-1120100-137     [000] d..1.   266.629662: mtu3_log:
> 11201000.usb: ep0_state SETUPr-speed
> 
> "r-speed" seems the remain of last log;

I found an off-by-one bug in the vstring patch. I'll rebase, test and try
again.

In the mean time, care to add this on top to make sure it's fixed?

Thanks!

-- Steve

diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
index e6f8ba52a958..b18759a673c6 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -922,16 +922,16 @@ perf_trace_buf_submit(void *raw_data, int size, int rctx, u16 type,
  * gcc warns that you can not use a va_list in an inlined
  * function. But lets me make it into a macro :-/
  */
-#define __trace_event_vstr_len(fmt, va)		\
-({						\
-	va_list __ap;				\
-	int __ret;				\
-						\
-	va_copy(__ap, *(va));			\
-	__ret = vsnprintf(NULL, 0, fmt, __ap);	\
-	va_end(__ap);				\
-						\
-	min(__ret, TRACE_EVENT_STR_MAX);	\
+#define __trace_event_vstr_len(fmt, va)			\
+({							\
+	va_list __ap;					\
+	int __ret;					\
+							\
+	va_copy(__ap, *(va));				\
+	__ret = vsnprintf(NULL, 0, fmt, __ap) + 1;	\
+	va_end(__ap);					\
+							\
+	min(__ret, TRACE_EVENT_STR_MAX);		\
 })
 
 #endif /* _LINUX_TRACE_EVENT_H */

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-07-15 21:24 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 16:42 [for-next][PATCH 00/23] tracing: Updates for 5.20 Steven Rostedt
2022-07-14 16:42 ` [for-next][PATCH 01/23] tracing/user_events: Fix syntax errors in comments Steven Rostedt
2022-07-14 16:42 ` [for-next][PATCH 02/23] tracing/histograms: Simplify create_hist_fields() Steven Rostedt
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 06/23] tracing/events: Add __vstring() and __assign_vstr() helper macros Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 07/23] tracing/IB/hfi1: Use the new __vstring() helper Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 08/23] tracing/ath: " Steven Rostedt
2022-07-14 16:43   ` Steven Rostedt
2022-07-14 16:43   ` 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 11/23] usb: chipidea: tracing: " Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 12/23] xhci: " Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 13/23] USB: mtu3: " Steven Rostedt
2022-07-14 16:43   ` Steven Rostedt
2022-07-15  6:32   ` Chunfeng Yun
2022-07-15  6:32     ` Chunfeng Yun
2022-07-15 21:39     ` Steven Rostedt
2022-07-15 21:39       ` Steven Rostedt
2022-07-19  5:23       ` Chunfeng Yun
2022-07-19  5:23         ` Chunfeng Yun
2022-07-19 15:24         ` Steven Rostedt
2022-07-19 15:24           ` Steven Rostedt
2022-07-15 10:01   ` Chunfeng Yun
2022-07-15 10:01     ` Chunfeng Yun
2022-07-15 14:36     ` Steven Rostedt
2022-07-15 14:36       ` Steven Rostedt
2022-07-15 21:24     ` Steven Rostedt [this message]
2022-07-15 21:24       ` Steven Rostedt
2022-07-19  5:18       ` Chunfeng Yun
2022-07-19  5:18         ` Chunfeng Yun
2022-07-14 16:43 ` [for-next][PATCH 14/23] usb: musb: " Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 15/23] scsi: iscsi: " Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 16/23] scsi: qla2xxx: " Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 17/23] batman-adv: " Steven Rostedt
2022-07-24 21:31   ` Sven Eckelmann
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
2022-07-14 16:43 ` [for-next][PATCH 19/23] tracing: eprobe: Add missing log index Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 20/23] tracing: eprobe: Remove duplicate is_good_name() operation Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 21/23] tracing: Auto generate event name when creating a group of events Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 22/23] selftests/ftrace: Add test case for GRP/ only input Steven Rostedt
2022-07-14 16:43 ` [for-next][PATCH 23/23] selftests/kprobe: Do not test for GRP/ without event failures 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=20220715172423.6b57b9eb@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=chunfeng.yun@mediatek.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.