Skip to content

Commit 5519b69

Browse files
captain5050acmel
authored andcommitted
tools build: Make libperl opt-in rather than opt-out, deprecate
If libperl is installed then the perf tool build will build against it. There appears to be limited interest in the scripting support for perl so let's make it opt-in and deprecate it. With this patch applied you need to add LIBPERL=1 to get libperl support in perf - there is no warning if libperl is missing, but building will fail if libperl is missing and the build has LIBPERL=1. The perf version output is changed to: ``` $ perf version --build-options perf version 6.17.rc3.g8eca69269947 aio: [ on ] # HAVE_AIO_SUPPORT bpf: [ on ] # HAVE_LIBBPF_SUPPORT bpf_skeletons: [ on ] # HAVE_BPF_SKEL debuginfod: [ on ] # HAVE_DEBUGINFOD_SUPPORT dwarf: [ on ] # HAVE_LIBDW_SUPPORT dwarf_getlocations: [ on ] # HAVE_LIBDW_SUPPORT dwarf-unwind: [ on ] # HAVE_DWARF_UNWIND_SUPPORT auxtrace: [ on ] # HAVE_AUXTRACE_SUPPORT libbfd: [ OFF ] # HAVE_LIBBFD_SUPPORT ( tip: Deprecated, license incompatibility, use BUILD_NONDISTRO=1 and install binutils-dev[el] ) libbpf-strings: [ on ] # HAVE_LIBBPF_STRINGS_SUPPORT libcapstone: [ on ] # HAVE_LIBCAPSTONE_SUPPORT libdw-dwarf-unwind: [ on ] # HAVE_LIBDW_SUPPORT libelf: [ on ] # HAVE_LIBELF_SUPPORT libnuma: [ on ] # HAVE_LIBNUMA_SUPPORT libopencsd: [ OFF ] # HAVE_CSTRACE_SUPPORT libperl: [ OFF ] # HAVE_LIBPERL_SUPPORT ( tip: Deprecated, use LIBPERL=1 and install libperl-dev to build with it ) libpfm4: [ on ] # HAVE_LIBPFM libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT libslang: [ on ] # HAVE_SLANG_SUPPORT libtraceevent: [ on ] # HAVE_LIBTRACEEVENT libunwind: [ OFF ] # HAVE_LIBUNWIND_SUPPORT ( tip: Deprecated, use LIBUNWIND=1 and install libunwind-dev[el] to build with it ) lzma: [ on ] # HAVE_LZMA_SUPPORT numa_num_possible_cpus: [ on ] # HAVE_LIBNUMA_SUPPORT zlib: [ on ] # HAVE_ZLIB_SUPPORT zstd: [ on ] # HAVE_ZSTD_SUPPORT ``` i.e. there is a tip saying about deprecation and how to get support back. Signed-off-by: Ian Rogers <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Charlie Jenkins <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: James Clark <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Michael Petlan <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Quentin Monnet <[email protected]> Cc: Steven Rostedt (VMware) <[email protected]> Cc: Tomas Glozar <[email protected]> Cc: Yuzhuo Jing <[email protected]> Link: https://lore.kernel.org/lkml/aMrk03gigBlGcYLK@x1/ Link: https://lore.kernel.org/lkml/CAP-5=fVX+bLBRJCiziDi_hBySgv2NFtDoghtpheSSxVAvvETGw@mail.gmail.com [ Keep the pre-existing perl-ExtUtils-Embed hint for Fedora/RHEL systems ] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent c17dda8 commit 5519b69

File tree

6 files changed

+13
-25
lines changed

6 files changed

+13
-25
lines changed

tools/build/Makefile.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ FEATURE_TESTS_BASIC := \
8080
libelf-zstd \
8181
libnuma \
8282
numa_num_possible_cpus \
83-
libperl \
8483
libpython \
8584
libslang \
8685
libtraceevent \
@@ -121,6 +120,7 @@ FEATURE_TESTS_EXTRA := \
121120
libbfd-liberty \
122121
libbfd-liberty-z \
123122
libopencsd \
123+
libperl \
124124
cxx \
125125
llvm \
126126
clang \
@@ -144,7 +144,6 @@ FEATURE_DISPLAY ?= \
144144
libelf \
145145
libnuma \
146146
numa_num_possible_cpus \
147-
libperl \
148147
libpython \
149148
libcapstone \
150149
llvm-perf \

tools/build/feature/test-all.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,13 @@
77
*/
88

99
/*
10-
* Quirk: Python and Perl headers cannot be in arbitrary places, so keep
11-
* these 3 testcases at the top:
10+
* Quirk: Python headers cannot be in arbitrary places, so keep this testcase at
11+
* the top:
1212
*/
1313
#define main main_test_libpython
1414
# include "test-libpython.c"
1515
#undef main
1616

