lkml.org 
[lkml]   [2022]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2022-10-06 07:45    [W:0.048 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site