Skip to contentSkip to conversation

package/linux-tools: Allow installation of perf scripts

PATCH In review Florian Fainelli 2 participants 2 messages Aug 10, 2022 – Aug 11, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
Changes in v2:

- updated based upon Fabrice's feedback

 package/linux-tools/Config.in             |  6 ++++++
 package/linux-tools/linux-tool-perf.mk.in | 12 +++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)
package/linux-tools/Config.in +6 -0
index 732ac65a2565..0a761191eca0 100644
@@ -76,6 +76,12 @@ 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
package/linux-tools/linux-tool-perf.mk.in +9 -3
index d82d45973cd7..7bba4405305a 100644
@@ -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
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Florian" == Florian Fainelli <[email protected]> writes:

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

Quoted 8 lines

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

---
Changes in v2:

- updated based upon Fabrice's feedback

Committed, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot