Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c

From: Ian Rogers
Date: Mon Jun 03 2024 - 11:47:12 EST


On Mon, Jun 3, 2024 at 7:19 AM Oliver Sang <oliver.sang@xxxxxxxxx> wrote:
>
> hi, Ian,
>
> On Fri, May 31, 2024 at 09:38:01AM -0700, Ian Rogers wrote:
> > On Fri, May 31, 2024 at 1:16 AM kernel test robot <oliver.sang@xxxxxxxxx> wrote:
> > >
> > >
> > > hi, Ian Rogers,
> > >
> > > we actually want to seek your advice. in our env, there is no problem to build
> > > parent.
> > >
> > > * 3249f8b84526d (linux-review/Ian-Rogers/perf-jevents-Autogenerate-empty-pmu-events-c/20240525-093240) perf jevents: Autogenerate empty-pmu-events.c
> > > * 7d88bd0d22746 perf jevents: Use name for special find value <--- parent
> > >
> > > however, failed to build perf upon 3249f8b84526d. but there is not many useful
> > > information in below detail log.
> > >
> > > is there any dependency or env setting for us to build this commit? Thanks!
> >
> > Hi Oliver,
> >
> > Thanks for the report and the work testing! Seeing the output:
> >
> > [..snip..]
> > > --- pmu-events/empty-pmu-events.c 2024-05-30 08:20:10.000000000 +0000
> > > +++ pmu-events/test-empty-pmu-events.c 2024-05-30 15:55:37.332495538 +0000
> > > @@ -136,7 +136,7 @@
> > > { 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
> > > { 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
> > > { 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> > > -{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retiredany\000\000\000\000\000\000\000\00000 */
> > > +{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> > >
> > > };
> > >
> > > @@ -373,7 +373,7 @@
> > [..snip..]
> >
> > It appears the version of empty-pmu-events.c the patch adds and the
> > version generated in your test configuration are differing because of
> > whitespace. Perhaps a hex editor will show what the exact difference
> > is, it must relate to locales or something. Like you mention this
> > could be resolved by an env change.
> >
> > > The kernel config and materials to reproduce are available at:
> > > https://download.01.org/0day-ci/archive/20240531/202405311548.1e881dea-oliver.sang@xxxxxxxxx
> >
> > I didn't see the generated test-empty-pmu-events.c there and so
> > couldn't follow up on the locale/env exploration. I wonder that a
> > suitable workaround is to change from the patch:
> >
> > +$(EMPTY_PMU_EVENTS_TEST_LOG): $(EMPTY_PMU_EVENTS_C) $(TEST_EMPTY_PMU_EVENTS_C)
> > + $(call rule_mkdir)
> > + $(Q)$(call echo-cmd,test)diff -u $? 2> $@ || (cat $@ && false)
> >
> > to instead of invoking "diff -u" to invoke "diff -w -u", that is to
> > ignore whitespace. I can send a v3 with this.
>
> I tried below patch
>
> commit a79a41133a41adc2d69c8f603c7d880b3796cbf7
> Author: 0day robot <lkp@xxxxxxxxx>
> Date: Mon Jun 3 16:35:45 2024 +0800
>
> fix from Ian Rogers: invoke "diff -w -u" instead of "diff -u"
>
> diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
> index c3fa43c497069..54d19b492db5c 100644
> --- a/tools/perf/pmu-events/Build
> +++ b/tools/perf/pmu-events/Build
> @@ -39,7 +39,7 @@ $(TEST_EMPTY_PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(ME
>
> $(EMPTY_PMU_EVENTS_TEST_LOG): $(EMPTY_PMU_EVENTS_C) $(TEST_EMPTY_PMU_EVENTS_C)
> $(call rule_mkdir)
> - $(Q)$(call echo-cmd,test)diff -u $? 2> $@ || (cat $@ && false)
> + $(Q)$(call echo-cmd,test)diff -w -u $? 2> $@ || (cat $@ && false)
>
> $(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(METRIC_TEST_LOG) $(EMPTY_PMU_EVENTS_TEST_LOG)
> $(call rule_mkdir)
>
>
> but make still failed. I still saw below in our build log
>
> --- pmu-events/empty-pmu-events.c 2024-06-03 08:41:16.000000000 +0000
> +++ pmu-events/test-empty-pmu-events.c 2024-06-03 13:47:19.522463482 +0000
> @@ -136,7 +136,7 @@
> { 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
> { 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
> { 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> -{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retiredany\000\000\000\000\000\000\000\00000 */
> +{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
>
> };
>
>
> I will try to get generated test-empty-pmu-events.c tomorrow.

Thanks Oliver, if you could get the environment variables that would
probably also be useful.

Ian

> >
> > Thanks,
> > Ian