1 ################################################################################
5 ################################################################################
9 PERF_DEPENDENCIES
= host-flex host-bison
11 ifeq ($(KERNEL_ARCH
),x86_64
)
14 PERF_ARCH
=$(KERNEL_ARCH
)
25 DESTDIR
=$(TARGET_DIR
) \
30 # The call to backtrace() function fails for ARC, because for some
31 # reason the unwinder from libgcc returns early. Thus the usage of
32 # backtrace() should be disabled in perf explicitly: at build time
33 # backtrace() appears to be available, but it fails at runtime: the
34 # backtrace will contain only several functions from the top of stack,
35 # instead of the complete backtrace.
37 PERF_MAKE_FLAGS
+= NO_BACKTRACE
=1
40 ifeq ($(BR2_PACKAGE_SLANG
),y
)
41 PERF_DEPENDENCIES
+= slang
44 ifeq ($(BR2_PACKAGE_LIBUNWIND
),y
)
45 PERF_DEPENDENCIES
+= libunwind
48 ifeq ($(BR2_PACKAGE_NUMACTL
),y
)
49 PERF_DEPENDENCIES
+= numactl
52 ifeq ($(BR2_PACKAGE_ELFUTILS
),y
)
53 PERF_DEPENDENCIES
+= elfutils
55 PERF_MAKE_FLAGS
+= NO_LIBELF
=1 NO_DWARF
=1
58 # O must be redefined here to overwrite the one used by Buildroot for
59 # out of tree build. We build perf in $(@D)/tools/perf/ and not just
60 # $(@D) so that it isn't built in the root directory of the kernel
62 define PERF_BUILD_CMDS
63 $(Q
)if
test ! -f
$(@D
)/tools
/perf
/Makefile
; then \
64 echo
"Your kernel version is too old and does not have the perf tool." ; \
65 echo
"At least kernel 2.6.31 must be used." ; \
68 $(Q
)if
test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
69 if
! grep
-q NO_LIBELF
$(@D
)/tools
/perf
/Makefile
* ; then \
70 if
! test -r
$(@D
)/tools
/perf
/config
/Makefile
; then \
71 echo
"The perf tool in your kernel cannot be built without libelf." ; \
72 echo
"Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
77 $(TARGET_MAKE_ENV
) $(MAKE1
) $(PERF_MAKE_FLAGS
) \
78 -C
$(@D
)/tools
/perf O
=$(@D
)/tools
/perf
/
81 # After installation, we remove the Perl and Python scripts from the
83 define PERF_INSTALL_TARGET_CMDS
84 $(TARGET_MAKE_ENV
) $(MAKE1
) $(PERF_MAKE_FLAGS
) \
85 -C
$(@D
)/tools
/perf O
=$(@D
)/tools
/perf
/ install
86 $(RM
) -rf
$(TARGET_DIR
)/usr
/libexec
/perf-core
/scripts
/