hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/tools/perf/Makefile.config
....@@ -1,3 +1,4 @@
1
+# SPDX-License-Identifier: GPL-2.0-only
12
23 ifeq ($(src-perf),)
34 src-perf := $(srctree)/tools/perf
....@@ -15,19 +16,35 @@
1516 detected = $(shell echo "$(1)=y" >> $(OUTPUT).config-detected)
1617 detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
1718
18
-CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
19
+CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
1920
2021 include $(srctree)/tools/scripts/Makefile.arch
2122
2223 $(call detected_var,SRCARCH)
2324
2425 NO_PERF_REGS := 1
25
-NO_SYSCALL_TABLE := 1
26
+
27
+ifneq ($(NO_SYSCALL_TABLE),1)
28
+ NO_SYSCALL_TABLE := 1
29
+
30
+ ifeq ($(SRCARCH),x86)
31
+ ifeq (${IS_64_BIT}, 1)
32
+ NO_SYSCALL_TABLE := 0
33
+ endif
34
+ else
35
+ ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc arm64 s390))
36
+ NO_SYSCALL_TABLE := 0
37
+ endif
38
+ endif
39
+
40
+ ifneq ($(NO_SYSCALL_TABLE),1)
41
+ CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT
42
+ endif
43
+endif
2644
2745 # Additional ARCH settings for ppc
2846 ifeq ($(SRCARCH),powerpc)
2947 NO_PERF_REGS := 0
30
- NO_SYSCALL_TABLE := 0
3148 CFLAGS += -I$(OUTPUT)arch/powerpc/include/generated
3249 LIBUNWIND_LIBS := -lunwind -lunwind-ppc64
3350 endif
....@@ -36,7 +53,6 @@
3653 ifeq ($(SRCARCH),x86)
3754 $(call detected,CONFIG_X86)
3855 ifeq (${IS_64_BIT}, 1)
39
- NO_SYSCALL_TABLE := 0
4056 CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -I$(OUTPUT)arch/x86/include/generated
4157 ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
4258 LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma
....@@ -54,14 +70,20 @@
5470
5571 ifeq ($(SRCARCH),arm64)
5672 NO_PERF_REGS := 0
57
- NO_SYSCALL_TABLE := 0
5873 CFLAGS += -I$(OUTPUT)arch/arm64/include/generated
5974 LIBUNWIND_LIBS = -lunwind -lunwind-aarch64
6075 endif
6176
77
+ifeq ($(SRCARCH),riscv)
78
+ NO_PERF_REGS := 0
79
+endif
80
+
81
+ifeq ($(SRCARCH),csky)
82
+ NO_PERF_REGS := 0
83
+endif
84
+
6285 ifeq ($(ARCH),s390)
6386 NO_PERF_REGS := 0
64
- NO_SYSCALL_TABLE := 0
6587 CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated
6688 endif
6789
....@@ -69,15 +91,11 @@
6991 $(call detected,CONFIG_PERF_REGS)
7092 endif
7193
72
-ifneq ($(NO_SYSCALL_TABLE),1)
73
- CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT
74
-endif
75
-
7694 # So far there's only x86 and arm libdw unwind support merged in perf.
7795 # Disable it on all other architectures in case libdw unwind
7896 # support is detected in system. Add supported architectures
7997 # to the check.
80
-ifneq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc s390))
98
+ifneq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc s390 csky riscv))
8199 NO_LIBDW_DWARF_UNWIND := 1
82100 endif
83101
....@@ -108,6 +126,13 @@
108126 FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
109127 FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS)
110128 FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
129
+
130
+FEATURE_CHECK_LDFLAGS-libunwind-arm += -lunwind -lunwind-arm
131
+FEATURE_CHECK_LDFLAGS-libunwind-aarch64 += -lunwind -lunwind-aarch64
132
+FEATURE_CHECK_LDFLAGS-libunwind-x86 += -lunwind -llzma -lunwind-x86
133
+FEATURE_CHECK_LDFLAGS-libunwind-x86_64 += -lunwind -llzma -lunwind-x86_64
134
+
135
+FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto
111136
112137 ifdef CSINCLUDES
113138 LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
....@@ -145,6 +170,13 @@
145170 FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS)
146171 FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf
147172
173
+ifdef LIBZSTD_DIR
174
+ LIBZSTD_CFLAGS := -I$(LIBZSTD_DIR)/lib
175
+ LIBZSTD_LDFLAGS := -L$(LIBZSTD_DIR)/lib
176
+endif
177
+FEATURE_CHECK_CFLAGS-libzstd := $(LIBZSTD_CFLAGS)
178
+FEATURE_CHECK_LDFLAGS-libzstd := $(LIBZSTD_LDFLAGS)
179
+
148180 FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
149181 # include ARCH specific config
150182 -include $(src-perf)/arch/$(SRCARCH)/Makefile
....@@ -165,7 +197,7 @@
165197
166198 # Treat warnings as errors unless directed not to
167199 ifneq ($(WERROR),0)
168
- CFLAGS += -Werror
200
+ CORE_CFLAGS += -Werror
169201 CXXFLAGS += -Werror
170202 endif
171203
....@@ -175,9 +207,9 @@
175207
176208 ifeq ($(DEBUG),0)
177209 ifeq ($(CC_NO_CLANG), 0)
178
- CFLAGS += -O3
210
+ CORE_CFLAGS += -O3
179211 else
180
- CFLAGS += -O6
212
+ CORE_CFLAGS += -O6
181213 endif
182214 endif
183215
....@@ -190,15 +222,33 @@
190222 endif
191223
192224 # Try different combinations to accommodate systems that only have
193
-# python[2][-config] in weird combinations but always preferring
194
-# python2 and python2-config as per pep-0394. If we catch a
195
-# python[-config] in version 3, the version check will kill it.
196
-PYTHON2 := $(if $(call get-executable,python2),python2,python)
197
-override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON2))
198
-PYTHON2_CONFIG := \
199
- $(if $(call get-executable,$(PYTHON)-config),$(PYTHON)-config,python-config)
200
-override PYTHON_CONFIG := \
201
- $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON2_CONFIG))
225
+# python[2][3]-config in weird combinations in the following order of
226
+# priority from lowest to highest:
227
+# * python3-config
228
+# * python-config
229
+# * python2-config as per pep-0394.
230
+# * $(PYTHON)-config (If PYTHON is user supplied but PYTHON_CONFIG isn't)
231
+#
232
+PYTHON_AUTO := python-config
233
+PYTHON_AUTO := $(if $(call get-executable,python3-config),python3-config,$(PYTHON_AUTO))
234
+PYTHON_AUTO := $(if $(call get-executable,python-config),python-config,$(PYTHON_AUTO))
235
+PYTHON_AUTO := $(if $(call get-executable,python2-config),python2-config,$(PYTHON_AUTO))
236
+
237
+# If PYTHON is defined but PYTHON_CONFIG isn't, then take $(PYTHON)-config as if it was the user
238
+# supplied value for PYTHON_CONFIG. Because it's "user supplied", error out if it doesn't exist.
239
+ifdef PYTHON
240
+ ifndef PYTHON_CONFIG
241
+ PYTHON_CONFIG_AUTO := $(call get-executable,$(PYTHON)-config)
242
+ PYTHON_CONFIG := $(if $(PYTHON_CONFIG_AUTO),$(PYTHON_CONFIG_AUTO),\
243
+ $(call $(error $(PYTHON)-config not found)))
244
+ endif
245
+endif
246
+
247
+# Select either auto detected python and python-config or use user supplied values if they are
248
+# defined. get-executable-or-default fails with an error if the first argument is supplied but
249
+# doesn't exist.
250
+override PYTHON_CONFIG := $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON_AUTO))
251
+override PYTHON := $(call get-executable-or-default,PYTHON,$(subst -config,,$(PYTHON_CONFIG)))
202252
203253 grep-libs = $(filter -l%,$(1))
204254 strip-libs = $(filter-out -l%,$(1))
....@@ -220,17 +270,24 @@
220270 PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil
221271 PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --includes 2>/dev/null)
222272 FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
273
+ ifeq ($(CC_NO_CLANG), 0)
274
+ PYTHON_EMBED_CCOPTS := $(filter-out -ffat-lto-objects, $(PYTHON_EMBED_CCOPTS))
275
+ endif
223276 endif
224277
225278 FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
226279 FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
227280
228
-CFLAGS += -fno-omit-frame-pointer
229
-CFLAGS += -ggdb3
230
-CFLAGS += -funwind-tables
231
-CFLAGS += -Wall
232
-CFLAGS += -Wextra
233
-CFLAGS += -std=gnu99
281
+FEATURE_CHECK_LDFLAGS-libaio = -lrt
282
+
283
+FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
284
+
285
+CORE_CFLAGS += -fno-omit-frame-pointer
286
+CORE_CFLAGS += -ggdb3
287
+CORE_CFLAGS += -funwind-tables
288
+CORE_CFLAGS += -Wall
289
+CORE_CFLAGS += -Wextra
290
+CORE_CFLAGS += -std=gnu99
234291
235292 CXXFLAGS += -std=gnu++11 -fno-exceptions -fno-rtti
236293 CXXFLAGS += -Wall
....@@ -245,6 +302,11 @@
245302
246303 EXTLIBS = -lpthread -lrt -lm -ldl
247304
305
+ifneq ($(TCMALLOC),)
306
+ CFLAGS += -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free
307
+ EXTLIBS += -ltcmalloc
308
+endif
309
+
248310 ifeq ($(FEATURES_DUMP),)
249311 include $(srctree)/tools/build/Makefile.feature
250312 else
....@@ -252,20 +314,21 @@
252314 endif
253315
254316 ifeq ($(feature-stackprotector-all), 1)
255
- CFLAGS += -fstack-protector-all
317
+ CORE_CFLAGS += -fstack-protector-all
256318 endif
257319
258320 ifeq ($(DEBUG),0)
259321 ifeq ($(feature-fortify-source), 1)
260
- CFLAGS += -D_FORTIFY_SOURCE=2
322
+ CORE_CFLAGS += -D_FORTIFY_SOURCE=2
261323 endif
262324 endif
263325
326
+INC_FLAGS += -I$(srctree)/tools/lib/perf/include
264327 INC_FLAGS += -I$(src-perf)/util/include
265328 INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
266
-INC_FLAGS += -I$(srctree)/tools/include/uapi
267329 INC_FLAGS += -I$(srctree)/tools/include/
268330 INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi
331
+INC_FLAGS += -I$(srctree)/tools/include/uapi
269332 INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/
270333 INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/
271334
....@@ -280,10 +343,12 @@
280343 INC_FLAGS += -I$(src-perf)
281344 INC_FLAGS += -I$(srctree)/tools/lib/
282345
283
-CFLAGS += $(INC_FLAGS)
346
+CORE_CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
347
+
348
+CFLAGS += $(CORE_CFLAGS) $(INC_FLAGS)
284349 CXXFLAGS += $(INC_FLAGS)
285350
286
-CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
351
+LIBPERF_CFLAGS := $(CORE_CFLAGS) $(EXTRA_CFLAGS)
287352
288353 ifeq ($(feature-sync-compare-and-swap), 1)
289354 CFLAGS += -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT
....@@ -309,7 +374,7 @@
309374 endif
310375
311376 ifeq ($(feature-eventfd), 1)
312
- CFLAGS += -DHAVE_EVENTFD
377
+ CFLAGS += -DHAVE_EVENTFD_SUPPORT
313378 endif
314379
315380 ifeq ($(feature-get_current_dir_name), 1)
....@@ -318,6 +383,10 @@
318383
319384 ifeq ($(feature-gettid), 1)
320385 CFLAGS += -DHAVE_GETTID
386
+endif
387
+
388
+ifeq ($(feature-file-handle), 1)
389
+ CFLAGS += -DHAVE_FILE_HANDLE
321390 endif
322391
323392 ifdef NO_LIBELF
....@@ -346,6 +415,18 @@
346415 NO_LIBBPF := 1
347416 NO_JVMTI := 1
348417 else
418
+ ifneq ($(filter s% -fsanitize=address%,$(EXTRA_CFLAGS),),)
419
+ ifneq ($(shell ldconfig -p | grep libasan >/dev/null 2>&1; echo $$?), 0)
420
+ msg := $(error No libasan found, please install libasan);
421
+ endif
422
+ endif
423
+
424
+ ifneq ($(filter s% -fsanitize=undefined%,$(EXTRA_CFLAGS),),)
425
+ ifneq ($(shell ldconfig -p | grep libubsan >/dev/null 2>&1; echo $$?), 0)
426
+ msg := $(error No libubsan found, please install libubsan);
427
+ endif
428
+ endif
429
+
349430 ifneq ($(filter s% -static%,$(LDFLAGS),),)
350431 msg := $(error No static glibc found, please install glibc-static);
351432 else
....@@ -378,6 +459,12 @@
378459 CFLAGS += -DHAVE_GLIBC_SUPPORT
379460 endif
380461
462
+ifeq ($(feature-libaio), 1)
463
+ ifndef NO_AIO
464
+ CFLAGS += -DHAVE_AIO_SUPPORT
465
+ endif
466
+endif
467
+
381468 ifdef NO_DWARF
382469 NO_LIBDW_DWARF_UNWIND := 1
383470 endif
....@@ -391,9 +478,13 @@
391478 $(call detected,CONFIG_SETNS)
392479 endif
393480
394
-ifndef NO_CORESIGHT
481
+ifdef CORESIGHT
482
+ $(call feature_check,libopencsd)
395483 ifeq ($(feature-libopencsd), 1)
396484 CFLAGS += -DHAVE_CSTRACE_SUPPORT $(LIBOPENCSD_CFLAGS)
485
+ ifeq ($(feature-reallocarray), 0)
486
+ CFLAGS += -DCOMPAT_NEED_REALLOCARRAY
487
+ endif
397488 LDFLAGS += $(LIBOPENCSD_LDFLAGS)
398489 EXTLIBS += $(OPENCSDLIBS)
399490 $(call detected,CONFIG_LIBOPENCSD)
....@@ -411,10 +502,6 @@
411502 EXTLIBS += -lelf
412503 $(call detected,CONFIG_LIBELF)
413504
414
- ifeq ($(feature-libelf-mmap), 1)
415
- CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT
416
- endif
417
-
418505 ifeq ($(feature-libelf-getphdrnum), 1)
419506 CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
420507 endif
....@@ -427,6 +514,14 @@
427514
428515 ifeq ($(feature-libelf-getshdrstrndx), 1)
429516 CFLAGS += -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT
517
+ endif
518
+
519
+ ifndef NO_LIBDEBUGINFOD
520
+ $(call feature_check,libdebuginfod)
521
+ ifeq ($(feature-libdebuginfod), 1)
522
+ CFLAGS += -DHAVE_DEBUGINFOD_SUPPORT
523
+ EXTLIBS += -ldebuginfod
524
+ endif
430525 endif
431526
432527 ifndef NO_DWARF
....@@ -445,6 +540,17 @@
445540 ifeq ($(feature-bpf), 1)
446541 CFLAGS += -DHAVE_LIBBPF_SUPPORT
447542 $(call detected,CONFIG_LIBBPF)
543
+
544
+ # detecting libbpf without LIBBPF_DYNAMIC, so make VF=1 shows libbpf detection status
545
+ $(call feature_check,libbpf)
546
+ ifdef LIBBPF_DYNAMIC
547
+ ifeq ($(feature-libbpf), 1)
548
+ EXTLIBS += -lbpf
549
+ $(call detected,CONFIG_LIBBPF_DYNAMIC)
550
+ else
551
+ dummy := $(error Error: No libbpf devel library found, please install libbpf-devel);
552
+ endif
553
+ endif
448554 endif
449555
450556 ifndef NO_DWARF
....@@ -487,6 +593,7 @@
487593 ifndef NO_LIBUNWIND
488594 have_libunwind :=
489595
596
+ $(call feature_check,libunwind-x86)
490597 ifeq ($(feature-libunwind-x86), 1)
491598 $(call detected,CONFIG_LIBUNWIND_X86)
492599 CFLAGS += -DHAVE_LIBUNWIND_X86_SUPPORT
....@@ -495,6 +602,7 @@
495602 have_libunwind = 1
496603 endif
497604
605
+ $(call feature_check,libunwind-aarch64)
498606 ifeq ($(feature-libunwind-aarch64), 1)
499607 $(call detected,CONFIG_LIBUNWIND_AARCH64)
500608 CFLAGS += -DHAVE_LIBUNWIND_AARCH64_SUPPORT
....@@ -588,6 +696,7 @@
588696 $(call detected,CONFIG_TRACE)
589697 else
590698 ifndef NO_LIBAUDIT
699
+ $(call feature_check,libaudit)
591700 ifneq ($(feature-libaudit), 1)
592701 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
593702 NO_LIBAUDIT := 1
....@@ -601,7 +710,7 @@
601710
602711 ifndef NO_LIBCRYPTO
603712 ifneq ($(feature-libcrypto), 1)
604
- msg := $(warning No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev);
713
+ msg := $(warning No libcrypto.h found, disables jitted code injection, please install openssl-devel or libssl-dev);
605714 NO_LIBCRYPTO := 1
606715 else
607716 CFLAGS += -DHAVE_LIBCRYPTO_SUPPORT
....@@ -616,23 +725,29 @@
616725
617726 ifndef NO_SLANG
618727 ifneq ($(feature-libslang), 1)
619
- msg := $(warning slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev);
620
- NO_SLANG := 1
621
- else
728
+ ifneq ($(feature-libslang-include-subdir), 1)
729
+ msg := $(warning slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev);
730
+ NO_SLANG := 1
731
+ else
732
+ CFLAGS += -DHAVE_SLANG_INCLUDE_SUBDIR
733
+ endif
734
+ endif
735
+ ifndef NO_SLANG
622736 # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
623
- CFLAGS += -I/usr/include/slang
624737 CFLAGS += -DHAVE_SLANG_SUPPORT
625738 EXTLIBS += -lslang
626739 $(call detected,CONFIG_SLANG)
627740 endif
628741 endif
629742
630
-ifndef NO_GTK2
743
+ifdef GTK2
631744 FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
745
+ $(call feature_check,gtk2)
632746 ifneq ($(feature-gtk2), 1)
633747 msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
634748 NO_GTK2 := 1
635749 else
750
+ $(call feature_check,gtk2-infobar)
636751 ifeq ($(feature-gtk2-infobar), 1)
637752 GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT
638753 endif
....@@ -651,6 +766,7 @@
651766 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
652767 PERL_EMBED_CCOPTS = $(shell perl -MExtUtils::Embed -e ccopts 2>/dev/null)
653768 PERL_EMBED_CCOPTS := $(filter-out -specs=%,$(PERL_EMBED_CCOPTS))
769
+ PERL_EMBED_CCOPTS := $(filter-out -flto=auto -ffat-lto-objects, $(PERL_EMBED_CCOPTS))
654770 PERL_EMBED_LDOPTS := $(filter-out -specs=%,$(PERL_EMBED_LDOPTS))
655771 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
656772
....@@ -662,6 +778,9 @@
662778 LDFLAGS += $(PERL_EMBED_LDFLAGS)
663779 EXTLIBS += $(PERL_EMBED_LIBADD)
664780 CFLAGS += -DHAVE_LIBPERL_SUPPORT
781
+ ifeq ($(CC_NO_CLANG), 0)
782
+ CFLAGS += -Wno-compound-token-split-by-macro
783
+ endif
665784 $(call detected,CONFIG_LIBPERL)
666785 endif
667786 endif
....@@ -706,7 +825,7 @@
706825 endif
707826
708827 ifeq ($(feature-libbfd), 1)
709
- EXTLIBS += -lbfd
828
+ EXTLIBS += -lbfd -lopcodes
710829 else
711830 # we are on a system that requires -liberty and (maybe) -lz
712831 # to link against -lbfd; test each case individually here
....@@ -717,12 +836,21 @@
717836 $(call feature_check,libbfd-liberty-z)
718837
719838 ifeq ($(feature-libbfd-liberty), 1)
720
- EXTLIBS += -lbfd -liberty
839
+ EXTLIBS += -lbfd -lopcodes -liberty
840
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
721841 else
722842 ifeq ($(feature-libbfd-liberty-z), 1)
723
- EXTLIBS += -lbfd -liberty -lz
843
+ EXTLIBS += -lbfd -lopcodes -liberty -lz
844
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
724845 endif
725846 endif
847
+ $(call feature_check,disassembler-four-args)
848
+endif
849
+
850
+ifeq ($(feature-libbfd-buildid), 1)
851
+ CFLAGS += -DHAVE_LIBBFD_BUILDID_SUPPORT
852
+else
853
+ msg := $(warning Old version of libbfd/binutils things like PE executable profiling will not be available);
726854 endif
727855
728856 ifdef NO_DEMANGLE
....@@ -775,6 +903,30 @@
775903 endif
776904 endif
777905
906
+ifndef NO_LIBZSTD
907
+ ifeq ($(feature-libzstd), 1)
908
+ CFLAGS += -DHAVE_ZSTD_SUPPORT
909
+ CFLAGS += $(LIBZSTD_CFLAGS)
910
+ LDFLAGS += $(LIBZSTD_LDFLAGS)
911
+ EXTLIBS += -lzstd
912
+ $(call detected,CONFIG_ZSTD)
913
+ else
914
+ msg := $(warning No libzstd found, disables trace compression, please install libzstd-dev[el] and/or set LIBZSTD_DIR);
915
+ NO_LIBZSTD := 1
916
+ endif
917
+endif
918
+
919
+ifndef NO_LIBCAP
920
+ ifeq ($(feature-libcap), 1)
921
+ CFLAGS += -DHAVE_LIBCAP_SUPPORT
922
+ EXTLIBS += -lcap
923
+ $(call detected,CONFIG_LIBCAP)
924
+ else
925
+ msg := $(warning No libcap found, disables capability support, please install libcap-devel/libcap-dev);
926
+ NO_LIBCAP := 1
927
+ endif
928
+endif
929
+
778930 ifndef NO_BACKTRACE
779931 ifeq ($(feature-backtrace), 1)
780932 CFLAGS += -DHAVE_BACKTRACE_SUPPORT
....@@ -799,6 +951,10 @@
799951
800952 ifdef HAVE_KVM_STAT_SUPPORT
801953 CFLAGS += -DHAVE_KVM_STAT_SUPPORT
954
+endif
955
+
956
+ifeq ($(feature-disassembler-four-args), 1)
957
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
802958 endif
803959
804960 ifeq (${IS_64_BIT}, 1)
....@@ -870,6 +1026,13 @@
8701026 $(call feature_check,jvmti)
8711027 ifeq ($(feature-jvmti), 1)
8721028 $(call detected_var,JDIR)
1029
+ ifndef NO_JVMTI_CMLR
1030
+ FEATURE_CHECK_CFLAGS-jvmti-cmlr := $(FEATURE_CHECK_CFLAGS-jvmti)
1031
+ $(call feature_check,jvmti-cmlr)
1032
+ ifeq ($(feature-jvmti-cmlr), 1)
1033
+ CFLAGS += -DHAVE_JVMTI_CMLR
1034
+ endif
1035
+ endif # NO_JVMTI_CMLR
8731036 else
8741037 $(warning No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel)
8751038 NO_JVMTI := 1
....@@ -907,6 +1070,19 @@
9071070 endif
9081071 endif
9091072
1073
+ifdef LIBPFM4
1074
+ $(call feature_check,libpfm4)
1075
+ ifeq ($(feature-libpfm4), 1)
1076
+ CFLAGS += -DHAVE_LIBPFM
1077
+ EXTLIBS += -lpfm
1078
+ ASCIIDOC_EXTRA = -aHAVE_LIBPFM=1
1079
+ $(call detected,CONFIG_LIBPFM4)
1080
+ else
1081
+ msg := $(warning libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev);
1082
+ NO_LIBPFM4 := 1
1083
+ endif
1084
+endif
1085
+
9101086 # Among the variables below, these:
9111087 # perfexecdir
9121088 # perf_include_dir