3 src-perf
:= $(srctree
)/tools
/perf
11 obj-perf
:= $(abspath
$(obj-perf
))/
14 $(shell printf
"" > $(OUTPUT
).config-detected
)
15 detected
= $(shell echo
"$(1)=y" >> $(OUTPUT
).config-detected
)
16 detected_var
= $(shell echo
"$(1)=$($(1))" >> $(OUTPUT
).config-detected
)
18 CFLAGS
:= $(EXTRA_CFLAGS
) $(EXTRA_WARNINGS
)
20 include $(srctree
)/tools
/scripts
/Makefile.arch
22 $(call detected_var
,ARCH
)
26 # Additional ARCH settings for ppc
27 ifeq ($(ARCH
),powerpc
)
29 LIBUNWIND_LIBS
:= -lunwind
-lunwind-ppc64
32 # Additional ARCH settings for x86
34 $(call detected
,CONFIG_X86
)
35 ifeq (${IS_64_BIT}, 1)
36 CFLAGS
+= -DHAVE_ARCH_X86_64_SUPPORT
-DHAVE_SYSCALL_TABLE
-I
$(OUTPUT
)arch
/x86
/include/generated
37 ARCH_INCLUDE
= ..
/..
/arch
/x86
/lib
/memcpy_64.S ..
/..
/arch
/x86
/lib
/memset_64.S
38 LIBUNWIND_LIBS
= -lunwind
-lunwind-x86_64
39 $(call detected
,CONFIG_X86_64
)
41 LIBUNWIND_LIBS
= -lunwind-x86
-llzma
-lunwind
48 LIBUNWIND_LIBS
= -lunwind
-lunwind-arm
53 LIBUNWIND_LIBS
= -lunwind
-lunwind-aarch64
56 ifeq ($(NO_PERF_REGS
),0)
57 $(call detected
,CONFIG_PERF_REGS
)
60 # So far there's only x86 and arm libdw unwind support merged in perf.
61 # Disable it on all other architectures in case libdw unwind
62 # support is detected in system. Add supported architectures
64 ifneq ($(ARCH
),$(filter $(ARCH
),x86 arm
))
65 NO_LIBDW_DWARF_UNWIND
:= 1
68 ifeq ($(LIBUNWIND_LIBS
),)
72 # For linking with debug library, run like:
74 # make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
77 LIBUNWIND_CFLAGS
= -I
$(LIBUNWIND_DIR
)/include
78 LIBUNWIND_LDFLAGS
= -L
$(LIBUNWIND_DIR
)/lib
80 LIBUNWIND_LDFLAGS
+= $(LIBUNWIND_LIBS
)
82 # Set per-feature check compilation flags
83 FEATURE_CHECK_CFLAGS-libunwind
= $(LIBUNWIND_CFLAGS
)
84 FEATURE_CHECK_LDFLAGS-libunwind
= $(LIBUNWIND_LDFLAGS
)
85 FEATURE_CHECK_CFLAGS-libunwind-debug-frame
= $(LIBUNWIND_CFLAGS
)
86 FEATURE_CHECK_LDFLAGS-libunwind-debug-frame
= $(LIBUNWIND_LDFLAGS
)
88 ifeq ($(NO_PERF_REGS
),0)
89 CFLAGS
+= -DHAVE_PERF_REGS_SUPPORT
92 # for linking with debug library, run like:
93 # make DEBUG=1 LIBDW_DIR=/opt/libdw/
95 LIBDW_CFLAGS
:= -I
$(LIBDW_DIR
)/include
96 LIBDW_LDFLAGS
:= -L
$(LIBDW_DIR
)/lib
98 FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind
:= $(LIBDW_CFLAGS
)
99 FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind
:= $(LIBDW_LDFLAGS
) -ldw
101 # for linking with debug library, run like:
102 # make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
103 ifdef LIBBABELTRACE_DIR
104 LIBBABELTRACE_CFLAGS
:= -I
$(LIBBABELTRACE_DIR
)/include
105 LIBBABELTRACE_LDFLAGS
:= -L
$(LIBBABELTRACE_DIR
)/lib
107 FEATURE_CHECK_CFLAGS-libbabeltrace
:= $(LIBBABELTRACE_CFLAGS
)
108 FEATURE_CHECK_LDFLAGS-libbabeltrace
:= $(LIBBABELTRACE_LDFLAGS
) -lbabeltrace-ctf
110 FEATURE_CHECK_CFLAGS-bpf
= -I.
-I
$(srctree
)/tools
/include -I
$(srctree
)/arch
/$(ARCH
)/include/uapi
-I
$(srctree
)/include/uapi
111 # include ARCH specific config
112 -include $(src-perf
)/arch
/$(ARCH
)/Makefile
114 ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
115 CFLAGS
+= -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
118 include $(srctree
)/tools
/scripts
/utilities.mak
120 ifeq ($(call get-executable
,$(FLEX
)),)
121 dummy
:= $(error Error
: $(FLEX
) is missing on this system
, please
install it
)
124 ifeq ($(call get-executable
,$(BISON
)),)
125 dummy
:= $(error Error
: $(BISON
) is missing on this system
, please
install it
)
128 # Treat warnings as errors unless directed not to
142 PARSER_DEBUG_BISON
:= -t
143 PARSER_DEBUG_FLEX
:= -d
144 CFLAGS
+= -DPARSER_DEBUG
145 $(call detected_var
,PARSER_DEBUG_BISON
)
146 $(call detected_var
,PARSER_DEBUG_FLEX
)
149 # Try different combinations to accommodate systems that only have
150 # python[2][-config] in weird combinations but always preferring
151 # python2 and python2-config as per pep-0394. If we catch a
152 # python[-config] in version 3, the version check will kill it.
153 PYTHON2
:= $(if
$(call get-executable
,python2
),python2
,python
)
154 override PYTHON
:= $(call get-executable-or-default
,PYTHON
,$(PYTHON2
))
156 $(if
$(call get-executable
,$(PYTHON
)-config
),$(PYTHON
)-config
,python-config
)
157 override PYTHON_CONFIG
:= \
158 $(call get-executable-or-default
,PYTHON_CONFIG
,$(PYTHON2_CONFIG
))
160 PYTHON_CONFIG_SQ
:= $(call shell-sq
,$(PYTHON_CONFIG
))
162 PYTHON_EMBED_LDOPTS
:= $(shell $(PYTHON_CONFIG_SQ
) --ldflags 2>/dev
/null
)
163 PYTHON_EMBED_CCOPTS
:= $(shell $(PYTHON_CONFIG_SQ
) --cflags 2>/dev
/null
)
165 FEATURE_CHECK_CFLAGS-libpython
:= $(PYTHON_EMBED_CCOPTS
)
166 FEATURE_CHECK_LDFLAGS-libpython
:= $(PYTHON_EMBED_LDOPTS
)
167 FEATURE_CHECK_CFLAGS-libpython-version
:= $(PYTHON_EMBED_CCOPTS
)
168 FEATURE_CHECK_LDFLAGS-libpython-version
:= $(PYTHON_EMBED_LDOPTS
)
170 CFLAGS
+= -fno-omit-frame-pointer
172 CFLAGS
+= -funwind-tables
177 # Enforce a non-executable stack, as we may regress (again) in the future by
178 # adding assembler files missing the .GNU-stack linker note.
179 LDFLAGS
+= -Wl
,-z
,noexecstack
181 EXTLIBS
= -lpthread
-lrt
-lm
-ldl
183 ifeq ($(FEATURES_DUMP
),)
184 include $(srctree
)/tools
/build
/Makefile.feature
186 include $(FEATURES_DUMP
)
189 ifeq ($(feature-stackprotector-all
), 1)
190 CFLAGS
+= -fstack-protector-all
194 ifeq ($(feature-fortify-source
), 1)
195 CFLAGS
+= -D_FORTIFY_SOURCE
=2
199 CFLAGS
+= -I
$(src-perf
)/util
/include
200 CFLAGS
+= -I
$(src-perf
)/arch
/$(ARCH
)/include
201 CFLAGS
+= -I
$(srctree
)/tools
/include/
202 CFLAGS
+= -I
$(srctree
)/arch
/$(ARCH
)/include/uapi
203 CFLAGS
+= -I
$(srctree
)/arch
/$(ARCH
)/include
204 CFLAGS
+= -I
$(srctree
)/include/uapi
205 CFLAGS
+= -I
$(srctree
)/include
207 # $(obj-perf) for generated common-cmds.h
208 # $(obj-perf)/util for generated bison/flex headers
210 CFLAGS
+= -I
$(obj-perf
)/util
211 CFLAGS
+= -I
$(obj-perf
)
214 CFLAGS
+= -I
$(src-perf
)/util
215 CFLAGS
+= -I
$(src-perf
)
216 CFLAGS
+= -I
$(srctree
)/tools
/lib
/
218 CFLAGS
+= -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS
=64 -D_GNU_SOURCE
220 ifeq ($(feature-sync-compare-and-swap
), 1)
221 CFLAGS
+= -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT
224 ifeq ($(feature-pthread-attr-setaffinity-np
), 1)
225 CFLAGS
+= -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP
229 $(call feature_check
,bionic
)
230 ifeq ($(feature-bionic
), 1)
232 EXTLIBS
:= $(filter-out -lrt
,$(EXTLIBS
))
233 EXTLIBS
:= $(filter-out -lpthread
,$(EXTLIBS
))
241 NO_LIBDW_DWARF_UNWIND
:= 1
244 ifeq ($(feature-libelf
), 0)
245 ifeq ($(feature-glibc
), 1)
251 ifeq ($(LIBC_SUPPORT
),1)
252 msg
:= $(warning No libelf found
, disables
'probe' tool and BPF support in
'perf record', please
install elfutils-libelf-devel
/libelf-dev
);
258 NO_LIBDW_DWARF_UNWIND
:= 1
261 ifneq ($(filter s
% -static
%,$(LDFLAGS
),),)
262 msg
:= $(error No static glibc found
, please
install glibc-static
);
264 msg
:= $(error No gnu
/libc-version.h found
, please
install glibc-dev
[el
]);
268 ifndef NO_LIBDW_DWARF_UNWIND
269 ifneq ($(feature-libdw-dwarf-unwind
),1)
270 NO_LIBDW_DWARF_UNWIND
:= 1
271 msg
:= $(warning No libdw DWARF unwind found
, Please
install elfutils-devel
/libdw-dev
>= 0.158 and
/or set LIBDW_DIR
);
274 ifneq ($(feature-dwarf
), 1)
275 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
);
278 ifneq ($(feature-dwarf_getlocations
), 1)
279 msg
:= $(warning Old libdw.h
, finding variables at given
'perf probe' point will not work
, install elfutils-devel
/libdw-dev
>= 0.157);
281 CFLAGS
+= -DHAVE_DWARF_GETLOCATIONS
282 endif # dwarf_getlocations
283 endif # Dwarf support
284 endif # libelf support
288 NO_LIBDW_DWARF_UNWIND
:= 1
292 CFLAGS
+= -DHAVE_LIBELF_SUPPORT
294 $(call detected
,CONFIG_LIBELF
)
296 ifeq ($(feature-libelf-mmap
), 1)
297 CFLAGS
+= -DHAVE_LIBELF_MMAP_SUPPORT
300 ifeq ($(feature-libelf-getphdrnum
), 1)
301 CFLAGS
+= -DHAVE_ELF_GETPHDRNUM_SUPPORT
305 ifeq ($(origin PERF_HAVE_DWARF_REGS
), undefined
)
306 msg
:= $(warning DWARF register mappings have not been defined for architecture
$(ARCH
), DWARF support disabled
);
309 CFLAGS
+= -DHAVE_DWARF_SUPPORT
$(LIBDW_CFLAGS
)
310 LDFLAGS
+= $(LIBDW_LDFLAGS
)
312 ifeq ($(findstring -static
,${LDFLAGS}),-static
)
313 DWARFLIBS
+= -lelf
-lebl
-lz
-llzma
-lbz2
315 EXTLIBS
+= ${DWARFLIBS}
316 $(call detected
,CONFIG_DWARF
)
317 endif # PERF_HAVE_DWARF_REGS
321 ifeq ($(feature-bpf
), 1)
322 CFLAGS
+= -DHAVE_LIBBPF_SUPPORT
323 $(call detected
,CONFIG_LIBBPF
)
327 ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
328 CFLAGS
+= -DHAVE_BPF_PROLOGUE
329 $(call detected
,CONFIG_BPF_PROLOGUE
)
331 msg
:= $(warning BPF prologue is not supported by architecture
$(ARCH
), missing regs_query_register_offset
());
334 msg
:= $(warning DWARF support is off
, BPF prologue is disabled
);
340 ifdef PERF_HAVE_JITDUMP
342 $(call detected
,CONFIG_JITDUMP
)
343 CFLAGS
+= -DHAVE_JITDUMP
347 ifeq ($(ARCH
),powerpc
)
349 CFLAGS
+= -DHAVE_SKIP_CALLCHAIN_IDX
354 ifneq ($(feature-libunwind
), 1)
355 msg
:= $(warning No libunwind found. Please
install libunwind-dev
[el
] >= 1.1 and
/or set LIBUNWIND_DIR
);
361 ifneq ($(feature-bpf
), 1)
362 msg
:= $(warning BPF API too old. Please
install recent kernel headers. BPF support in
'perf record' is disabled.
)
367 dwarf-post-unwind
:= 1
368 dwarf-post-unwind-text
:= BUG
370 # setup DWARF post unwinder
372 ifdef NO_LIBDW_DWARF_UNWIND
373 msg
:= $(warning Disabling post unwind
, no support found.
);
374 dwarf-post-unwind
:= 0
376 dwarf-post-unwind-text
:= libdw
377 $(call detected
,CONFIG_LIBDW_DWARF_UNWIND
)
380 dwarf-post-unwind-text
:= libunwind
381 $(call detected
,CONFIG_LIBUNWIND
)
382 # Enable libunwind support by default.
383 ifndef NO_LIBDW_DWARF_UNWIND
384 NO_LIBDW_DWARF_UNWIND
:= 1
388 ifeq ($(dwarf-post-unwind
),1)
389 CFLAGS
+= -DHAVE_DWARF_UNWIND_SUPPORT
390 $(call detected
,CONFIG_DWARF_UNWIND
)
396 ifeq ($(ARCH
),$(filter $(ARCH
),arm arm64
))
397 $(call feature_check
,libunwind-debug-frame
)
398 ifneq ($(feature-libunwind-debug-frame
), 1)
399 msg
:= $(warning No debug_frame support found in libunwind
);
400 CFLAGS
+= -DNO_LIBUNWIND_DEBUG_FRAME
403 # non-ARM has no dwarf_find_debug_frame() function:
404 CFLAGS
+= -DNO_LIBUNWIND_DEBUG_FRAME
406 CFLAGS
+= -DHAVE_LIBUNWIND_SUPPORT
407 EXTLIBS
+= $(LIBUNWIND_LIBS
)
408 CFLAGS
+= $(LIBUNWIND_CFLAGS
)
409 LDFLAGS
+= $(LIBUNWIND_LDFLAGS
)
413 ifneq ($(feature-libaudit
), 1)
414 msg
:= $(warning No libaudit.h found
, disables
'trace' tool
, please
install audit-libs-devel or libaudit-dev
);
417 CFLAGS
+= -DHAVE_LIBAUDIT_SUPPORT
419 $(call detected
,CONFIG_AUDIT
)
424 ifneq ($(feature-libcrypto
), 1)
425 msg
:= $(warning No libcrypto.h found
, disables jitted code injection
, please
install libssl-devel or libssl-dev
);
428 CFLAGS
+= -DHAVE_LIBCRYPTO_SUPPORT
430 $(call detected
,CONFIG_CRYPTO
)
439 ifneq ($(feature-libslang
), 1)
440 msg
:= $(warning slang not found
, disables TUI support. Please
install slang-devel or libslang-dev
);
443 # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
444 CFLAGS
+= -I
/usr
/include/slang
445 CFLAGS
+= -DHAVE_SLANG_SUPPORT
447 $(call detected
,CONFIG_SLANG
)
452 FLAGS_GTK2
=$(CFLAGS
) $(LDFLAGS
) $(EXTLIBS
) $(shell $(PKG_CONFIG
) --libs
--cflags gtk
+-2.0 2>/dev
/null
)
453 ifneq ($(feature-gtk2
), 1)
454 msg
:= $(warning GTK2 not found
, disables GTK2 support. Please
install gtk2-devel or libgtk2.0
-dev
);
457 ifeq ($(feature-gtk2-infobar
), 1)
458 GTK_CFLAGS
:= -DHAVE_GTK_INFO_BAR_SUPPORT
460 CFLAGS
+= -DHAVE_GTK2_SUPPORT
461 GTK_CFLAGS
+= $(shell $(PKG_CONFIG
) --cflags gtk
+-2.0 2>/dev
/null
)
462 GTK_LIBS
:= $(shell $(PKG_CONFIG
) --libs gtk
+-2.0 2>/dev
/null
)
467 grep-libs
= $(filter -l
%,$(1))
468 strip-libs
= $(filter-out -l
%,$(1))
471 CFLAGS
+= -DNO_LIBPERL
473 PERL_EMBED_LDOPTS
= $(shell perl
-MExtUtils
::Embed
-e ldopts
2>/dev
/null
)
474 PERL_EMBED_LDFLAGS
= $(call strip-libs
,$(PERL_EMBED_LDOPTS
))
475 PERL_EMBED_LIBADD
= $(call grep-libs
,$(PERL_EMBED_LDOPTS
))
476 PERL_EMBED_CCOPTS
= `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
477 FLAGS_PERL_EMBED
=$(PERL_EMBED_CCOPTS
) $(PERL_EMBED_LDOPTS
)
479 ifneq ($(feature-libperl
), 1)
480 CFLAGS
+= -DNO_LIBPERL
482 msg
:= $(warning Missing perl devel files. Disabling perl scripting support
, please
install perl-ExtUtils-Embed
/libperl-dev
);
484 LDFLAGS
+= $(PERL_EMBED_LDFLAGS
)
485 EXTLIBS
+= $(PERL_EMBED_LIBADD
)
486 $(call detected
,CONFIG_LIBPERL
)
490 ifeq ($(feature-timerfd
), 1)
491 CFLAGS
+= -DHAVE_TIMERFD_SUPPORT
493 msg
:= $(warning No timerfd support. Disables
'perf kvm stat live');
496 disable-python
= $(eval
$(disable-python_code
))
497 define disable-python_code
498 CFLAGS
+= -DNO_LIBPYTHON
504 $(call disable-python
,Python support disabled by user
)
508 $(call disable-python
,No python interpreter was found
: disables Python support
- please
install python-devel
/python-dev
)
510 PYTHON_WORD
:= $(call shell-wordify
,$(PYTHON
))
513 $(call disable-python
,No
'python-config' tool was found
: disables Python support
- please
install python-devel
/python-dev
)
516 PYTHON_CONFIG_SQ
:= $(call shell-sq
,$(PYTHON_CONFIG
))
518 PYTHON_EMBED_LDOPTS
:= $(shell $(PYTHON_CONFIG_SQ
) --ldflags 2>/dev
/null
)
519 PYTHON_EMBED_LDFLAGS
:= $(call strip-libs
,$(PYTHON_EMBED_LDOPTS
))
520 PYTHON_EMBED_LIBADD
:= $(call grep-libs
,$(PYTHON_EMBED_LDOPTS
)) -lutil
521 PYTHON_EMBED_CCOPTS
:= $(shell $(PYTHON_CONFIG_SQ
) --cflags 2>/dev
/null
)
522 FLAGS_PYTHON_EMBED
:= $(PYTHON_EMBED_CCOPTS
) $(PYTHON_EMBED_LDOPTS
)
524 ifneq ($(feature-libpython
), 1)
525 $(call disable-python
,No
'Python.h' (for Python
2.x support
) was found
: disables Python support
- please
install python-devel
/python-dev
)
528 ifneq ($(feature-libpython-version
), 1)
529 $(warning Python
3 is not yet supported
; please set
)
530 $(warning PYTHON and
/or PYTHON_CONFIG appropriately.
)
531 $(warning If you also have Python
2 installed
, then
)
532 $(warning try something like
:)
534 $(warning
$(and
,) make PYTHON
=python2
)
536 $(warning Otherwise
, disable Python support entirely
:)
538 $(warning
$(and
,) make NO_LIBPYTHON
=1)
542 LDFLAGS
+= $(PYTHON_EMBED_LDFLAGS
)
543 EXTLIBS
+= $(PYTHON_EMBED_LIBADD
)
544 LANG_BINDINGS
+= $(obj-perf
)python
/perf.so
545 $(call detected
,CONFIG_LIBPYTHON
)
552 ifeq ($(feature-libbfd
), 1)
555 # call all detections now so we get correct
556 # status in VF output
557 $(call feature_check
,liberty
)
558 $(call feature_check
,liberty-z
)
559 $(call feature_check
,cplus-demangle
)
561 ifeq ($(feature-liberty
), 1)
564 ifeq ($(feature-liberty-z
), 1)
565 EXTLIBS
+= -liberty
-lz
571 CFLAGS
+= -DNO_DEMANGLE
573 ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
575 CFLAGS
+= -DHAVE_CPLUS_DEMANGLE_SUPPORT
577 ifneq ($(feature-libbfd
), 1)
578 ifneq ($(feature-liberty
), 1)
579 ifneq ($(feature-liberty-z
), 1)
580 # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT
581 # or any of 'bfd iberty z' trinity
582 ifeq ($(feature-cplus-demangle
), 1)
584 CFLAGS
+= -DHAVE_CPLUS_DEMANGLE_SUPPORT
586 msg
:= $(warning No bfd.h
/libbfd found
, please
install binutils-dev
[el
]/zlib-static
/libiberty-dev to gain symbol demangling
)
587 CFLAGS
+= -DNO_DEMANGLE
595 ifneq ($(filter -lbfd
,$(EXTLIBS
)),)
596 CFLAGS
+= -DHAVE_LIBBFD_SUPPORT
600 ifeq ($(feature-zlib
), 1)
601 CFLAGS
+= -DHAVE_ZLIB_SUPPORT
603 $(call detected
,CONFIG_ZLIB
)
610 ifeq ($(feature-lzma
), 1)
611 CFLAGS
+= -DHAVE_LZMA_SUPPORT
613 $(call detected
,CONFIG_LZMA
)
615 msg
:= $(warning No liblzma found
, disables xz kernel module decompression
, please
install xz-devel
/liblzma-dev
);
621 ifeq ($(feature-backtrace
), 1)
622 CFLAGS
+= -DHAVE_BACKTRACE_SUPPORT
627 ifeq ($(feature-libnuma
), 0)
628 msg
:= $(warning No numa.h found
, disables
'perf bench numa mem' benchmark
, please
install numactl-devel
/libnuma-devel
/libnuma-dev
);
631 ifeq ($(feature-numa_num_possible_cpus
), 0)
632 msg
:= $(warning Old numa library found
, disables
'perf bench numa mem' benchmark
, please
install numactl-devel
/libnuma-devel
/libnuma-dev
>= 2.0.8);
635 CFLAGS
+= -DHAVE_LIBNUMA_SUPPORT
637 $(call detected
,CONFIG_NUMA
)
642 ifdef HAVE_KVM_STAT_SUPPORT
643 CFLAGS
+= -DHAVE_KVM_STAT_SUPPORT
646 ifeq (${IS_64_BIT}, 1)
647 ifndef NO_PERF_READ_VDSO32
648 $(call feature_check
,compile-32
)
649 ifeq ($(feature-compile-32
), 1)
650 CFLAGS
+= -DHAVE_PERF_READ_VDSO32
652 NO_PERF_READ_VDSO32
:= 1
656 NO_PERF_READ_VDSOX32
:= 1
658 ifndef NO_PERF_READ_VDSOX32
659 $(call feature_check
,compile-x32
)
660 ifeq ($(feature-compile-x32
), 1)
661 CFLAGS
+= -DHAVE_PERF_READ_VDSOX32
663 NO_PERF_READ_VDSOX32
:= 1
667 NO_PERF_READ_VDSO32
:= 1
668 NO_PERF_READ_VDSOX32
:= 1
672 $(call feature_check
,libbabeltrace
)
673 ifeq ($(feature-libbabeltrace
), 1)
674 CFLAGS
+= -DHAVE_LIBBABELTRACE_SUPPORT
$(LIBBABELTRACE_CFLAGS
)
675 LDFLAGS
+= $(LIBBABELTRACE_LDFLAGS
)
676 EXTLIBS
+= -lbabeltrace-ctf
677 $(call detected
,CONFIG_LIBBABELTRACE
)
679 msg
:= $(warning No libbabeltrace found
, disables
'perf data' CTF format support
, please
install libbabeltrace-dev
[el
]/libbabeltrace-ctf-dev
);
684 ifeq ($(feature-get_cpuid
), 0)
685 msg
:= $(warning Your gcc lacks the __get_cpuid
() builtin
, disables support for auxtrace
/Intel PT
, please
install a newer gcc
);
688 $(call detected
,CONFIG_AUXTRACE
)
689 CFLAGS
+= -DHAVE_AUXTRACE_SUPPORT
693 # Among the variables below, these:
699 # ETC_PERFCONFIG (but not sysconfdir)
700 # can be specified as a relative path some/where/else;
701 # this is interpreted as relative to $(prefix) and "perf" at
702 # runtime figures out where they are based on the path to the executable.
703 # This can help installing the suite in a relocatable way.
705 # Make the path relative to DESTDIR, not to prefix
709 bindir_relative
= bin
710 bindir = $(abspath
$(prefix)/$(bindir_relative
))
713 perfexecdir
= libexec
/perf-core
714 sharedir
= $(prefix)/share
715 template_dir
= share
/perf-core
/templates
716 STRACE_GROUPS_DIR
= share
/perf-core
/strace
/groups
717 htmldir
= share
/doc
/perf-doc
718 tipdir
= share
/doc
/perf-tip
719 srcdir = $(srctree
)/tools
/perf
720 ifeq ($(prefix),/usr
)
722 ETC_PERFCONFIG
= $(sysconfdir
)/perfconfig
724 sysconfdir
= $(prefix)/etc
725 ETC_PERFCONFIG
= etc
/perfconfig
728 ifeq ($(ARCH
)$(IS_64_BIT
), x861
)
734 libdir = $(prefix)/$(lib
)
736 # Shell quote (do not use $(call) to accommodate ancient setups);
737 ETC_PERFCONFIG_SQ
= $(subst ','\'',$(ETC_PERFCONFIG))
738 STRACE_GROUPS_DIR_SQ = $(subst ','\'',$(STRACE_GROUPS_DIR
))
739 DESTDIR_SQ
= $(subst ','\'',$(DESTDIR))
740 bindir_SQ = $(subst ','\'',$(bindir))
741 mandir_SQ
= $(subst ','\'',$(mandir))
742 infodir_SQ = $(subst ','\'',$(infodir))
743 perfexecdir_SQ
= $(subst ','\'',$(perfexecdir))
744 template_dir_SQ = $(subst ','\'',$(template_dir
))
745 htmldir_SQ
= $(subst ','\'',$(htmldir))
746 tipdir_SQ = $(subst ','\'',$(tipdir
))
747 prefix_SQ
= $(subst ','\'',$(prefix))
748 sysconfdir_SQ = $(subst ','\'',$(sysconfdir
))
749 libdir_SQ
= $(subst ','\'',$(libdir))
750 srcdir_SQ = $(subst ','\'',$(srcdir))
752 ifneq ($(filter /%,$(firstword $(perfexecdir
))),)
753 perfexec_instdir
= $(perfexecdir
)
754 STRACE_GROUPS_INSTDIR
= $(STRACE_GROUPS_DIR
)
755 tip_instdir
= $(tipdir
)
757 perfexec_instdir
= $(prefix)/$(perfexecdir
)
758 STRACE_GROUPS_INSTDIR
= $(prefix)/$(STRACE_GROUPS_DIR
)
759 tip_instdir
= $(prefix)/$(tipdir
)
761 perfexec_instdir_SQ
= $(subst ','\'',$(perfexec_instdir))
762 STRACE_GROUPS_INSTDIR_SQ = $(subst ','\'',$(STRACE_GROUPS_INSTDIR
))
763 tip_instdir_SQ
= $(subst ','\'',$(tip_instdir))
765 # If we install to $(HOME) we keep the traceevent default:
766 # $(HOME)/.traceevent/plugins
767 # Otherwise we install plugins into the global $(libdir).
769 plugindir=$(libdir)/traceevent/plugins
770 plugindir_SQ= $(subst ','\'',$(plugindir
))
773 print_var
= $(eval
$(print_var_code
)) $(info $(MSG
))
774 define print_var_code
775 MSG
= $(shell printf
'...%30s: %s' $(1) $($(1)))
779 $(call print_var
,prefix)
780 $(call print_var
,bindir)
781 $(call print_var
,libdir)
782 $(call print_var
,sysconfdir
)
783 $(call print_var
,LIBUNWIND_DIR
)
784 $(call print_var
,LIBDW_DIR
)
786 ifeq ($(dwarf-post-unwind
),1)
787 $(call feature_print_text
,"DWARF post unwind library", $(dwarf-post-unwind-text
))
792 $(call detected_var
,bindir_SQ
)
793 $(call detected_var
,PYTHON_WORD
)
795 $(call detected_var
,OUTPUT
)
797 $(call detected_var
,htmldir_SQ
)
798 $(call detected_var
,infodir_SQ
)
799 $(call detected_var
,mandir_SQ
)
800 $(call detected_var
,ETC_PERFCONFIG_SQ
)
801 $(call detected_var
,STRACE_GROUPS_DIR_SQ
)
802 $(call detected_var
,prefix_SQ
)
803 $(call detected_var
,perfexecdir_SQ
)
804 $(call detected_var
,tipdir_SQ
)
805 $(call detected_var
,srcdir_SQ
)
806 $(call detected_var
,LIBDIR
)
807 $(call detected_var
,GTK_CFLAGS
)
808 $(call detected_var
,PERL_EMBED_CCOPTS
)
809 $(call detected_var
,PYTHON_EMBED_CCOPTS
)