[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220715174422.6bf21fc2@gandalf.local.home>
Date: Fri, 15 Jul 2022 17:44:22 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: linux-kernel@...r.kernel.org
Cc: Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Dennis Dalessandro <dennis.dalessandro@...nelisnetworks.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>,
Kalle Valo <kvalo@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Arend van Spriel <aspriel@...il.com>,
Franky Lin <franky.lin@...adcom.com>,
Hante Meuleman <hante.meuleman@...adcom.com>,
Gregory Greenman <gregory.greenman@...el.com>,
Peter Chen <peter.chen@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Mathias Nyman <mathias.nyman@...el.com>,
Chunfeng Yun <chunfeng.yun@...iatek.com>,
Bin Liu <b-liu@...com>,
Marek Lindner <mareklindner@...mailbox.ch>,
Simon Wunderlich <sw@...onwunderlich.de>,
Antonio Quartulli <a@...table.cc>,
Sven Eckelmann <sven@...fation.org>,
Johannes Berg <johannes@...solutions.net>,
Jim Cromie <jim.cromie@...il.com>
Subject: Re: [PATCH 01/13 v2] tracing/events: Add __vstring() and
__assign_vstr() helper macros
On Fri, 15 Jul 2022 17:42:14 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
> It uses the helper:
>
> #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); \
> })
I forgot to mention what is different in v2. I fixed what happened to be in
the change log, as there was an off by one error. I just updated the change
log in my git repo to have the above be:
It uses the helper:
#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); \
})
-- Steve
Powered by blists - more mailing lists