2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2013-01-06 06:22:45 +01:00
|
|
|
#
|
|
|
|
# perf
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2013-01-06 06:22:45 +01:00
|
|
|
|
|
|
|
# Source taken from the Linux kernel tree
|
|
|
|
PERF_SOURCE =
|
|
|
|
PERF_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
|
|
|
|
|
2013-09-04 21:02:10 +02:00
|
|
|
PERF_DEPENDENCIES = linux host-flex host-bison
|
2013-01-06 06:22:45 +01:00
|
|
|
|
|
|
|
PERF_MAKE_FLAGS = \
|
|
|
|
$(LINUX_MAKE_FLAGS) \
|
|
|
|
NO_LIBAUDIT=1 \
|
|
|
|
NO_NEWT=1 \
|
|
|
|
NO_GTK2=1 \
|
|
|
|
NO_LIBPERL=1 \
|
|
|
|
NO_LIBPYTHON=1 \
|
|
|
|
DESTDIR=$(TARGET_DIR) \
|
|
|
|
prefix=/usr \
|
2013-10-24 01:28:01 +02:00
|
|
|
WERROR=0 \
|
|
|
|
ASCIIDOC=
|
2013-01-06 06:22:45 +01:00
|
|
|
|
2014-01-28 14:10:58 +01:00
|
|
|
# The call to backtrace() function fails for ARC, because for some
|
|
|
|
# reason the unwinder from libgcc returns early. Thus the usage of
|
|
|
|
# backtrace() should be disabled in perf explicitly: at build time
|
|
|
|
# backtrace() appears to be available, but it fails at runtime: the
|
|
|
|
# backtrace will contain only several functions from the top of stack,
|
|
|
|
# instead of the complete backtrace.
|
|
|
|
ifeq ($(BR2_arc),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PERF_MAKE_FLAGS += NO_BACKTRACE=1
|
2014-01-28 14:10:58 +01:00
|
|
|
endif
|
|
|
|
|
2013-01-06 06:22:46 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_ELFUTILS),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
PERF_DEPENDENCIES += elfutils
|
2013-01-06 06:22:46 +01:00
|
|
|
else
|
2015-03-31 09:21:57 +02:00
|
|
|
PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
|
2013-01-06 06:22:46 +01:00
|
|
|
endif
|
|
|
|
|
2013-01-06 06:22:45 +01:00
|
|
|
define PERF_BUILD_CMDS
|
2013-01-06 06:22:47 +01:00
|
|
|
$(Q)if test ! -f $(LINUX_DIR)/tools/perf/Makefile ; then \
|
|
|
|
echo "Your kernel version is too old and does not have the perf tool." ; \
|
|
|
|
echo "At least kernel 2.6.31 must be used." ; \
|
|
|
|
exit 1 ; \
|
|
|
|
fi
|
|
|
|
$(Q)if test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
|
2014-07-21 16:02:12 +02:00
|
|
|
if ! grep -q NO_LIBELF $(LINUX_DIR)/tools/perf/Makefile* ; then \
|
2014-04-05 14:51:02 +02:00
|
|
|
if ! test -r $(LINUX_DIR)/tools/perf/config/Makefile ; then \
|
|
|
|
echo "The perf tool in your kernel cannot be built without libelf." ; \
|
|
|
|
echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
|
|
|
|
exit 1 ; \
|
|
|
|
fi \
|
2013-01-06 06:22:47 +01:00
|
|
|
fi \
|
|
|
|
fi
|
2015-03-19 08:19:25 +01:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
|
2013-01-06 06:22:45 +01:00
|
|
|
$(PERF_MAKE_FLAGS) O=$(@D)
|
|
|
|
endef
|
|
|
|
|
|
|
|
# After installation, we remove the Perl and Python scripts from the
|
|
|
|
# target.
|
|
|
|
define PERF_INSTALL_TARGET_CMDS
|
2015-03-19 08:19:25 +01:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
|
2013-01-06 06:22:45 +01:00
|
|
|
$(PERF_MAKE_FLAGS) O=$(@D) install
|
|
|
|
$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|