package/linux-tools: Allow installation of perf scripts

In order to run the full gamut of "perf tests" installing the perf
scripts is required, otherwise we run into errors similar to those:

	failed to open shell test directory: /usr/libexec/perf-core/tests/shell

Make this possible by introducing a new option allowing us to install
perf scripts.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Florian Fainelli 2022-08-10 14:09:53 -07:00 committed by Peter Korsgaard
parent 11477df6b1
commit 6fcdaa4c50
2 changed files with 16 additions and 3 deletions

View File

@ -76,6 +76,13 @@ comment "perf needs a toolchain w/ dynamic library"
if BR2_PACKAGE_LINUX_TOOLS_PERF
config BR2_PACKAGE_LINUX_TOOLS_PERF_SCRIPTS
bool "enable installation of perf scripts"
help
Enable the installation of the perf scripts under
/usr/libexec/perf-core/ which is necessary for running "perf
tests"
config BR2_PACKAGE_LINUX_TOOLS_PERF_TUI
bool "enable perf TUI"
depends on BR2_USE_MMU # slang

View File

@ -159,12 +159,18 @@ define PERF_BUILD_CMDS
endef
# After installation, we remove the Perl and Python scripts from the
# target.
# target unless BR2_PACKAGE_LINUX_TOOLS_PERF_SCRIPTS is enabled
ifeq ($(BR2_PACKAGE_LINUX_TOOLS_PERF_SCRIPTS),)
define PERF_INSTALL_REMOVE_SCRIPTS
$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/
$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/tests/
endef
endif
define PERF_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE1) $(PERF_MAKE_FLAGS) \
-C $(LINUX_DIR)/tools/perf O=$(LINUX_DIR)/tools/perf/ install
$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/
$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/tests/
$(PERF_INSTALL_REMOVE_SCRIPTS)
endef
define PERF_LINUX_CONFIG_FIXUPS