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

From: Oliver Sang
Date: Mon Jul 15 2024 - 22:39:47 EST


hi, Ian,

thanks a lot for detail analysis! we will check further.

On Mon, Jul 15, 2024 at 05:23:32PM -0700, Ian Rogers wrote:
> On Wed, Jun 12, 2024 at 8:07 PM Oliver Sang <oliver.sang@xxxxxxxxx> wrote:
> > > > > 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 */
>
> Hi Oliver,
>
> I tried to reproduce the problem by installing more locales on my
> machine, setting the environment variables, checking my environment
> variables, etc. I couldn't reproduce it. Looking more closely at the
> diff above and the other diffs in your email something strange appears
> to be happening around dots.
>
> From:
> --- pmu-events/empty-pmu-events.c
> we know the minus lines are those from the files in this patch series.
> From:
> +++ pmu-events/test-empty-pmu-events.c
> we know the plus lines are those generated by jevents.py.
>
> In the diff output above the "inst_retired.any" doesn't match
> "inst_retiredany" (no dot before the word "any"). The repository file
> pmu-events/empty-pmu-events.c is missing the dot in the event name but
> jevents.py is generating it, hence the diff. But looking at
> pmu-events/empty-pmu-events.c in:
> https://lore.kernel.org/lkml/20240525013021.436430-2-irogers@xxxxxxxxxx/
> The dot is present.
>
> I think what is happening is that when you apply the patches for some
> reason the dots are being consumed in
> tools/perf/pmu-events/empty-pmu-events.c, the build then informs you
> of this by failing. The locales idea was a red herring and this has
> something to do with how you apply patches.
>
> Does this make sense? Perhaps you can try testing the patches in an
> ordinary client applying the patches using something like "b4 am
> 20240525013021.436430-1-irogers@xxxxxxxxxx". At the moment I think the
> patch series is good and I don't have a way to fix what I think the
> problem is, with how you applied the patches.
>
> Thanks,
> Ian