[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27fb716259fc88cba955691c246a6bdaf31b38d8.camel@mediatek.com>
Date: Tue, 19 Jul 2022 13:18:54 +0800
From: Chunfeng Yun <chunfeng.yun@...iatek.com>
To: Steven Rostedt <rostedt@...dmis.org>
CC: <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...nel.org>,
"Andrew Morton" <akpm@...ux-foundation.org>,
<linux-usb@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [for-next][PATCH 13/23] USB: mtu3: tracing: Use the new
__vstring() helper
On Fri, 2022-07-15 at 17:24 -0400, Steven Rostedt wrote:
> On Fri, 15 Jul 2022 18:01:44 +0800
> Chunfeng Yun <chunfeng.yun@...iatek.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; \
It works fine now, thanks a lot
> + va_end(__ap); \
> + \
> + min(__ret, TRACE_EVENT_STR_MAX); \
> })
>
> #endif /* _LINUX_TRACE_EVENT_H */
Powered by blists - more mailing lists