Re: [PATCH v3 2/4] ftrace: Add support for function argument to graph tracer
From: Steven Rostedt
Date: Wed Feb 26 2025 - 11:23:30 EST
On Wed, 26 Feb 2025 23:48:52 +0900
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:
> > - event = trace_buffer_lock_reserve(buffer, TRACE_GRAPH_ENT,
> > - sizeof(*entry), trace_ctx);
> > + /* If fregs is defined, add FTRACE_REGS_MAX_ARGS long size words */
> > + size = sizeof(*entry) + (FTRACE_REGS_MAX_ARGS * !!fregs * sizeof(long));
>
> Is `!!fregs` always 1 if fregs != NULL? (seems to depend on compiler)
Yes, C guarantees that ! is either 1 or zero. If you want to convert
something from non zero to 1, the C convention is "!!".
>
> Others looks good to me.
>
> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
Thanks!
-- Steve