From: Jiri Olsa <jolsa@redhat.com>
To: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Michael Petlan <mpetlan@redhat.com>,
Joe Mario <jmario@redhat.com>, Kajol Jain <kjain@linux.ibm.com>,
John Garry <john.garry@huawei.com>
Subject: Re: [PATCH 3/3] perf stat: Add --metrics-file option
Date: Thu, 23 Apr 2020 15:24:46 +0200 [thread overview]
Message-ID: <20200423132446.GN1136647@krava> (raw)
In-Reply-To: <20200421200630.GG608746@tassilo.jf.intel.com>
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
next prev parent reply other threads:[~2020-04-23 13:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-21 18:13 [PATCHv2 0/3] perf tools: Add support for user defined metric Jiri Olsa
2020-04-21 18:13 ` [PATCH 1/3] perf expr: Add parsing support for multiple expressions Jiri Olsa
2020-04-21 18:13 ` [PATCH 2/3] perf expr: Allow comments in custom metric file Jiri Olsa
2020-04-21 18:13 ` [PATCH 3/3] perf stat: Add --metrics-file option Jiri Olsa
2020-04-21 18:36 ` Andi Kleen
2020-04-21 18:52 ` Jiri Olsa
2020-04-21 20:06 ` Andi Kleen
2020-04-23 13:24 ` Jiri Olsa [this message]
2020-04-30 11:24 ` [PATCHv2 0/3] perf tools: Add support for user defined metric kajoljain
2020-04-30 12:43 ` Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200423132446.GN1136647@krava \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jmario@redhat.com \
--cc=john.garry@huawei.com \
--cc=jolsa@kernel.org \
--cc=kjain@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mpetlan@redhat.com \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.