1 ################################################################################
5 ################################################################################
7 # Source taken from the Linux kernel tree
9 PERF_VERSION
= $(call qstrip
,$(BR2_LINUX_KERNEL_VERSION
))
11 PERF_DEPENDENCIES
= linux host-flex host-bison
20 DESTDIR
=$(TARGET_DIR
) \
25 # The call to backtrace() function fails for ARC, because for some
26 # reason the unwinder from libgcc returns early. Thus the usage of
27 # backtrace() should be disabled in perf explicitly: at build time
28 # backtrace() appears to be available, but it fails at runtime: the
29 # backtrace will contain only several functions from the top of stack,
30 # instead of the complete backtrace.
32 PERF_MAKE_FLAGS
+= NO_BACKTRACE
=1
35 ifeq ($(BR2_PACKAGE_SLANG
),y
)
36 PERF_DEPENDENCIES
+= slang
39 ifeq ($(BR2_PACKAGE_LIBUNWIND
),y
)
40 PERF_DEPENDENCIES
+= libunwind
43 ifeq ($(BR2_PACKAGE_NUMACTL
),y
)
44 PERF_DEPENDENCIES
+= numactl
47 ifeq ($(BR2_PACKAGE_ELFUTILS
),y
)
48 PERF_DEPENDENCIES
+= elfutils
50 PERF_MAKE_FLAGS
+= NO_LIBELF
=1 NO_DWARF
=1
53 define PERF_BUILD_CMDS
54 $(Q
)if
test ! -f
$(LINUX_DIR
)/tools
/perf
/Makefile
; then \
55 echo
"Your kernel version is too old and does not have the perf tool." ; \
56 echo
"At least kernel 2.6.31 must be used." ; \
59 $(Q
)if
test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
60 if
! grep
-q NO_LIBELF
$(LINUX_DIR
)/tools
/perf
/Makefile
* ; then \
61 if
! test -r
$(LINUX_DIR
)/tools
/perf
/config
/Makefile
; then \
62 echo
"The perf tool in your kernel cannot be built without libelf." ; \
63 echo
"Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
68 $(TARGET_MAKE_ENV
) $(MAKE1
) -C
$(LINUX_DIR
)/tools
/perf \
69 $(PERF_MAKE_FLAGS
) O
=$(@D
)
72 # After installation, we remove the Perl and Python scripts from the
74 define PERF_INSTALL_TARGET_CMDS
75 $(TARGET_MAKE_ENV
) $(MAKE1
) -C
$(LINUX_DIR
)/tools
/perf \
76 $(PERF_MAKE_FLAGS
) O
=$(@D
) install
77 $(RM
) -rf
$(TARGET_DIR
)/usr
/libexec
/perf-core
/scripts
/
80 $(eval
$(generic-package
))