Re: [PATCH 1/1 next] tools build: Remove the libunwind feature tests from the ones detected when test-all.o builds

Namhyung Kim <[email protected]> Tue, 18 Mar 2025 16:51:53 -0700
Newsgroups org.kernel.vger.linux-trace-devel,org.kernel.vger.bpf,org.kernel.vger.linux-kernel,org.kernel.vger.linux-perf-users
Message-ID <[email protected]>
Hello,

On Mon, Mar 17, 2025 at 09:19:22PM +0000, Quentin Monnet wrote:
> 2025-03-17 10:16 UTC-0700 ~ Ian Rogers <[email protected]>
> > On Mon, Mar 17, 2025 at 10:06 AM Namhyung Kim <[email protected]> wrote:
> >>
> >> Hello,
> >>
> >> On Mon, Mar 17, 2025 at 09:10:29AM -0700, Ian Rogers wrote:
> >>> On Wed, Dec 11, 2024 at 7:45 AM Arnaldo Carvalho de Melo
> >>> <[email protected]> wrote:
> >>>>
> >>>> We have a tools/build/feature/test-all.c that has the most common set of
> >>>> features that perf uses and are expected to have its development files
> >>>> available when building perf.
> >>>>
> >>>> When we made libwunwind opt-in we forgot to remove them from the list of
> >>>> features that are assumed to be available when test-all.c builds, remove
> >>>> them.
> >>>>
> >>>> Before this patch:
> >>>>
> >>>>   $ rm -rf /tmp/b ; mkdir /tmp/b ; make -C tools/perf O=/tmp/b feature-dump ; grep feature-libunwind-aarch64= /tmp/b/FEATURE-DUMP
> >>>>   feature-libunwind-aarch64=1
> >>>>   $
> >>>>
> >>>> Even tho this not being test built and those header files being
> >>>> available:
> >>>>
> >>>>   $ head -5 tools/build/feature/test-libunwind-aarch64.c
> >>>>   // SPDX-License-Identifier: GPL-2.0
> >>>>   #include <libunwind-aarch64.h>
> >>>>   #include <stdlib.h>
> >>>>
> >>>>   extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as,
> >>>>   $
> >>>>
> >>>> After this patch:
> >>>>
> >>>>   $ grep feature-libunwind- /tmp/b/FEATURE-DUMP
> >>>>   $
> >>>>
> >>>> Now an audit on what is being enabled when test-all.c builds will be
> >>>> performed.
> >>>>
> >>>> Fixes: 176c9d1e6a06f2fa ("tools features: Don't check for libunwind devel files by default")
> >>>> Cc: Adrian Hunter <[email protected]>
> >>>> Cc: Ian Rogers <[email protected]>
> >>>> Cc: James Clark <[email protected]>
> >>>> Cc: Jiri Olsa <[email protected]>
> >>>> Cc: Kan Liang <[email protected]>
> >>>> Cc: Namhyung Kim <[email protected]>
> >>>> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
> >>>
> >>> Sorry for the delay on this.
> >>>
> >>> Reviewed-by: Ian Rogers <[email protected]>
> >>
> >> Thanks for the review, but I think this part is used by other tools like
> >> BPF and tracing.  It'd be nice to get reviews from them.
> > 
> > Sgtm. The patch hasn't had attention for 3 months. A quick grep for
> > "unwind" and "UNW_" shows only use in perf and the feature tests.
> > 
> > Thanks,
> > Ian
> 
> 
> Indeed, bpftool does not rely on libunwind, and I don't remember other
> BPF components doing so, either.

Right, but my concern was about the feature test itself and the related
changes in the build files.

Can I get your Acked-by then?

Thanks,
Namhyung