[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200423132446.GN1136647@krava>
Date: Thu, 23 Apr 2020 15:24:46 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Andi Kleen <ak@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
lkml <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Michael Petlan <mpetlan@...hat.com>,
Joe Mario <jmario@...hat.com>,
Kajol Jain <kjain@...ux.ibm.com>,
John Garry <john.garry@...wei.com>
Subject: Re: [PATCH 3/3] perf stat: Add --metrics-file option
On Tue, Apr 21, 2020 at 01:06:30PM -0700, Andi Kleen wrote:
> > > Also there are some asserts that can be triggered by expressions. I think
> > > you should fix those too and convert them to errors.
> >
> > do you have some details on this? examples of those failures?
>
> At a minimum
>
> /* Caller must make sure id is allocated */
> void expr__add_id(struct parse_ctx *ctx, const char *name, double val)
> {
> int idx;
> assert(ctx->num_ids < MAX_PARSE_ID);
>
>
> -Andi
>
I did it and then I realized this is already caught in the parsing
code (expr.y) with this check:
if (ctx->num_ids + 1 >= EXPR_MAX_OTHER) {
pr_err("failed: way too many variables\n");
YYABORT;
}
so that assert can stay there and shouldn't be ever hit
jirka
Powered by blists - more mailing lists