mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-27 05:06:39 +00:00
package/perf: migrate perf to use the new linux-tools infrastructure
Remove the perf package and add legacy handling. [Thomas: - improve the Config.in.legacy help text - improve the comment explaining why we pass O= when building perf] Signed-off-by: Romain Naour <romain.naour@openwide.fr> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
f1863ede94
commit
1326e76185
@ -107,6 +107,15 @@ endif
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
comment "Legacy options removed in 2015.08"
|
comment "Legacy options removed in 2015.08"
|
||||||
|
|
||||||
|
config BR2_PACKAGE_PERF
|
||||||
|
bool "perf option has been renamed"
|
||||||
|
select BR2_LEGACY
|
||||||
|
select BR2_LINUX_KERNEL_TOOL_PERF
|
||||||
|
help
|
||||||
|
The perf package has been moved as a Linux tools package,
|
||||||
|
and the option to enable it is now
|
||||||
|
BR2_LINUX_KERNEL_TOOL_PERF.
|
||||||
|
|
||||||
config BR2_BINUTILS_VERSION_2_22
|
config BR2_BINUTILS_VERSION_2_22
|
||||||
bool "binutils 2.22 removed"
|
bool "binutils 2.22 removed"
|
||||||
select BR2_LEGACY
|
select BR2_LEGACY
|
||||||
|
@ -8,4 +8,22 @@ config BR2_LINUX_KERNEL_TOOL_CPUPOWER
|
|||||||
cpupower is a collection of tools to examine and tune power
|
cpupower is a collection of tools to examine and tune power
|
||||||
saving related features of your processor.
|
saving related features of your processor.
|
||||||
|
|
||||||
|
config BR2_LINUX_KERNEL_TOOL_PERF
|
||||||
|
bool "perf"
|
||||||
|
help
|
||||||
|
perf (sometimes "Perf Events" or perf tools, originally
|
||||||
|
"Performance Counters for Linux") - is a performance
|
||||||
|
analyzing tool in Linux, available from kernel version
|
||||||
|
2.6.31. User-space controlling utility, called 'perf' has
|
||||||
|
git-like interface with subcommands. It is capable of
|
||||||
|
statistical profiling of entire system (both kernel and user
|
||||||
|
code), single CPU or severals threads.
|
||||||
|
|
||||||
|
This will build and install the userspace 'perf'
|
||||||
|
command. It is up to the user to ensure that the kernel
|
||||||
|
configuration has all the suitable options enabled to allow a
|
||||||
|
proper operation of 'perf'.
|
||||||
|
|
||||||
|
https://perf.wiki.kernel.org/
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
@ -4,11 +4,9 @@
|
|||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Source taken from the Linux kernel tree
|
LINUX_TOOLS += perf
|
||||||
PERF_SOURCE =
|
|
||||||
PERF_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
|
|
||||||
|
|
||||||
PERF_DEPENDENCIES = linux host-flex host-bison
|
PERF_DEPENDENCIES = host-flex host-bison
|
||||||
|
|
||||||
ifeq ($(KERNEL_ARCH),x86_64)
|
ifeq ($(KERNEL_ARCH),x86_64)
|
||||||
PERF_ARCH=x86
|
PERF_ARCH=x86
|
||||||
@ -57,31 +55,33 @@ else
|
|||||||
PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
|
PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# O must be redefined here to overwrite the one used by Buildroot for
|
||||||
|
# out of tree build. We build perf in $(@D)/tools/perf/ and not just
|
||||||
|
# $(@D) so that it isn't built in the root directory of the kernel
|
||||||
|
# sources.
|
||||||
define PERF_BUILD_CMDS
|
define PERF_BUILD_CMDS
|
||||||
$(Q)if test ! -f $(LINUX_DIR)/tools/perf/Makefile ; then \
|
$(Q)if test ! -f $(@D)/tools/perf/Makefile ; then \
|
||||||
echo "Your kernel version is too old and does not have the perf tool." ; \
|
echo "Your kernel version is too old and does not have the perf tool." ; \
|
||||||
echo "At least kernel 2.6.31 must be used." ; \
|
echo "At least kernel 2.6.31 must be used." ; \
|
||||||
exit 1 ; \
|
exit 1 ; \
|
||||||
fi
|
fi
|
||||||
$(Q)if test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
|
$(Q)if test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
|
||||||
if ! grep -q NO_LIBELF $(LINUX_DIR)/tools/perf/Makefile* ; then \
|
if ! grep -q NO_LIBELF $(@D)/tools/perf/Makefile* ; then \
|
||||||
if ! test -r $(LINUX_DIR)/tools/perf/config/Makefile ; then \
|
if ! test -r $(@D)/tools/perf/config/Makefile ; then \
|
||||||
echo "The perf tool in your kernel cannot be built without libelf." ; \
|
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." ; \
|
echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
|
||||||
exit 1 ; \
|
exit 1 ; \
|
||||||
fi \
|
fi \
|
||||||
fi \
|
fi \
|
||||||
fi
|
fi
|
||||||
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
|
$(TARGET_MAKE_ENV) $(MAKE1) $(PERF_MAKE_FLAGS) \
|
||||||
$(PERF_MAKE_FLAGS) O=$(@D)
|
-C $(@D)/tools/perf O=$(@D)/tools/perf/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# After installation, we remove the Perl and Python scripts from the
|
# After installation, we remove the Perl and Python scripts from the
|
||||||
# target.
|
# target.
|
||||||
define PERF_INSTALL_TARGET_CMDS
|
define PERF_INSTALL_TARGET_CMDS
|
||||||
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
|
$(TARGET_MAKE_ENV) $(MAKE1) $(PERF_MAKE_FLAGS) \
|
||||||
$(PERF_MAKE_FLAGS) O=$(@D) install
|
-C $(@D)/tools/perf O=$(@D)/tools/perf/ install
|
||||||
$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/
|
$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(generic-package))
|
|
@ -89,7 +89,6 @@ endif
|
|||||||
source "package/netperf/Config.in"
|
source "package/netperf/Config.in"
|
||||||
source "package/oprofile/Config.in"
|
source "package/oprofile/Config.in"
|
||||||
source "package/pax-utils/Config.in"
|
source "package/pax-utils/Config.in"
|
||||||
source "package/perf/Config.in"
|
|
||||||
source "package/pv/Config.in"
|
source "package/pv/Config.in"
|
||||||
source "package/racehound/Config.in"
|
source "package/racehound/Config.in"
|
||||||
source "package/ramsmp/Config.in"
|
source "package/ramsmp/Config.in"
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
config BR2_PACKAGE_PERF
|
|
||||||
bool "perf"
|
|
||||||
depends on BR2_LINUX_KERNEL
|
|
||||||
help
|
|
||||||
perf (sometimes "Perf Events" or perf tools, originally
|
|
||||||
"Performance Counters for Linux") - is a performance
|
|
||||||
analyzing tool in Linux, available from kernel version
|
|
||||||
2.6.31. User-space controlling utility, called 'perf' has
|
|
||||||
git-like interface with subcommands. It is capable of
|
|
||||||
statistical profiling of entire system (both kernel and user
|
|
||||||
code), single CPU or severals threads.
|
|
||||||
|
|
||||||
This package builds and install the userspace 'perf'
|
|
||||||
command. It is up to the user to ensure that the kernel
|
|
||||||
configuration has all the suitable options enabled to allow a
|
|
||||||
proper operation of 'perf'.
|
|
||||||
|
|
||||||
https://perf.wiki.kernel.org/
|
|
||||||
|
|
||||||
comment "perf needs a Linux kernel to be built"
|
|
||||||
depends on !BR2_LINUX_KERNEL
|
|
Loading…
x
Reference in New Issue
Block a user