lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YS+vL2SYCCVLAXVp@kernel.org>
Date:   Wed, 1 Sep 2021 13:49:51 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Leo Yan <leo.yan@...aro.org>
Cc:     James Clark <james.clark@....com>, mathieu.poirier@...aro.org,
        coresight@...ts.linaro.org, linux-perf-users@...r.kernel.org,
        mike.leach@...aro.org, suzuki.poulose@....com,
        John Garry <john.garry@...wei.com>,
        Will Deacon <will@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 9/9] perf cs-etm: Show a warning for an unknown magic
 number

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@...lbox perf]$ rpm -qa | grep opencsd
> > opencsd-1.0.0-1.fc34.x86_64
> > opencsd-devel-1.0.0-1.fc34.x86_64
> > ⬢[acme@...lbox 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@...lbox 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@...lbox 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@...lbox perf]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ;
⬢[acme@...lbox 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@...lbox perf]$ cat /tmp/build/perf/feature/test-libopencsd.make.output
⬢[acme@...lbox perf]$
⬢[acme@...lbox perf]$
⬢[acme@...lbox perf]$ ldd ~/bin/perf | grep opencsd
	libopencsd_c_api.so.1 => not found
⬢[acme@...lbox perf]$ export LD_LIBRARY_PATH=/usr/local/lib
⬢[acme@...lbox 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@...lbox perf]$
⬢[acme@...lbox perf]$
⬢[acme@...lbox perf]$
⬢[acme@...lbox 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@...lbox 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@...lbox 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