Re: [PATCH v1 1/2] perf test: Add an 'import perf' test shell script

From: Arnaldo Carvalho de Melo
Date: Wed Oct 01 2025 - 14:23:18 EST


On Wed, Oct 01, 2025 at 07:55:12AM -0700, Ian Rogers wrote:
> On Wed, Oct 1, 2025 at 6:42 AM Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
> >
> > On Tue, Sep 30, 2025 at 01:02:55PM -0700, Ian Rogers wrote:
> > > On Wed, Sep 3, 2025 at 11:42 AM Ian Rogers <irogers@xxxxxxxxxx> wrote:
> > > >
> > > > The 'import perf' test needs to set up a path to the python module as
> > > > well as to know the python command to invoke. These are hard coded at
> > > > build time to be build a directory and the python used in the build,
> > > > which is less than desirable. Avoid the hard coded values by reusing
> > > > the existing shell script python setup and determine a potential built
> > > > python module via the path of the perf executable.
> > > >
> > > > Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> > >
> > > Ping.
> >
> > There is another patch in this area to make it work, right?
> >
> > After applying this one I get a failure, only when I set PYTHONPATH it
> > works:
> >
> > ⬢ [acme@toolbx perf-tools-next]$ export PYTHONPATH=/tmp/build/perf-tools-next/python_ext_build/lib/
> > ⬢ [acme@toolbx perf-tools-next]$ perf test -v pytho
> > Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc
> > 88: 'import perf' in python : Ok
> > ⬢ [acme@toolbx perf-tools-next]$
>
> Hmm.. if you are running from the install directory then I guess the
> assumption should be that the install bin directory is in the PATH,
> lib in LD_LIBRARY_PATH and PYTHONPATH set up for the directory too? We
> could have the script look for a python module going from ..../bin to
> ..../lib and fix the PYTHONPATH for you. Wdyyt?

I reported it more in the sense that something that was working before
stopped working but having not yet tried to see why it stopped working.

Another thing that I just noticed that may be related:

35 97.47 fedora:rawhide : Ok gcc (GCC) 15.2.1 20250924 (Red Hat 15.2.1-2) , clang version 21.1.2 (Fedora 21.1.2-1.fc44) flex 2.6.4
36 36.81 gentoo:stage3 : Ok gcc (Gentoo 13.3.1_p20240614 p17) 13.3.1 20240614 flex 2.6.4
37 77.37 manjaro:base : FAIL clang version 16.0.6
AR /tmp/build/perf/libpmu-events.a
LINK /tmp/build/perf/perf
GEN /tmp/build/perf/python/perf.cpython-311-x86_64-linux-gnu.so
/tmp/build/perf/python_ext_build/tmp/git/perf-6.17.0-rc6/tools/perf/util/python.o: file not recognized: file format not recognized
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/sbin/clang' failed with exit code 1
cp: cannot stat '/tmp/build/perf/python_ext_build/lib/perf*.so': No such file or directory
make[2]: *** [Makefile.perf:747: /tmp/build/perf/python/perf.cpython-311-x86_64-linux-gnu.so] Error 1
make[1]: *** [Makefile.perf:289: sub-make] Error 2
make: *** [Makefile:76: all] Error 2
make: Leaving directory '/git/perf-6.17.0-rc6/tools/perf'
+ exit 1
38 130.27 opensuse:15.4 : Ok gcc (SUSE Linux) 7.5.0 , clang version 15.0.7 flex 2.6.4
39 119.76 opensuse:15.5 : Ok gcc (SUSE Linux) 7.5.0 , clang version 15.0.7 flex 2.6.4
40 120.03 opensuse:15.6 : Ok gcc (SUSE Linux) 7.5.0 , clang version 17.0.6 flex 2.6.4o

- Arnaldo