[PATCH v2 9/9] perf cs-etm: Show a warning for an unknown magic number
Arnaldo Carvalho de Melo
acme at kernel.org
Wed Sep 1 09:49:51 PDT 2021
Em Wed, Sep 01, 2021 at 01:25:37PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Sep 01, 2021 at 01:16:56PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Wed, Sep 01, 2021 at 01:07:41PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > Em Wed, Sep 01, 2021 at 12:54:34PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > > Applies cleanly to my tree, test building it now, holler if there is
> > > > something that prevents it from being merged.
> > > I´m now trying to fix this up, I applied it using 'b4', so no patch
> > > should have gone missing...
> > So its probably related to:
> > ⬢[acme at toolbox perf]$ rpm -qa | grep opencsd
> > opencsd-1.0.0-1.fc34.x86_64
> > opencsd-devel-1.0.0-1.fc34.x86_64
> > ⬢[acme at toolbox perf]$
> > In which case the usual mechanism is to test if we have what is needed
> > via tools/build/feature/test-_____.c, lemme check...
> There is a test and it fails, of course:
> ⬢[acme at toolbox perf]$ cat /tmp/build/perf/feature/test-libopencsd.make.output
> test-libopencsd.c:9:2: error: #error "OpenCSD >= 1.1.1 is required"
> 9 | #error "OpenCSD >= 1.1.1 is required"
> | ^~~~~
> ⬢[acme at toolbox perf]$
> But the fact that I ask for CORESIGHT=1 should have the build fail then,
> i.e. if one explicitely asks for a feature and it can't be built, fail
> the whole build.
So after uninstalling the libopencsd that comes with fedora 34 and
cloning the upstream OpenCSD git repo, building it and installing in
/usr/local/ it seems to work as expected:
⬢[acme at toolbox perf]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ;
⬢[acme at toolbox perf]$ make O=/tmp/build/perf VF=1 CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin |& grep -i opencsd
... libopencsd: [ on ]
⬢[acme at toolbox perf]$ cat /tmp/build/perf/feature/test-libopencsd.make.output
⬢[acme at toolbox perf]$
⬢[acme at toolbox perf]$
⬢[acme at toolbox perf]$ ldd ~/bin/perf | grep opencsd
libopencsd_c_api.so.1 => not found
⬢[acme at toolbox perf]$ export LD_LIBRARY_PATH=/usr/local/lib
⬢[acme at toolbox perf]$ ldd ~/bin/perf | grep opencsd
libopencsd_c_api.so.1 => /usr/local/lib/libopencsd_c_api.so.1 (0x00007f839e8b2000)
libopencsd.so.1 => /usr/local/lib/libopencsd.so.1 (0x00007f839da3c000)
⬢[acme at toolbox perf]$
⬢[acme at toolbox perf]$
⬢[acme at toolbox perf]$
⬢[acme at toolbox perf]$ ldd /tmp/build/perf/feature/test-libopencsd.bin
linux-vdso.so.1 (0x00007ffd669b3000)
libopencsd_c_api.so.1 => /usr/local/lib/libopencsd_c_api.so.1 (0x00007fe608b8c000)
libopencsd.so.1 => /usr/local/lib/libopencsd.so.1 (0x00007fe608af5000)
libc.so.6 => /lib64/libc.so.6 (0x00007fe60891e000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fe6086ff000)
libm.so.6 => /lib64/libm.so.6 (0x00007fe6085bb000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fe6085a0000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe608ba2000)
⬢[acme at toolbox perf]$ ls -la /usr/local/lib/libopencsd*
-rw-r--r--. 1 root root 1641364 Sep 1 13:41 /usr/local/lib/libopencsd.a
-rw-r--r--. 1 root root 168022 Sep 1 13:41 /usr/local/lib/libopencsd_c_api.a
lrwxrwxrwx. 1 root root 21 Sep 1 13:41 /usr/local/lib/libopencsd_c_api.so -> libopencsd_c_api.so.1
lrwxrwxrwx. 1 root root 25 Sep 1 13:41 /usr/local/lib/libopencsd_c_api.so.1 -> libopencsd_c_api.so.1.1.1
-rw-r--r--. 1 root root 104968 Sep 1 13:41 /usr/local/lib/libopencsd_c_api.so.1.1.1
lrwxrwxrwx. 1 root root 15 Sep 1 13:41 /usr/local/lib/libopencsd.so -> libopencsd.so.1
lrwxrwxrwx. 1 root root 19 Sep 1 13:41 /usr/local/lib/libopencsd.so.1 -> libopencsd.so.1.1.1
-rw-r--r--. 1 root root 762432 Sep 1 13:41 /usr/local/lib/libopencsd.so.1.1.1
⬢[acme at toolbox perf]$
This doesn't explain that 'make -C tools/perf build-test' error, perhaps
it is reusing the feature dump (feature detection), done without
CORESIGHT=1, when building with CORESIGHT=1 :-\
Anyway, please consider making the build fail when CORESIGHT=1 is passed
explicitely and that tools/build/feature-libopencsd.c feature test fails
instead of silently building the tool _without_ the explicitely asked
for feature.
Thanks,
- Arnaldo
More information about the linux-arm-kernel
mailing list