[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yz5rYU/sWtJcRZ7B@leoy-yangtze.lan>
Date: Thu, 6 Oct 2022 13:45:05 +0800
From: Leo Yan <leo.yan@...aro.org>
To: Rob Herring <robh@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
linux-perf-users@...r.kernel.org,
James Clark <james.clark@....com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/3] perf: Skip and warn on unknown format 'configN'
attrs
On Tue, Oct 04, 2022 at 12:07:30PM -0500, Rob Herring wrote:
[...]
> > INIT_LIST_HEAD(&perf_pmu__fake.format);
>
> I ended up fixing this in perf_pmu__warn_invalid_formats() instead as
> the test dealing with internal stuct pmu details didn't seem right:
>
> + /* fake pmu doesn't have format list */
> + if (pmu == &perf_pmu__fake)
> + return;
> +
Good point. It would be even better to fix it in the first place
rather than checking fake PMU in perf_pmu__warn_invalid_formats(),
how about below fixing in util/pmu.c?
-struct perf_pmu perf_pmu__fake;
+struct perf_pmu perf_pmu__fake = {
+ .format = LIST_HEAD_INIT(perf_pmu__fake.format),
+};
Thanks,
Leo
Powered by blists - more mailing lists