1 # SPDX-License-Identifier: GPL-2.0-only
4 src-perf := $(srctree)/tools/perf
12 obj-perf := $(abspath $(obj-perf))/
15 $(shell printf "" > $(OUTPUT).config-detected)
16 detected = $(shell echo "$(1)=y" >> $(OUTPUT).config-detected)
17 detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
19 CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
20 HOSTCFLAGS := $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
22 include $(srctree)/tools/scripts/Makefile.arch
24 $(call detected_var,SRCARCH)
28 ifneq ($(NO_SYSCALL_TABLE),1)
32 ifeq (${IS_64_BIT}, 1)
36 ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc arm64 s390 mips))
41 ifneq ($(NO_SYSCALL_TABLE),1)
42 CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT
46 # Additional ARCH settings for ppc
47 ifeq ($(SRCARCH),powerpc)
49 CFLAGS += -I$(OUTPUT)arch/powerpc/include/generated
50 LIBUNWIND_LIBS := -lunwind -lunwind-ppc64
53 # Additional ARCH settings for x86
55 $(call detected,CONFIG_X86)
56 ifeq (${IS_64_BIT}, 1)
57 CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -I$(OUTPUT)arch/x86/include/generated
58 ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
59 LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma
60 $(call detected,CONFIG_X86_64)
62 LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
69 LIBUNWIND_LIBS = -lunwind -lunwind-arm
72 ifeq ($(SRCARCH),arm64)
74 CFLAGS += -I$(OUTPUT)arch/arm64/include/generated
75 LIBUNWIND_LIBS = -lunwind -lunwind-aarch64
78 ifeq ($(SRCARCH),riscv)
82 ifeq ($(SRCARCH),csky)
88 CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated
93 CFLAGS += -I$(OUTPUT)arch/mips/include/generated
94 LIBUNWIND_LIBS = -lunwind -lunwind-mips
97 ifeq ($(NO_PERF_REGS),0)
98 $(call detected,CONFIG_PERF_REGS)
101 # So far there's only x86 and arm libdw unwind support merged in perf.
102 # Disable it on all other architectures in case libdw unwind
103 # support is detected in system. Add supported architectures
105 ifneq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc s390 csky riscv))
106 NO_LIBDW_DWARF_UNWIND := 1
109 ifeq ($(LIBUNWIND_LIBS),)
113 # For linking with debug library, run like:
115 # make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
118 libunwind_arch_set_flags = $(eval $(libunwind_arch_set_flags_code))
119 define libunwind_arch_set_flags_code
120 FEATURE_CHECK_CFLAGS-libunwind-$(1) = -I$(LIBUNWIND_DIR)/include
121 FEATURE_CHECK_LDFLAGS-libunwind-$(1) = -L$(LIBUNWIND_DIR)/lib
125 LIBUNWIND_CFLAGS = -I$(LIBUNWIND_DIR)/include
126 LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
127 LIBUNWIND_ARCHS = x86 x86_64 arm aarch64 debug-frame-arm debug-frame-aarch64
128 $(foreach libunwind_arch,$(LIBUNWIND_ARCHS),$(call libunwind_arch_set_flags,$(libunwind_arch)))
131 # Set per-feature check compilation flags
132 FEATURE_CHECK_CFLAGS-libunwind = $(LIBUNWIND_CFLAGS)
133 FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
134 FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS)
135 FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
137 FEATURE_CHECK_LDFLAGS-libunwind-arm += -lunwind -lunwind-arm
138 FEATURE_CHECK_LDFLAGS-libunwind-aarch64 += -lunwind -lunwind-aarch64
139 FEATURE_CHECK_LDFLAGS-libunwind-x86 += -lunwind -llzma -lunwind-x86
140 FEATURE_CHECK_LDFLAGS-libunwind-x86_64 += -lunwind -llzma -lunwind-x86_64
142 FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto
145 LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
147 OPENCSDLIBS := -lopencsd_c_api
148 ifeq ($(findstring -static,${LDFLAGS}),-static)
149 OPENCSDLIBS += -lopencsd -lstdc++
152 LIBOPENCSD_LDFLAGS := -L$(CSLIBS)
154 FEATURE_CHECK_CFLAGS-libopencsd := $(LIBOPENCSD_CFLAGS)
155 FEATURE_CHECK_LDFLAGS-libopencsd := $(LIBOPENCSD_LDFLAGS) $(OPENCSDLIBS)
157 ifeq ($(NO_PERF_REGS),0)
158 CFLAGS += -DHAVE_PERF_REGS_SUPPORT
161 # for linking with debug library, run like:
162 # make DEBUG=1 LIBDW_DIR=/opt/libdw/
164 LIBDW_CFLAGS := -I$(LIBDW_DIR)/include
165 LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
168 ifeq ($(findstring -static,${LDFLAGS}),-static)
169 DWARFLIBS += -lelf -lebl -ldl -lz -llzma -lbz2
171 FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS)
172 FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) $(DWARFLIBS)
174 # for linking with debug library, run like:
175 # make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
176 ifdef LIBBABELTRACE_DIR
177 LIBBABELTRACE_CFLAGS := -I$(LIBBABELTRACE_DIR)/include
178 LIBBABELTRACE_LDFLAGS := -L$(LIBBABELTRACE_DIR)/lib
180 FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS)
181 FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf
184 LIBZSTD_CFLAGS := -I$(LIBZSTD_DIR)/lib
185 LIBZSTD_LDFLAGS := -L$(LIBZSTD_DIR)/lib
187 FEATURE_CHECK_CFLAGS-libzstd := $(LIBZSTD_CFLAGS)
188 FEATURE_CHECK_LDFLAGS-libzstd := $(LIBZSTD_LDFLAGS)
190 FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
191 # include ARCH specific config
192 -include $(src-perf)/arch/$(SRCARCH)/Makefile
194 ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
195 CFLAGS += -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
198 include $(srctree)/tools/scripts/utilities.mak
200 ifeq ($(call get-executable,$(FLEX)),)
201 dummy := $(error Error: $(FLEX) is missing on this system, please install it)
204 ifeq ($(call get-executable,$(BISON)),)
205 dummy := $(error Error: $(BISON) is missing on this system, please install it)
209 ifeq ($(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\= 371), 1)
210 BISON_FILE_PREFIX_MAP := --file-prefix-map=$(OUTPUT)=
214 # Treat warnings as errors unless directed not to
216 CORE_CFLAGS += -Werror
218 HOSTCFLAGS += -Werror
226 ifeq ($(CC_NO_CLANG), 0)
234 PARSER_DEBUG_BISON := -t
235 PARSER_DEBUG_FLEX := -d
236 CFLAGS += -DPARSER_DEBUG
237 $(call detected_var,PARSER_DEBUG_BISON)
238 $(call detected_var,PARSER_DEBUG_FLEX)
241 # Try different combinations to accommodate systems that only have
242 # python[2][3]-config in weird combinations in the following order of
243 # priority from lowest to highest:
246 # * python2-config as per pep-0394.
247 # * $(PYTHON)-config (If PYTHON is user supplied but PYTHON_CONFIG isn't)
249 PYTHON_AUTO := python-config
250 PYTHON_AUTO := $(if $(call get-executable,python3-config),python3-config,$(PYTHON_AUTO))
251 PYTHON_AUTO := $(if $(call get-executable,python-config),python-config,$(PYTHON_AUTO))
252 PYTHON_AUTO := $(if $(call get-executable,python2-config),python2-config,$(PYTHON_AUTO))
254 # If PYTHON is defined but PYTHON_CONFIG isn't, then take $(PYTHON)-config as if it was the user
255 # supplied value for PYTHON_CONFIG. Because it's "user supplied", error out if it doesn't exist.
258 PYTHON_CONFIG_AUTO := $(call get-executable,$(PYTHON)-config)
259 PYTHON_CONFIG := $(if $(PYTHON_CONFIG_AUTO),$(PYTHON_CONFIG_AUTO),\
260 $(call $(error $(PYTHON)-config not found)))
264 # Select either auto detected python and python-config or use user supplied values if they are
265 # defined. get-executable-or-default fails with an error if the first argument is supplied but
267 override PYTHON_CONFIG := $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON_AUTO))
268 override PYTHON := $(call get-executable-or-default,PYTHON,$(subst -config,,$(PYTHON_AUTO)))
270 grep-libs = $(filter -l%,$(1))
271 strip-libs = $(filter-out -l%,$(1))
273 PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
275 # Python 3.8 changed the output of `python-config --ldflags` to not include the
276 # '-lpythonX.Y' flag unless '--embed' is also passed. The feature check for
277 # libpython fails if that flag is not included in LDFLAGS
278 ifeq ($(shell $(PYTHON_CONFIG_SQ) --ldflags --embed 2>&1 1>/dev/null; echo $$?), 0)
279 PYTHON_CONFIG_LDFLAGS := --ldflags --embed
281 PYTHON_CONFIG_LDFLAGS := --ldflags
285 PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) $(PYTHON_CONFIG_LDFLAGS) 2>/dev/null)
286 PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
287 PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil
288 PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --includes 2>/dev/null)
289 FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
290 ifeq ($(CC_NO_CLANG), 0)
291 PYTHON_EMBED_CCOPTS := $(filter-out -ffat-lto-objects, $(PYTHON_EMBED_CCOPTS))
295 FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
296 FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
298 FEATURE_CHECK_LDFLAGS-libaio = -lrt
300 FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
302 CORE_CFLAGS += -fno-omit-frame-pointer
303 CORE_CFLAGS += -ggdb3
304 CORE_CFLAGS += -funwind-tables
306 CORE_CFLAGS += -Wextra
307 CORE_CFLAGS += -std=gnu99
309 CXXFLAGS += -std=gnu++14 -fno-exceptions -fno-rtti
311 CXXFLAGS += -fno-omit-frame-pointer
313 CXXFLAGS += -funwind-tables
314 CXXFLAGS += -Wno-strict-aliasing
317 HOSTCFLAGS += -Wextra
319 # Enforce a non-executable stack, as we may regress (again) in the future by
320 # adding assembler files missing the .GNU-stack linker note.
321 LDFLAGS += -Wl,-z,noexecstack
323 EXTLIBS = -lpthread -lrt -lm -ldl
326 CFLAGS += -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free
327 EXTLIBS += -ltcmalloc
330 ifeq ($(FEATURES_DUMP),)
331 # We will display at the end of this Makefile.config, using $(call feature_display_entries)
332 # As we may retry some feature detection here, see the disassembler-four-args case, for instance
333 FEATURE_DISPLAY_DEFERRED := 1
334 include $(srctree)/tools/build/Makefile.feature
336 include $(FEATURES_DUMP)
339 ifeq ($(feature-stackprotector-all), 1)
340 CORE_CFLAGS += -fstack-protector-all
344 ifeq ($(feature-fortify-source), 1)
345 CORE_CFLAGS += -D_FORTIFY_SOURCE=2
349 INC_FLAGS += -I$(srctree)/tools/lib/perf/include
350 INC_FLAGS += -I$(src-perf)/util/include
351 INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
352 INC_FLAGS += -I$(srctree)/tools/include/
353 INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi
354 INC_FLAGS += -I$(srctree)/tools/include/uapi
355 INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/
356 INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/
358 # $(obj-perf) for generated common-cmds.h
359 # $(obj-perf)/util for generated bison/flex headers
361 INC_FLAGS += -I$(obj-perf)/util
362 INC_FLAGS += -I$(obj-perf)
365 INC_FLAGS += -I$(src-perf)/util
366 INC_FLAGS += -I$(src-perf)
367 INC_FLAGS += -I$(srctree)/tools/lib/
369 CORE_CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
371 CFLAGS += $(CORE_CFLAGS) $(INC_FLAGS)
372 CXXFLAGS += $(INC_FLAGS)
374 LIBPERF_CFLAGS := $(CORE_CFLAGS) $(EXTRA_CFLAGS)
376 ifeq ($(feature-pthread-attr-setaffinity-np), 1)
377 CFLAGS += -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP
380 ifeq ($(feature-pthread-barrier), 1)
381 CFLAGS += -DHAVE_PTHREAD_BARRIER
385 $(call feature_check,bionic)
386 ifeq ($(feature-bionic), 1)
388 CFLAGS += -DLACKS_SIGQUEUE_PROTOTYPE
389 CFLAGS += -DLACKS_OPEN_MEMSTREAM_PROTOTYPE
390 EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
391 EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
395 ifeq ($(feature-eventfd), 1)
396 CFLAGS += -DHAVE_EVENTFD_SUPPORT
399 ifeq ($(feature-get_current_dir_name), 1)
400 CFLAGS += -DHAVE_GET_CURRENT_DIR_NAME
403 ifeq ($(feature-gettid), 1)
404 CFLAGS += -DHAVE_GETTID
407 ifeq ($(feature-file-handle), 1)
408 CFLAGS += -DHAVE_FILE_HANDLE
415 NO_LIBDW_DWARF_UNWIND := 1
419 ifeq ($(feature-libelf), 0)
420 ifeq ($(feature-glibc), 1)
426 ifeq ($(LIBC_SUPPORT),1)
427 msg := $(warning No libelf found. Disables 'probe' tool, jvmti and BPF support in 'perf record'. Please install libelf-dev, libelf-devel or elfutils-libelf-devel);
433 NO_LIBDW_DWARF_UNWIND := 1
437 ifneq ($(filter s% -fsanitize=address%,$(EXTRA_CFLAGS),),)
438 ifneq ($(shell ldconfig -p | grep libasan >/dev/null 2>&1; echo $$?), 0)
439 msg := $(error No libasan found, please install libasan);
443 ifneq ($(filter s% -fsanitize=undefined%,$(EXTRA_CFLAGS),),)
444 ifneq ($(shell ldconfig -p | grep libubsan >/dev/null 2>&1; echo $$?), 0)
445 msg := $(error No libubsan found, please install libubsan);
449 ifneq ($(filter s% -static%,$(LDFLAGS),),)
450 msg := $(error No static glibc found, please install glibc-static);
452 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
456 ifndef NO_LIBDW_DWARF_UNWIND
457 ifneq ($(feature-libdw-dwarf-unwind),1)
458 NO_LIBDW_DWARF_UNWIND := 1
459 msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR);
462 ifneq ($(feature-dwarf), 1)
464 msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
468 ifneq ($(feature-dwarf_getlocations), 1)
469 msg := $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157);
471 CFLAGS += -DHAVE_DWARF_GETLOCATIONS_SUPPORT
472 endif # dwarf_getlocations
473 endif # Dwarf support
474 endif # libelf support
477 ifeq ($(feature-glibc), 1)
478 CFLAGS += -DHAVE_GLIBC_SUPPORT
481 ifeq ($(feature-libaio), 1)
483 CFLAGS += -DHAVE_AIO_SUPPORT
488 NO_LIBDW_DWARF_UNWIND := 1
491 ifeq ($(feature-sched_getcpu), 1)
492 CFLAGS += -DHAVE_SCHED_GETCPU_SUPPORT
495 ifeq ($(feature-setns), 1)
496 CFLAGS += -DHAVE_SETNS_SUPPORT
497 $(call detected,CONFIG_SETNS)
501 $(call feature_check,libopencsd)
502 ifeq ($(feature-libopencsd), 1)
503 CFLAGS += -DHAVE_CSTRACE_SUPPORT $(LIBOPENCSD_CFLAGS)
504 ifeq ($(feature-reallocarray), 0)
505 CFLAGS += -DCOMPAT_NEED_REALLOCARRAY
507 LDFLAGS += $(LIBOPENCSD_LDFLAGS)
508 EXTLIBS += $(OPENCSDLIBS)
509 $(call detected,CONFIG_LIBOPENCSD)
511 CFLAGS += -DCS_DEBUG_RAW
512 ifeq (${CSTRACE_RAW}, packed)
513 CFLAGS += -DCS_RAW_PACKED
517 dummy := $(error Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1)
522 CFLAGS += -DHAVE_LIBELF_SUPPORT
524 $(call detected,CONFIG_LIBELF)
526 ifeq ($(feature-libelf-getphdrnum), 1)
527 CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
530 ifeq ($(feature-libelf-gelf_getnote), 1)
531 CFLAGS += -DHAVE_GELF_GETNOTE_SUPPORT
533 msg := $(warning gelf_getnote() not found on libelf, SDT support disabled);
536 ifeq ($(feature-libelf-getshdrstrndx), 1)
537 CFLAGS += -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT
540 ifndef NO_LIBDEBUGINFOD
541 $(call feature_check,libdebuginfod)
542 ifeq ($(feature-libdebuginfod), 1)
543 CFLAGS += -DHAVE_DEBUGINFOD_SUPPORT
544 EXTLIBS += -ldebuginfod
549 ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
550 msg := $(warning DWARF register mappings have not been defined for architecture $(SRCARCH), DWARF support disabled);
553 CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
554 LDFLAGS += $(LIBDW_LDFLAGS)
555 EXTLIBS += ${DWARFLIBS}
556 $(call detected,CONFIG_DWARF)
557 endif # PERF_HAVE_DWARF_REGS
561 ifeq ($(feature-bpf), 1)
562 CFLAGS += -DHAVE_LIBBPF_SUPPORT
563 $(call detected,CONFIG_LIBBPF)
565 # detecting libbpf without LIBBPF_DYNAMIC, so make VF=1 shows libbpf detection status
566 $(call feature_check,libbpf)
568 ifeq ($(feature-libbpf), 1)
570 $(call detected,CONFIG_LIBBPF_DYNAMIC)
572 $(call feature_check,libbpf-btf__load_from_kernel_by_id)
573 ifeq ($(feature-libbpf-btf__load_from_kernel_by_id), 1)
574 CFLAGS += -DHAVE_LIBBPF_BTF__LOAD_FROM_KERNEL_BY_ID
576 $(call feature_check,libbpf-bpf_prog_load)
577 ifeq ($(feature-libbpf-bpf_prog_load), 1)
578 CFLAGS += -DHAVE_LIBBPF_BPF_PROG_LOAD
580 $(call feature_check,libbpf-bpf_object__next_program)
581 ifeq ($(feature-libbpf-bpf_object__next_program), 1)
582 CFLAGS += -DHAVE_LIBBPF_BPF_OBJECT__NEXT_PROGRAM
584 $(call feature_check,libbpf-bpf_object__next_map)
585 ifeq ($(feature-libbpf-bpf_object__next_map), 1)
586 CFLAGS += -DHAVE_LIBBPF_BPF_OBJECT__NEXT_MAP
588 $(call feature_check,libbpf-btf__raw_data)
589 ifeq ($(feature-libbpf-btf__raw_data), 1)
590 CFLAGS += -DHAVE_LIBBPF_BTF__RAW_DATA
592 $(call feature_check,libbpf-bpf_map_create)
593 ifeq ($(feature-libbpf-bpf_map_create), 1)
594 CFLAGS += -DHAVE_LIBBPF_BPF_MAP_CREATE
597 dummy := $(error Error: No libbpf devel library found, please install libbpf-devel);
600 CFLAGS += -DHAVE_LIBBPF_BTF__LOAD_FROM_KERNEL_BY_ID
601 CFLAGS += -DHAVE_LIBBPF_BPF_PROG_LOAD
602 CFLAGS += -DHAVE_LIBBPF_BPF_OBJECT__NEXT_PROGRAM
603 CFLAGS += -DHAVE_LIBBPF_BPF_OBJECT__NEXT_MAP
604 CFLAGS += -DHAVE_LIBBPF_BTF__RAW_DATA
605 CFLAGS += -DHAVE_LIBBPF_BPF_MAP_CREATE
610 ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
611 CFLAGS += -DHAVE_BPF_PROLOGUE
612 $(call detected,CONFIG_BPF_PROLOGUE)
614 msg := $(warning BPF prologue is not supported by architecture $(SRCARCH), missing regs_query_register_offset());
617 msg := $(warning DWARF support is off, BPF prologue is disabled);
624 ifneq ($(feature-sdt), 1)
625 msg := $(warning No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev);
628 CFLAGS += -DHAVE_SDT_EVENT
629 $(call detected,CONFIG_SDT_EVENT)
633 ifdef PERF_HAVE_JITDUMP
635 $(call detected,CONFIG_JITDUMP)
636 CFLAGS += -DHAVE_JITDUMP
640 ifeq ($(SRCARCH),powerpc)
642 CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX
649 $(call feature_check,libunwind-x86)
650 ifeq ($(feature-libunwind-x86), 1)
651 $(call detected,CONFIG_LIBUNWIND_X86)
652 CFLAGS += -DHAVE_LIBUNWIND_X86_SUPPORT
653 LDFLAGS += -lunwind-x86
654 EXTLIBS_LIBUNWIND += -lunwind-x86
658 $(call feature_check,libunwind-aarch64)
659 ifeq ($(feature-libunwind-aarch64), 1)
660 $(call detected,CONFIG_LIBUNWIND_AARCH64)
661 CFLAGS += -DHAVE_LIBUNWIND_AARCH64_SUPPORT
662 LDFLAGS += -lunwind-aarch64
663 EXTLIBS_LIBUNWIND += -lunwind-aarch64
665 $(call feature_check,libunwind-debug-frame-aarch64)
666 ifneq ($(feature-libunwind-debug-frame-aarch64), 1)
667 msg := $(warning No debug_frame support found in libunwind-aarch64);
668 CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME_AARCH64
672 ifneq ($(feature-libunwind), 1)
673 msg := $(warning No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR);
674 NO_LOCAL_LIBUNWIND := 1
677 $(call detected,CONFIG_LOCAL_LIBUNWIND)
680 ifneq ($(have_libunwind), 1)
684 NO_LOCAL_LIBUNWIND := 1
688 ifneq ($(feature-bpf), 1)
689 msg := $(warning BPF API too old. Please install recent kernel headers. BPF support in 'perf record' is disabled.)
695 $(call feature_check,clang-bpf-co-re)
696 ifeq ($(feature-clang-bpf-co-re), 0)
697 dummy := $(error Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL)
699 ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
700 dummy := $(error Error: BPF skeleton support requires libbpf)
702 $(call detected,CONFIG_PERF_BPF_SKEL)
703 CFLAGS += -DHAVE_BPF_SKEL
706 dwarf-post-unwind := 1
707 dwarf-post-unwind-text := BUG
709 # setup DWARF post unwinder
711 ifdef NO_LIBDW_DWARF_UNWIND
712 msg := $(warning Disabling post unwind, no support found.);
713 dwarf-post-unwind := 0
715 dwarf-post-unwind-text := libdw
716 $(call detected,CONFIG_LIBDW_DWARF_UNWIND)
719 dwarf-post-unwind-text := libunwind
720 $(call detected,CONFIG_LIBUNWIND)
721 # Enable libunwind support by default.
722 ifndef NO_LIBDW_DWARF_UNWIND
723 NO_LIBDW_DWARF_UNWIND := 1
727 ifeq ($(dwarf-post-unwind),1)
728 CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT
729 $(call detected,CONFIG_DWARF_UNWIND)
734 ifndef NO_LOCAL_LIBUNWIND
735 ifeq ($(SRCARCH),$(filter $(SRCARCH),arm arm64))
736 $(call feature_check,libunwind-debug-frame)
737 ifneq ($(feature-libunwind-debug-frame), 1)
738 msg := $(warning No debug_frame support found in libunwind);
739 CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
742 # non-ARM has no dwarf_find_debug_frame() function:
743 CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
745 EXTLIBS += $(LIBUNWIND_LIBS)
746 LDFLAGS += $(LIBUNWIND_LIBS)
748 ifeq ($(findstring -static,${LDFLAGS}),-static)
749 # gcc -static links libgcc_eh which contans piece of libunwind
750 LIBUNWIND_LDFLAGS += -Wl,--allow-multiple-definition
754 CFLAGS += -DHAVE_LIBUNWIND_SUPPORT
755 CFLAGS += $(LIBUNWIND_CFLAGS)
756 LDFLAGS += $(LIBUNWIND_LDFLAGS)
757 EXTLIBS += $(EXTLIBS_LIBUNWIND)
760 ifeq ($(NO_SYSCALL_TABLE),0)
761 $(call detected,CONFIG_TRACE)
764 $(call feature_check,libaudit)
765 ifneq ($(feature-libaudit), 1)
766 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
769 CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
771 $(call detected,CONFIG_TRACE)
777 ifneq ($(feature-libcrypto), 1)
778 msg := $(warning No libcrypto.h found, disables jitted code injection, please install openssl-devel or libssl-dev);
781 CFLAGS += -DHAVE_LIBCRYPTO_SUPPORT
783 $(call detected,CONFIG_CRYPTO)
792 ifneq ($(feature-libslang), 1)
793 ifneq ($(feature-libslang-include-subdir), 1)
794 msg := $(warning slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev);
797 CFLAGS += -DHAVE_SLANG_INCLUDE_SUBDIR
801 # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
802 CFLAGS += -DHAVE_SLANG_SUPPORT
804 $(call detected,CONFIG_SLANG)
809 FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
810 $(call feature_check,gtk2)
811 ifneq ($(feature-gtk2), 1)
812 msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
815 $(call feature_check,gtk2-infobar)
816 ifeq ($(feature-gtk2-infobar), 1)
817 GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT
819 CFLAGS += -DHAVE_GTK2_SUPPORT
820 GTK_CFLAGS += $(shell $(PKG_CONFIG) --cflags gtk+-2.0 2>/dev/null)
821 GTK_LIBS := $(shell $(PKG_CONFIG) --libs gtk+-2.0 2>/dev/null)
827 CFLAGS += -DNO_LIBPERL
829 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
830 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
831 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
832 PERL_EMBED_CCOPTS = $(shell perl -MExtUtils::Embed -e ccopts 2>/dev/null)
833 PERL_EMBED_CCOPTS := $(filter-out -specs=%,$(PERL_EMBED_CCOPTS))
834 PERL_EMBED_CCOPTS := $(filter-out -flto=auto -ffat-lto-objects, $(PERL_EMBED_CCOPTS))
835 PERL_EMBED_LDOPTS := $(filter-out -specs=%,$(PERL_EMBED_LDOPTS))
836 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
838 ifneq ($(feature-libperl), 1)
839 CFLAGS += -DNO_LIBPERL
841 msg := $(warning Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev);
843 LDFLAGS += $(PERL_EMBED_LDFLAGS)
844 EXTLIBS += $(PERL_EMBED_LIBADD)
845 CFLAGS += -DHAVE_LIBPERL_SUPPORT
846 ifeq ($(CC_NO_CLANG), 0)
847 CFLAGS += -Wno-compound-token-split-by-macro
849 $(call detected,CONFIG_LIBPERL)
853 ifeq ($(feature-timerfd), 1)
854 CFLAGS += -DHAVE_TIMERFD_SUPPORT
856 msg := $(warning No timerfd support. Disables 'perf kvm stat live');
859 disable-python = $(eval $(disable-python_code))
860 define disable-python_code
861 CFLAGS += -DNO_LIBPYTHON
867 $(call disable-python,Python support disabled by user)
871 $(call disable-python,No python interpreter was found: disables Python support - please install python-devel/python-dev)
873 PYTHON_WORD := $(call shell-wordify,$(PYTHON))
876 $(call disable-python,No 'python-config' tool was found: disables Python support - please install python-devel/python-dev)
879 ifneq ($(feature-libpython), 1)
880 $(call disable-python,No 'Python.h' (for Python 2.x support) was found: disables Python support - please install python-devel/python-dev)
882 LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
883 EXTLIBS += $(PYTHON_EMBED_LIBADD)
884 LANG_BINDINGS += $(obj-perf)python/perf.so
885 CFLAGS += -DHAVE_LIBPYTHON_SUPPORT
886 $(call detected,CONFIG_LIBPYTHON)
894 ifeq ($(feature-libbfd), 1)
895 EXTLIBS += -lbfd -lopcodes
897 # we are on a system that requires -liberty and (maybe) -lz
898 # to link against -lbfd; test each case individually here
900 # call all detections now so we get correct
901 # status in VF output
902 $(call feature_check,libbfd-liberty)
903 $(call feature_check,libbfd-liberty-z)
905 ifeq ($(feature-libbfd-liberty), 1)
906 EXTLIBS += -lbfd -lopcodes -liberty
907 FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
909 ifeq ($(feature-libbfd-liberty-z), 1)
910 EXTLIBS += -lbfd -lopcodes -liberty -lz
911 FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
914 $(call feature_check,disassembler-four-args)
917 ifeq ($(feature-libbfd-buildid), 1)
918 CFLAGS += -DHAVE_LIBBFD_BUILDID_SUPPORT
920 msg := $(warning Old version of libbfd/binutils things like PE executable profiling will not be available);
925 CFLAGS += -DNO_DEMANGLE
927 ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
930 ifeq ($(filter -liberty,$(EXTLIBS)),)
931 $(call feature_check,cplus-demangle)
933 # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT
934 # or any of 'bfd iberty z' trinity
935 ifeq ($(feature-cplus-demangle), 1)
938 msg := $(warning No bfd.h/libbfd found, please install binutils-dev[el]/zlib-static/libiberty-dev to gain symbol demangling)
939 CFLAGS += -DNO_DEMANGLE
944 ifneq ($(filter -liberty,$(EXTLIBS)),)
945 CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
949 ifneq ($(filter -lbfd,$(EXTLIBS)),)
950 CFLAGS += -DHAVE_LIBBFD_SUPPORT
954 ifeq ($(feature-zlib), 1)
955 CFLAGS += -DHAVE_ZLIB_SUPPORT
957 $(call detected,CONFIG_ZLIB)
964 ifeq ($(feature-lzma), 1)
965 CFLAGS += -DHAVE_LZMA_SUPPORT
967 $(call detected,CONFIG_LZMA)
969 msg := $(warning No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev);
975 ifeq ($(feature-libzstd), 1)
976 CFLAGS += -DHAVE_ZSTD_SUPPORT
977 CFLAGS += $(LIBZSTD_CFLAGS)
978 LDFLAGS += $(LIBZSTD_LDFLAGS)
980 $(call detected,CONFIG_ZSTD)
982 msg := $(warning No libzstd found, disables trace compression, please install libzstd-dev[el] and/or set LIBZSTD_DIR);
988 ifeq ($(feature-libcap), 1)
989 CFLAGS += -DHAVE_LIBCAP_SUPPORT
991 $(call detected,CONFIG_LIBCAP)
993 msg := $(warning No libcap found, disables capability support, please install libcap-devel/libcap-dev);
999 ifeq ($(feature-backtrace), 1)
1000 CFLAGS += -DHAVE_BACKTRACE_SUPPORT
1005 ifeq ($(feature-libnuma), 0)
1006 msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev);
1009 ifeq ($(feature-numa_num_possible_cpus), 0)
1010 msg := $(warning Old numa library found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev >= 2.0.8);
1013 CFLAGS += -DHAVE_LIBNUMA_SUPPORT
1015 $(call detected,CONFIG_NUMA)
1020 ifdef HAVE_KVM_STAT_SUPPORT
1021 CFLAGS += -DHAVE_KVM_STAT_SUPPORT
1024 ifeq ($(feature-disassembler-four-args), 1)
1025 CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
1028 ifeq (${IS_64_BIT}, 1)
1029 ifndef NO_PERF_READ_VDSO32
1030 $(call feature_check,compile-32)
1031 ifeq ($(feature-compile-32), 1)
1032 CFLAGS += -DHAVE_PERF_READ_VDSO32
1034 NO_PERF_READ_VDSO32 := 1
1037 ifneq ($(SRCARCH), x86)
1038 NO_PERF_READ_VDSOX32 := 1
1040 ifndef NO_PERF_READ_VDSOX32
1041 $(call feature_check,compile-x32)
1042 ifeq ($(feature-compile-x32), 1)
1043 CFLAGS += -DHAVE_PERF_READ_VDSOX32
1045 NO_PERF_READ_VDSOX32 := 1
1049 NO_PERF_READ_VDSO32 := 1
1050 NO_PERF_READ_VDSOX32 := 1
1053 ifndef NO_LIBBABELTRACE
1054 $(call feature_check,libbabeltrace)
1055 ifeq ($(feature-libbabeltrace), 1)
1056 CFLAGS += -DHAVE_LIBBABELTRACE_SUPPORT $(LIBBABELTRACE_CFLAGS)
1057 LDFLAGS += $(LIBBABELTRACE_LDFLAGS)
1058 EXTLIBS += -lbabeltrace-ctf
1059 $(call detected,CONFIG_LIBBABELTRACE)
1061 msg := $(warning No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev);
1066 ifeq ($(SRCARCH),x86)
1067 ifeq ($(feature-get_cpuid), 0)
1068 msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc);
1073 $(call detected,CONFIG_AUXTRACE)
1074 CFLAGS += -DHAVE_AUXTRACE_SUPPORT
1075 ifeq ($(feature-reallocarray), 0)
1076 CFLAGS += -DCOMPAT_NEED_REALLOCARRAY
1082 ifneq (,$(wildcard /usr/sbin/update-java-alternatives))
1083 JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$3}')
1085 ifneq (,$(wildcard /usr/sbin/alternatives))
1086 JDIR=$(shell /usr/sbin/alternatives --display java | tail -1 | cut -d' ' -f 5 | sed -e 's%/jre/bin/java.%%g' -e 's%/bin/java.%%g')
1090 $(warning No alternatives command found, you need to set JDIR= to point to the root of your Java directory)
1096 FEATURE_CHECK_CFLAGS-jvmti := -I$(JDIR)/include -I$(JDIR)/include/linux
1097 $(call feature_check,jvmti)
1098 ifeq ($(feature-jvmti), 1)
1099 $(call detected_var,JDIR)
1100 ifndef NO_JVMTI_CMLR
1101 FEATURE_CHECK_CFLAGS-jvmti-cmlr := $(FEATURE_CHECK_CFLAGS-jvmti)
1102 $(call feature_check,jvmti-cmlr)
1103 ifeq ($(feature-jvmti-cmlr), 1)
1104 CFLAGS += -DHAVE_JVMTI_CMLR
1106 endif # NO_JVMTI_CMLR
1108 $(warning No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel)
1116 $(call feature_check,cxx)
1117 ifneq ($(feature-cxx), 1)
1118 msg := $(warning No g++ found, disable clang and llvm support. Please install g++)
1120 $(call feature_check,llvm)
1121 $(call feature_check,llvm-version)
1122 ifneq ($(feature-llvm), 1)
1123 msg := $(warning No suitable libLLVM found, disabling builtin clang and LLVM support. Please install llvm-dev(el) (>= 3.9.0))
1125 $(call feature_check,clang)
1126 ifneq ($(feature-clang), 1)
1127 msg := $(warning No suitable libclang found, disabling builtin clang and LLVM support. Please install libclang-dev(el) (>= 3.9.0))
1129 CFLAGS += -DHAVE_LIBCLANGLLVM_SUPPORT
1130 CXXFLAGS += -DHAVE_LIBCLANGLLVM_SUPPORT -I$(shell $(LLVM_CONFIG) --includedir)
1131 $(call detected,CONFIG_CXX)
1132 $(call detected,CONFIG_CLANGLLVM)
1136 ifneq ($(feature-llvm-version),1)
1137 msg := $(warning This version of LLVM is not tested. May cause build errors)
1145 $(call feature_check,libpfm4)
1146 ifeq ($(feature-libpfm4), 1)
1147 CFLAGS += -DHAVE_LIBPFM
1149 ASCIIDOC_EXTRA = -aHAVE_LIBPFM=1
1150 $(call detected,CONFIG_LIBPFM4)
1152 msg := $(warning libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev);
1157 ifdef LIBTRACEEVENT_DYNAMIC
1158 $(call feature_check,libtraceevent)
1159 ifeq ($(feature-libtraceevent), 1)
1160 EXTLIBS += -ltraceevent
1161 LIBTRACEEVENT_VERSION := $(shell $(PKG_CONFIG) --modversion libtraceevent)
1162 LIBTRACEEVENT_VERSION_1 := $(word 1, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
1163 LIBTRACEEVENT_VERSION_2 := $(word 2, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
1164 LIBTRACEEVENT_VERSION_3 := $(word 3, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
1165 LIBTRACEEVENT_VERSION_CPP := $(shell expr $(LIBTRACEEVENT_VERSION_1) \* 255 \* 255 + $(LIBTRACEEVENT_VERSION_2) \* 255 + $(LIBTRACEEVENT_VERSION_3))
1166 CFLAGS += -DLIBTRACEEVENT_VERSION=$(LIBTRACEEVENT_VERSION_CPP)
1168 dummy := $(error Error: No libtraceevent devel library found, please install libtraceevent-devel);
1172 ifdef LIBTRACEFS_DYNAMIC
1173 $(call feature_check,libtracefs)
1174 ifeq ($(feature-libtracefs), 1)
1175 EXTLIBS += -ltracefs
1176 LIBTRACEFS_VERSION := $(shell $(PKG_CONFIG) --modversion libtracefs)
1177 LIBTRACEFS_VERSION_1 := $(word 1, $(subst ., ,$(LIBTRACEFS_VERSION)))
1178 LIBTRACEFS_VERSION_2 := $(word 2, $(subst ., ,$(LIBTRACEFS_VERSION)))
1179 LIBTRACEFS_VERSION_3 := $(word 3, $(subst ., ,$(LIBTRACEFS_VERSION)))
1180 LIBTRACEFS_VERSION_CPP := $(shell expr $(LIBTRACEFS_VERSION_1) \* 255 \* 255 + $(LIBTRACEFS_VERSION_2) \* 255 + $(LIBTRACEFS_VERSION_3))
1181 CFLAGS += -DLIBTRACEFS_VERSION=$(LIBTRACEFS_VERSION_CPP)
1183 dummy := $(error Error: No libtracefs devel library found, please install libtracefs-dev);
1187 # Among the variables below, these:
1195 # ETC_PERFCONFIG (but not sysconfdir)
1196 # can be specified as a relative path some/where/else;
1197 # this is interpreted as relative to $(prefix) and "perf" at
1198 # runtime figures out where they are based on the path to the executable.
1199 # This can help installing the suite in a relocatable way.
1201 # Make the path relative to DESTDIR, not to prefix
1205 bindir_relative = bin
1206 bindir = $(abspath $(prefix)/$(bindir_relative))
1207 includedir_relative = include
1208 includedir = $(abspath $(prefix)/$(includedir_relative))
1210 infodir = share/info
1211 perfexecdir = libexec/perf-core
1212 perf_include_dir = lib/perf/include
1213 perf_examples_dir = lib/perf/examples
1214 sharedir = $(prefix)/share
1215 template_dir = share/perf-core/templates
1216 STRACE_GROUPS_DIR = share/perf-core/strace/groups
1217 htmldir = share/doc/perf-doc
1218 tipdir = share/doc/perf-tip
1219 srcdir = $(srctree)/tools/perf
1220 ifeq ($(prefix),/usr)
1222 ETC_PERFCONFIG = $(sysconfdir)/perfconfig
1224 sysconfdir = $(prefix)/etc
1225 ETC_PERFCONFIG = etc/perfconfig
1228 ifeq ($(SRCARCH)$(IS_64_BIT), x861)
1234 libdir = $(prefix)/$(lib)
1236 # Shell quote (do not use $(call) to accommodate ancient setups);
1237 ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
1238 STRACE_GROUPS_DIR_SQ = $(subst ','\'',$(STRACE_GROUPS_DIR))
1239 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
1240 bindir_SQ = $(subst ','\'',$(bindir))
1241 includedir_SQ = $(subst ','\'',$(includedir))
1242 mandir_SQ = $(subst ','\'',$(mandir))
1243 infodir_SQ = $(subst ','\'',$(infodir))
1244 perfexecdir_SQ = $(subst ','\'',$(perfexecdir))
1245 perf_include_dir_SQ = $(subst ','\'',$(perf_include_dir))
1246 perf_examples_dir_SQ = $(subst ','\'',$(perf_examples_dir))
1247 template_dir_SQ = $(subst ','\'',$(template_dir))
1248 htmldir_SQ = $(subst ','\'',$(htmldir))
1249 tipdir_SQ = $(subst ','\'',$(tipdir))
1250 prefix_SQ = $(subst ','\'',$(prefix))
1251 sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
1252 libdir_SQ = $(subst ','\'',$(libdir))
1253 srcdir_SQ = $(subst ','\'',$(srcdir))
1255 ifneq ($(filter /%,$(firstword $(perfexecdir))),)
1256 perfexec_instdir = $(perfexecdir)
1257 perf_include_instdir = $(perf_include_dir)
1258 perf_examples_instdir = $(perf_examples_dir)
1259 STRACE_GROUPS_INSTDIR = $(STRACE_GROUPS_DIR)
1260 tip_instdir = $(tipdir)
1262 perfexec_instdir = $(prefix)/$(perfexecdir)
1263 perf_include_instdir = $(prefix)/$(perf_include_dir)
1264 perf_examples_instdir = $(prefix)/$(perf_examples_dir)
1265 STRACE_GROUPS_INSTDIR = $(prefix)/$(STRACE_GROUPS_DIR)
1266 tip_instdir = $(prefix)/$(tipdir)
1268 perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))
1269 perf_include_instdir_SQ = $(subst ','\'',$(perf_include_instdir))
1270 perf_examples_instdir_SQ = $(subst ','\'',$(perf_examples_instdir))
1271 STRACE_GROUPS_INSTDIR_SQ = $(subst ','\'',$(STRACE_GROUPS_INSTDIR))
1272 tip_instdir_SQ = $(subst ','\'',$(tip_instdir))
1274 # If we install to $(HOME) we keep the traceevent default:
1275 # $(HOME)/.traceevent/plugins
1276 # Otherwise we install plugins into the global $(libdir).
1278 plugindir=$(libdir)/traceevent/plugins
1279 plugindir_SQ= $(subst ','\'',$(plugindir))
1282 print_var = $(eval $(print_var_code)) $(info $(MSG))
1283 define print_var_code
1284 MSG = $(shell printf '...%30s: %s' $(1) $($(1)))
1288 # Display EXTRA features which are detected manualy
1289 # from here with feature_check call and thus cannot
1290 # be partof global state output.
1291 $(foreach feat,$(FEATURE_TESTS_EXTRA),$(call feature_print_status,$(feat),))
1292 $(call print_var,prefix)
1293 $(call print_var,bindir)
1294 $(call print_var,libdir)
1295 $(call print_var,sysconfdir)
1296 $(call print_var,LIBUNWIND_DIR)
1297 $(call print_var,LIBDW_DIR)
1298 $(call print_var,JDIR)
1300 ifeq ($(dwarf-post-unwind),1)
1301 $(call feature_print_text,"DWARF post unwind library", $(dwarf-post-unwind-text))
1306 $(call detected_var,bindir_SQ)
1307 $(call detected_var,PYTHON_WORD)
1309 $(call detected_var,OUTPUT)
1311 $(call detected_var,htmldir_SQ)
1312 $(call detected_var,infodir_SQ)
1313 $(call detected_var,mandir_SQ)
1314 $(call detected_var,ETC_PERFCONFIG_SQ)
1315 $(call detected_var,STRACE_GROUPS_DIR_SQ)
1316 $(call detected_var,prefix_SQ)
1317 $(call detected_var,perfexecdir_SQ)
1318 $(call detected_var,perf_include_dir_SQ)
1319 $(call detected_var,perf_examples_dir_SQ)
1320 $(call detected_var,tipdir_SQ)
1321 $(call detected_var,srcdir_SQ)
1322 $(call detected_var,LIBDIR)
1323 $(call detected_var,GTK_CFLAGS)
1324 $(call detected_var,PERL_EMBED_CCOPTS)
1325 $(call detected_var,PYTHON_EMBED_CCOPTS)
1326 ifneq ($(BISON_FILE_PREFIX_MAP),)
1327 $(call detected_var,BISON_FILE_PREFIX_MAP)
1330 # re-generate FEATURE-DUMP as we may have called feature_check, found out
1331 # extra libraries to add to LDFLAGS of some other test and then redo those
1332 # tests, see the block about libbfd, disassembler-four-args, for instance.
1333 $(shell rm -f $(FEATURE_DUMP_FILENAME))
1334 $(foreach feat,$(FEATURE_TESTS),$(shell echo "$(call feature_assign,$(feat))" >> $(FEATURE_DUMP_FILENAME)))
1336 ifeq ($(feature_display),1)
1337 $(call feature_display_entries)