linux: automatically set CONFIG_PERF_EVENTS when perf is enabled
authorJan Heylen <jan.heylen@nokia.com>
Wed, 4 Jul 2018 07:07:35 +0000 (09:07 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 4 Jul 2018 19:52:11 +0000 (21:52 +0200)
Perf profiling cannot be used if CONFIG_PERF_EVENTS is not enabled in the
kernel configuration. Similar to other tools, like ktap, we can enable the
right options automatically.

Signed-off-by: Jan Heylen <jan.heylen@nokia.com>
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
linux/linux.mk
package/linux-tools/Config.in

index 6b5f5344ed289aa06f8151a94947f2b9b359d408..7f4c91667149b7bc7b12ccc65012347ced7c2327 100644 (file)
@@ -292,6 +292,8 @@ define LINUX_KCONFIG_FIXUP_CMDS
                $(call KCONFIG_ENABLE_OPT,CONFIG_ENABLE_DEFAULT_TRACERS,$(@D)/.config)
                $(call KCONFIG_ENABLE_OPT,CONFIG_PERF_EVENTS,$(@D)/.config)
                $(call KCONFIG_ENABLE_OPT,CONFIG_FUNCTION_TRACER,$(@D)/.config))
+       $(if $(BR2_PACKAGE_LINUX_TOOLS_PERF),
+               $(call KCONFIG_ENABLE_OPT,CONFIG_PERF_EVENTS,$(@D)/.config))
        $(if $(BR2_PACKAGE_SYSTEMD),
                $(call KCONFIG_ENABLE_OPT,CONFIG_CGROUPS,$(@D)/.config)
                $(call KCONFIG_ENABLE_OPT,CONFIG_INOTIFY_USER,$(@D)/.config)
index 2527c90257b140df62a558ee016eb06a0f94932d..349dc6bf0ddd96969aabec8359134d350e84eb22 100644 (file)
@@ -47,9 +47,11 @@ config BR2_PACKAGE_LINUX_TOOLS_PERF
          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'.
+         command.
+
+         Your kernel must have CONFIG_PERF_EVENTS enabled to use perf
+         profiling. Buildroot automatically enables this in the kernel
+         configuration.
 
          https://perf.wiki.kernel.org/