linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>,
	Peter Zijlstra <peterz@infradead.org>,
	 Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	 Mark Rutland <mark.rutland@arm.com>,
	 Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	 Adrian Hunter <adrian.hunter@intel.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	 Jing Zhang <renyu.zj@linux.alibaba.com>,
	Xu Yang <xu.yang_2@nxp.com>,  Sandipan Das <sandipan.das@amd.com>,
	linux-perf-users@vger.kernel.org,  linux-kernel@vger.kernel.org,
	philip.li@intel.com, oliver.sang@intel.com,
	 Weilin Wang <weilin.wang@intel.com>
Subject: Re: [PATCH v3 2/2] perf jevents: Autogenerate empty-pmu-events.c
Date: Wed, 31 Jul 2024 08:58:43 -0700	[thread overview]
Message-ID: <CAP-5=fVm5FkLDOLk4cbD9K6VPZ088f3Yk3bG8LT79E_OLLN4Lw@mail.gmail.com> (raw)
In-Reply-To: <ZqpcRIzzBb5KC6Zb@x1>

On Wed, Jul 31, 2024 at 8:46 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> On Wed, Jul 31, 2024 at 12:33:50PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Wed, Jul 31, 2024 at 07:08:18AM -0700, Ian Rogers wrote:
> > > On Wed, Jul 31, 2024 at 6:18 AM Arnaldo Carvalho de Melo
> > > <acme@kernel.org> wrote:
> > > >
> > > > On Tue, Jul 30, 2024 at 12:17:44PM -0700, Ian Rogers wrote:
> > > > > empty-pmu-events.c exists so that builds may occur without python
> > > > > being installed on a system. Manually updating empty-pmu-events.c to
> > > > > be in sync with jevents.py is a pain, let's use jevents.py to generate
> > > > > empty-pmu-events.c.
> > > >
> > > > What am I missing here?
> > > >
> > > > If it exists so that we can build on a system without python how can we
> > > > use python to generate it?
> > > >
> > > > Now having python in the system is a requirement and thus we don't need
> > > > empty-pmu-events.c anymore?
> > > >
> > > > Can you guys please clarify that?
> > >
> > > The requirement for python hasn't changed.
> > >
> > > Case 1: no python or NO_JEVENTS=1
> > > Build happens using empty-pmu-events.c that is checked in, no python
> > > is required.
> > >
> > > Case 2: python
> > > pmu-events.c is created by jevents.py (requiring python) and then built.
> > > This change adds a step where the empty-pmu-events.c is created using
> > > jevents.py and that file is diffed against the checked in version.
> > > This stops the checked in empty-pmu-events.c diverging if changes are
> > > made to jevents.py. If the diff causes the build to fail then you just
> > > copy the diff empty-pmu-events.c over the checked in one.
> >
> > I'll try and add your explanation to the log message, thanks for
> > clarifying it!
>
> So, with it in place I'm now noticing:
>
> ⬢[acme@toolbox perf-tools-next]$ rm -rf /tmp/build/$(basename $PWD)/ ; mkdir -p /tmp/build/$(basename $PWD)/
> ⬢[acme@toolbox perf-tools-next]$ alias m='rm -rf ~/libexec/perf-core/ ; make -k CORESIGHT=1 O=/tmp/build/$(basename $PWD)/ -C tools/perf install-bin && perf test python'
> ⬢[acme@toolbox perf-tools-next]$ m
> <SNIP>
>   GEN     /tmp/build/perf-tools-next/pmu-events/test-empty-pmu-events.c
>   MKDIR   /tmp/build/perf-tools-next/arch/x86/util/
>   CC      /tmp/build/perf-tools-next/util/annotate.o
>   CC      /tmp/build/perf-tools-next/arch/x86/util/tsc.o
>   CC      /tmp/build/perf-tools-next/arch/x86/tests/hybrid.o
>   CC      /tmp/build/perf-tools-next/util/block-info.o
>   CC      /tmp/build/perf-tools-next/arch/x86/tests/intel-pt-test.o
>   CC      /tmp/build/perf-tools-next/arch/x86/util/pmu.o
>   MKDIR   /tmp/build/perf-tools-next/ui/browsers/
>   CC      /tmp/build/perf-tools-next/ui/browsers/annotate.o
>   CC      /tmp/build/perf-tools-next/builtin-kallsyms.o
>   CC      /tmp/build/perf-tools-next/util/block-range.o
>   TEST    /tmp/build/perf-tools-next/pmu-events/empty-pmu-events.log
> --- pmu-events/empty-pmu-events.c       2024-07-31 12:44:14.355042296 -0300
> +++ /tmp/build/perf-tools-next/pmu-events/test-empty-pmu-events.c       2024-07-31 12:45:35.048682785 -0300
> @@ -380,7 +380,7 @@
>                          continue;
>
>                  ret = pmu_events_table__for_each_event_pmu(table, table_pmu, fn, data);
> -                if (pmu || ret)
> +                if (ret)

