[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c8250aa5-452a-9e5a-b46f-98e1c35c9e27@linux.intel.com>
Date: Tue, 26 Sep 2023 12:38:57 -0400
From: "Liang, Kan" <kan.liang@...ux.intel.com>
To: weilin.wang@...el.com, Ian Rogers <irogers@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>
Cc: linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Perry Taylor <perry.taylor@...el.com>,
Samantha Alt <samantha.alt@...el.com>,
Caleb Biggers <caleb.biggers@...el.com>,
Mark Rutland <mark.rutland@....com>
Subject: Re: [RFC PATCH 24/25] perf stat: Add check to ensure correctness in
platform that does not support hardware-grouping
On 2023-09-25 2:18 a.m., weilin.wang@...el.com wrote:
> From: Weilin Wang <weilin.wang@...el.com>
>
> Add check and return with -EINVAL when event json files do not support
> hardware aware grouping so that the program could successfully fall back to
> normal grouping without segfault.
Seems another bug fix. Please merge it with the patch which introduce
the feature/bug.
Thanks,
Kan
>
> Signed-off-by: Weilin Wang <weilin.wang@...el.com>
> ---
> tools/perf/util/metricgroup.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
> index 6a4404226..1c89c9371 100644
> --- a/tools/perf/util/metricgroup.c
> +++ b/tools/perf/util/metricgroup.c
> @@ -1684,6 +1684,8 @@ static int metricgroup__add_metric_event_callback(const struct pmu_event *pe,
> struct metricgroup__add_metric_event_data *d = data;
>
> if (!strcasecmp(pe->name, d->event_name)) {
> + if (!pe->counter)
> + return -EINVAL;
> event = event_info__new(d->event_id, pe->pmu, pe->counter,
> pe->taken_alone, /*free_counter=*/false);
> if (!event)
Powered by blists - more mailing lists