Re: [PATCH 2/4] tracing/hist: Call hist functions directly via a switch statement

From: Steven Rostedt
Date: Tue Sep 06 2022 - 17:37:59 EST


On Mon, 5 Sep 2022 22:48:49 +0900
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:

> > @@ -2725,7 +2748,8 @@ static struct hist_field *parse_expr(struct hist_trigger_data *hist_data,
> > if (var2)
> > expr->operands[1] = var2;
> >
> > - expr->constant = op_fn(expr, NULL, NULL, NULL, NULL);
> > + expr->fn_num = op_fn;
> > + expr->constant = hist_fn_call(expr, NULL, NULL, NULL, NULL);
> >
> > expr->operands[0] = NULL;
> > expr->operands[1] = NULL;
>
> Here, we need this;
>
> expr->fn_num = HIST_FIELD_FN_CONST;
>
> Without this fix, the binary op_fn is kept on this const field and it
> causes the problem because the const field doesn't have operands.


Yep, I added it just below the function.

Thanks, I'll send a v2 (after testing the rest of the patches).

-- Steve