From 6fcdaa4c5096b51e16f295b0ba7939cc4db30f50 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Wed, 10 Aug 2022 14:09:53 -0700 Subject: [PATCH] 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 Signed-off-by: Peter Korsgaard --- package/linux-tools/Config.in | 7 +++++++ package/linux-tools/linux-tool-perf.mk.in | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in index 732ac65a25..10b6538a59 100644 --- a/package/linux-tools/Config.in +++ b/package/linux-tools/Config.in @@ -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 diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in index d82d45973c..7bba440530 100644 --- a/package/linux-tools/linux-tool-perf.mk.in +++ b/package/linux-tools/linux-tool-perf.mk.in @@ -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