17-
#define main main_test_libperl
18-
# include "test-libperl.c"
19-
#undef main
20-
2117
#define main main_test_hello
2218
# include "test-hello.c"
2319
#undef main
@@ -161,7 +157,6 @@
161157
int main(int argc, char *argv[])
162158
{
163159
main_test_libpython();
164-
main_test_libperl();
165160
main_test_hello();
166161
main_test_libelf();
167162
main_test_get_current_dir_name();

tools/perf/Makefile.config

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -817,9 +817,7 @@ ifdef GTK2
817817
endif
818818
endif
819819

820-
ifdef NO_LIBPERL
821-
CFLAGS += -DNO_LIBPERL
822-
else
820+
ifdef LIBPERL
823821
PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
824822
PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
825823
PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
@@ -829,17 +827,13 @@ else
829827
PERL_EMBED_LDOPTS := $(filter-out -specs=%,$(PERL_EMBED_LDOPTS))
830828
FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
831829

830+
$(call feature_check,libperl)
832831
ifneq ($(feature-libperl), 1)
833-
CFLAGS += -DNO_LIBPERL
834-
NO_LIBPERL := 1
835-
$(warning Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev)
832+
$(error Missing perl devel files. Please install perl-ExtUtils-Embed/libperl-dev)
836833
else
837834
LDFLAGS += $(PERL_EMBED_LDFLAGS)
838835
EXTLIBS += $(PERL_EMBED_LIBADD)
839836
CFLAGS += -DHAVE_LIBPERL_SUPPORT
840-
ifeq ($(CC_NO_CLANG), 0)
841-
CFLAGS += -Wno-compound-token-split-by-macro
842-
endif
843837
$(call detected,CONFIG_LIBPERL)
844838
endif
845839
endif

tools/perf/Makefile.perf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ include ../scripts/utilities.mak
1717
#
1818
# Define CROSS_COMPILE as prefix name of compiler if you want cross-builds.
1919
#
20-
# Define NO_LIBPERL to disable perl script extension.
20+
# Define LIBPERL to enable perl script extension.
2121
#
2222
# Define NO_LIBPYTHON to disable python script extension.
2323
#
@@ -1103,7 +1103,7 @@ endif
11031103
$(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
11041104
$(call QUIET_INSTALL, perf-iostat) \
11051105
$(INSTALL) $(OUTPUT)perf-iostat -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
1106-
ifndef NO_LIBPERL
1106+
ifdef LIBPERL
11071107
$(call QUIET_INSTALL, perl-scripts) \
11081108
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
11091109
$(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -m 644 -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \

tools/perf/builtin-check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct feature_status supported_features[] = {
4949
FEATURE_STATUS("libelf", HAVE_LIBELF_SUPPORT),
5050
FEATURE_STATUS("libnuma", HAVE_LIBNUMA_SUPPORT),
5151
FEATURE_STATUS("libopencsd", HAVE_CSTRACE_SUPPORT),
52-
FEATURE_STATUS("libperl", HAVE_LIBPERL_SUPPORT),
52+
FEATURE_STATUS_TIP("libperl", HAVE_LIBPERL_SUPPORT, "Deprecated, use LIBPERL=1 and install perl-ExtUtils-Embed/libperl-dev to build with it"),
5353
FEATURE_STATUS("libpfm4", HAVE_LIBPFM),
5454
FEATURE_STATUS("libpython", HAVE_LIBPYTHON_SUPPORT),
5555
FEATURE_STATUS("libslang", HAVE_SLANG_SUPPORT),

tools/perf/tests/make

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ make_extra_tests := EXTRA_TESTS=1
7373
make_jevents_all := JEVENTS_ARCH=all
7474
make_no_bpf_skel := BUILD_BPF_SKEL=0
7575
make_gen_vmlinux_h := GEN_VMLINUX_H=1
76-
make_no_libperl := NO_LIBPERL=1
76+
make_libperl := LIBPERL=1
7777
make_no_libpython := NO_LIBPYTHON=1
78-
make_no_scripts := NO_LIBPYTHON=1 NO_LIBPERL=1
78+
make_no_scripts := NO_LIBPYTHON=1
7979
make_no_slang := NO_SLANG=1
8080
make_no_gtk2 := NO_GTK2=1
8181
make_no_ui := NO_SLANG=1 NO_GTK2=1
@@ -118,7 +118,7 @@ make_install_prefix_slash := install prefix=/tmp/krava/
118118
make_static := LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 NO_LIBTRACEEVENT=1 NO_LIBELF=1
119119

120120
# all the NO_* variable combined
121-
make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_GTK2=1
121+
make_minimal := NO_LIBPYTHON=1 NO_GTK2=1
122122
make_minimal += NO_DEMANGLE=1 NO_LIBELF=1 NO_BACKTRACE=1
123123
make_minimal += NO_LIBNUMA=1 NO_LIBBIONIC=1 NO_LIBDW=1
124124
make_minimal += NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
@@ -143,7 +143,7 @@ run += make_extra_tests
143143
run += make_jevents_all
144144
run += make_no_bpf_skel
145145
run += make_gen_vmlinux_h
146-
run += make_no_libperl
146+
run += make_libperl
147147
run += make_no_libpython
148148
run += make_no_scripts
149149
run += make_no_slang

0 commit comments

Comments
 (0)