From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Andi Kleen <ak@linux.intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
Thomas Richter <tmricht@linux.ibm.com>,
James Clark <james.clark@arm.com>,
Miaoqian Lin <linmq006@gmail.com>,
John Garry <john.garry@huawei.com>,
Zhengjun Xing <zhengjun.xing@linux.intel.com>,
Florian Fischer <florian.fischer@muhq.space>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
perry.taylor@intel.com, caleb.biggers@intel.com,
kshipra.bopardikar@intel.com,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH v1 2/8] perf metric: Return early if no CPU PMU table exists
Date: Wed, 31 Aug 2022 09:21:41 -0300 [thread overview]
Message-ID: <Yw9SVbRWqA2u+fso@kernel.org> (raw)
In-Reply-To: <20220830164846.401143-3-irogers@google.com>
Em Tue, Aug 30, 2022 at 09:48:40AM -0700, Ian Rogers escreveu:
> Previous behavior is to segfault if there is no CPU PMU table and a
> metric is sought. To reproduce compile with NO_JEVENTS=1 then request
> a metric, for example, "perf stat -M IPC true".
Thanks, applied to perf/urgent.
- Arnaldo
> Fixes: 00facc760903 ("perf jevents: Switch build to use jevents.py")
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> tools/perf/util/metricgroup.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
> index ad5cacdecd81..18aae040d61d 100644
> --- a/tools/perf/util/metricgroup.c
> +++ b/tools/perf/util/metricgroup.c
> @@ -1655,6 +1655,9 @@ int metricgroup__parse_groups(const struct option *opt,
> struct evlist *perf_evlist = *(struct evlist **)opt->value;
> const struct pmu_events_table *table = pmu_events_table__find();
>
> + if (!table)
> + return -EINVAL;
> +
> return parse_groups(perf_evlist, str, metric_no_group,
> metric_no_merge, NULL, metric_events, table);
> }
> --
> 2.37.2.672.g94769d06f0-goog
--
- Arnaldo
next prev parent reply other threads:[~2022-08-31 12:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 16:48 [PATCH v1 0/8] Add core wide metric literal Ian Rogers
2022-08-30 16:48 ` [PATCH v1 1/8] perf smt: Tidy header guard add SPDX Ian Rogers
2022-08-31 14:46 ` Arnaldo Carvalho de Melo
2022-08-30 16:48 ` [PATCH v1 2/8] perf metric: Return early if no CPU PMU table exists Ian Rogers
2022-08-31 12:21 ` Arnaldo Carvalho de Melo [this message]
2022-08-31 12:30 ` Arnaldo Carvalho de Melo
2022-08-30 16:48 ` [PATCH v1 3/8] perf expr: Move the scanner_ctx into the parse_ctx Ian Rogers
2022-08-30 16:48 ` [PATCH v1 4/8] perf smt: Compute SMT from topology Ian Rogers
2022-08-30 16:48 ` [PATCH v1 5/8] perf topology: Add core_wide Ian Rogers
2022-08-31 14:40 ` Arnaldo Carvalho de Melo
2022-08-31 15:58 ` Ian Rogers
2022-08-31 16:20 ` Arnaldo Carvalho de Melo
2022-08-31 16:42 ` Ian Rogers
2022-08-30 16:48 ` [PATCH v1 6/8] perf stat: Delay metric parsing Ian Rogers
2022-08-31 14:42 ` Arnaldo Carvalho de Melo
2022-08-31 16:13 ` Ian Rogers
2022-08-30 16:48 ` [PATCH v1 7/8] perf metrics: Wire up core_wide Ian Rogers
2022-08-31 14:44 ` Arnaldo Carvalho de Melo
2022-08-31 16:38 ` Ian Rogers
2022-08-30 16:48 ` [PATCH v1 8/8] perf test: Add basic core_wide expression test Ian Rogers
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=Yw9SVbRWqA2u+fso@kernel.org \
--to=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=caleb.biggers@intel.com \
--cc=eranian@google.com \
--cc=florian.fischer@muhq.space \
--cc=irogers@google.com \
--cc=james.clark@arm.com \
--cc=john.garry@huawei.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=kshipra.bopardikar@intel.com \
--cc=linmq006@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=perry.taylor@intel.com \
--cc=peterz@infradead.org \
--cc=tmricht@linux.ibm.com \
--cc=zhengjun.xing@linux.intel.com \
/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.