Right, you need to copy:
 /tmp/build/perf-tools-next/pmu-events/test-empty-pmu-events.c
to
tools/perf/pmu-events/empty-pmu-events.c
to fix this.

This change has happened as you are testing with:
https://lore.kernel.org/lkml/20240716132951.1748662-1-kan.liang@linux.intel.com/
which isn't in the git repo yet (therefore, I can't make a patch set
on it). The change is WAI as it is telling you empty-pmu-events.c has
become stale and needs Kan's fix applying to it.

Thanks,
Ian


>                          return ret;
>          }
>          return 0;
>   CC      /tmp/build/perf-tools-next/tests/openat-syscall.o
> make[3]: *** [pmu-events/Build:42: /tmp/build/perf-tools-next/pmu-events/empty-pmu-events.log] Error 1
> make[3]: *** Deleting file '/tmp/build/perf-tools-next/pmu-events/empty-pmu-events.log'
> make[2]: *** [Makefile.perf:763: /tmp/build/perf-tools-next/pmu-events/pmu-events-in.o] Error 2
> make[2]: *** Waiting for unfinished jobs....
>   CC      /tmp/build/perf-tools-next/arch/x86/util/kvm-stat.o
> <SNIP>

  reply	other threads:[~2024-07-31 15:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 19:17 [PATCH v3 0/2] perf jevents: Autogenerate empty-pmu-events.c Ian Rogers
2024-07-30 19:17 ` [PATCH v3 1/2] perf jevents: Use name for special find value Ian Rogers
2024-07-31 13:19   ` Arnaldo Carvalho de Melo
2024-07-30 19:17 ` [PATCH v3 2/2] perf jevents: Autogenerate empty-pmu-events.c Ian Rogers
2024-07-31 13:18   ` Arnaldo Carvalho de Melo
2024-07-31 14:08     ` Ian Rogers
2024-07-31 15:33       ` Arnaldo Carvalho de Melo
2024-07-31 15:46         ` Arnaldo Carvalho de Melo
2024-07-31 15:58           ` Ian Rogers [this message]
2024-07-31 18:53             ` Arnaldo Carvalho de Melo
2024-07-31 20:20               ` Ian Rogers
2024-07-31 20:41                 ` Arnaldo Carvalho de Melo
2024-08-01  1:35                   ` Ian Rogers
2024-07-31 13:05 ` [PATCH v3 0/2] " Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP-5=fVm5FkLDOLk4cbD9K6VPZ088f3Yk3bG8LT79E_OLLN4Lw@mail.gmail.com' \
    --to=irogers@google.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=john.g.garry@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=oliver.sang@intel.com \
    --cc=peterz@infradead.org \
    --cc=philip.li@intel.com \
    --cc=renyu.zj@linux.alibaba.com \
    --cc=sandipan.das@amd.com \
    --cc=weilin.wang@intel.com \
    --cc=xu.yang_2@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).