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

From: Ian Rogers
Date: Fri May 31 2024 - 12:38:31 EST


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.

Thanks,
Ian