* [Buildroot] [PATCH 1/3] linux: add linux-tools infra
@ 2015-07-12 16:44 Romain Naour
2015-07-12 16:44 ` [Buildroot] [PATCH 2/3] linux-tools: add cpupower Romain Naour
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Romain Naour @ 2015-07-12 16:44 UTC (permalink / raw)
To: buildroot
This commit add an infrastructure to build linux kernel
tools available in the kernel sources.
Currently, the only linux kernel tool packaged in Buildroot
is perf and it's packaged as a separate generic package.
This is a problem for licence information raised in this
thread [1].
Since these tools require to build a Linux kernel, we can
use some hooks in linux package like we did for linux
extensions [2] and remove the perf package.
[1] http://lists.busybox.net/pipermail/buildroot/2015-May/128783.html
[2] http://lists.busybox.net/pipermail/buildroot/2015-March/121835.html
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
linux/linux.mk | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/linux/linux.mk b/linux/linux.mk
index eca1450..d483c11 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -325,6 +325,8 @@ define LINUX_INSTALL_TARGET_CMDS
$(LINUX_INSTALL_HOST_TOOLS)
endef
+# Include all our externsions and tools definitions.
+#
# Note: our package infrastructure uses the full-path of the last-scanned
# Makefile to determine what package we're currently defining, using the
# last directory component in the path. As such, including other Makefile,
@@ -334,6 +336,7 @@ endef
# the current Makefile, we are OK. But this is a hard requirement: files
# included here *must* be in the same directory!
include $(sort $(wildcard linux/linux-ext-*.mk))
+include $(sort $(wildcard linux/linux-tool-*.mk))
LINUX_PATCH_DEPENDENCIES += $(foreach ext,$(LINUX_EXTENSIONS),\
$(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),$(ext)))
@@ -342,6 +345,27 @@ LINUX_PRE_PATCH_HOOKS += $(foreach ext,$(LINUX_EXTENSIONS),\
$(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),\
$(call UPPERCASE,$(ext))_PREPARE_KERNEL))
+# Install Linux kernel tools in staging directory since some tools
+# may install shared libraries and headers (e.g. cpupower). The
+# kernel image is NOT installed in staging directory.
+LINUX_INSTALL_STAGING = $(if $(strip $(LINUX_TOOLS)),YES,NO)
+
+LINUX_DEPENDENCIES += $(foreach tool,$(LINUX_TOOLS),\
+ $(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
+ $(LINUX_TOOL_$(call UPPERCASE,$(tool))_DEPENDENCIES)))
+
+LINUX_POST_BUILD_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
+ $(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
+ LINUX_TOOL_$(call UPPERCASE,$(tool))_BUILD_CMDS))
+
+LINUX_POST_INSTALL_STAGING_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
+ $(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
+ LINUX_TOOL_$(call UPPERCASE,$(tool))_INSTALL_STAGING_CMDS))
+
+LINUX_POST_INSTALL_TARGET_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
+ $(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
+ LINUX_TOOL_$(call UPPERCASE,$(tool))_INSTALL_TARGET_CMDS))
+
$(eval $(kconfig-package))
# Support for rebuilding the kernel after the cpio archive has
--
2.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread* [Buildroot] [PATCH 2/3] linux-tools: add cpupower
2015-07-12 16:44 [Buildroot] [PATCH 1/3] linux: add linux-tools infra Romain Naour
@ 2015-07-12 16:44 ` Romain Naour
2015-07-12 19:14 ` Yann E. MORIN
2015-07-12 16:44 ` [Buildroot] [PATCH 3/3] package/perf: migrate perf to use the new linux-tools infrastructure Romain Naour
2015-07-12 18:40 ` [Buildroot] [PATCH 1/3] linux: add linux-tools infra Yann E. MORIN
2 siblings, 1 reply; 6+ messages in thread
From: Romain Naour @ 2015-07-12 16:44 UTC (permalink / raw)
To: buildroot
This patch is based on the patch send by James Knight:
http://lists.busybox.net/pipermail/buildroot/2015-May/128754.html
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Cc: James Knight <james.knight@rockwellcollins.com>
---
linux/Config.in | 3 +++
linux/Config.tools.in | 11 +++++++++++
linux/linux-tool-cpupower.mk | 41 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 55 insertions(+)
create mode 100644 linux/Config.tools.in
create mode 100644 linux/linux-tool-cpupower.mk
diff --git a/linux/Config.in b/linux/Config.in
index 8c86a1a..097cde5 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -364,6 +364,9 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET
# Linux extensions
source "linux/Config.ext.in"
+# Linux tools
+source "linux/Config.tools.in"
+
endif # BR2_LINUX_KERNEL
endmenu
diff --git a/linux/Config.tools.in b/linux/Config.tools.in
new file mode 100644
index 0000000..008e68c
--- /dev/null
+++ b/linux/Config.tools.in
@@ -0,0 +1,11 @@
+menu "Linux Kernel Tools"
+
+config BR2_LINUX_KERNEL_TOOL_CPUPOWER
+ bool "cpupower"
+ depends on !BR2_bfin # pciutils
+ select BR2_PACKAGE_PCIUTILS
+ help
+ cpupower is a collection of tools to examine and tune power
+ saving related features of your processor.
+
+endmenu
diff --git a/linux/linux-tool-cpupower.mk b/linux/linux-tool-cpupower.mk
new file mode 100644
index 0000000..0938fac
--- /dev/null
+++ b/linux/linux-tool-cpupower.mk
@@ -0,0 +1,41 @@
+################################################################################
+#
+# Linux kernel cpupower tool
+#
+################################################################################
+
+LINUX_TOOLS += cpupower
+
+LINUX_TOOL_CPUPOWER_DEPENDENCIES = pciutils
+
+define LINUX_TOOL_CPUPOWER_BUILD_CMDS
+ $(Q)if test ! -f $(LINUX_DIR)/tools/power/cpupower/Makefile ; then \
+ echo "Your kernel version is too old and does not have the cpupower tool." ; \
+ echo "At least kernel 3.4 must be used." ; \
+ exit 1 ; \
+ fi
+
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+ CROSS=$(TARGET_CROSS) \
+ CPUFREQ_BENCH=false \
+ DEBUG=false \
+ cpupower
+endef
+
+define LINUX_TOOL_CPUPOWER_INSTALL_STAGING_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+ CROSS=$(TARGET_CROSS) \
+ CPUFREQ_BENCH=false \
+ DEBUG=false \
+ DESTDIR=$(STAGING_DIR) \
+ cpupower_install
+endef
+
+define LINUX_TOOL_CPUPOWER_INSTALL_TARGET_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+ CROSS=$(TARGET_CROSS) \
+ CPUFREQ_BENCH=false \
+ DEBUG=false \
+ DESTDIR=$(TARGET_DIR) \
+ cpupower_install
+endef
--
2.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 2/3] linux-tools: add cpupower
2015-07-12 16:44 ` [Buildroot] [PATCH 2/3] linux-tools: add cpupower Romain Naour
@ 2015-07-12 19:14 ` Yann E. MORIN
0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2015-07-12 19:14 UTC (permalink / raw)
To: buildroot
Romain, All,
On 2015-07-12 18:44 +0200, Romain Naour spake thusly:
> This patch is based on the patch send by James Knight:
> http://lists.busybox.net/pipermail/buildroot/2015-May/128754.html
>
> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
> Cc: James Knight <james.knight@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
I'm not too fond of the way we check for the correct version.
Alas, there's not really a better way (and that's how perf does
it too)...
Regards,
Yann E. MORIN.
> ---
> linux/Config.in | 3 +++
> linux/Config.tools.in | 11 +++++++++++
> linux/linux-tool-cpupower.mk | 41 +++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 55 insertions(+)
> create mode 100644 linux/Config.tools.in
> create mode 100644 linux/linux-tool-cpupower.mk
>
> diff --git a/linux/Config.in b/linux/Config.in
> index 8c86a1a..097cde5 100644
> --- a/linux/Config.in
> +++ b/linux/Config.in
> @@ -364,6 +364,9 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET
> # Linux extensions
> source "linux/Config.ext.in"
>
> +# Linux tools
> +source "linux/Config.tools.in"
> +
> endif # BR2_LINUX_KERNEL
>
> endmenu
> diff --git a/linux/Config.tools.in b/linux/Config.tools.in
> new file mode 100644
> index 0000000..008e68c
> --- /dev/null
> +++ b/linux/Config.tools.in
> @@ -0,0 +1,11 @@
> +menu "Linux Kernel Tools"
> +
> +config BR2_LINUX_KERNEL_TOOL_CPUPOWER
> + bool "cpupower"
> + depends on !BR2_bfin # pciutils
> + select BR2_PACKAGE_PCIUTILS
> + help
> + cpupower is a collection of tools to examine and tune power
> + saving related features of your processor.
> +
> +endmenu
> diff --git a/linux/linux-tool-cpupower.mk b/linux/linux-tool-cpupower.mk
> new file mode 100644
> index 0000000..0938fac
> --- /dev/null
> +++ b/linux/linux-tool-cpupower.mk
> @@ -0,0 +1,41 @@
> +################################################################################
> +#
> +# Linux kernel cpupower tool
> +#
> +################################################################################
> +
> +LINUX_TOOLS += cpupower
> +
> +LINUX_TOOL_CPUPOWER_DEPENDENCIES = pciutils
> +
> +define LINUX_TOOL_CPUPOWER_BUILD_CMDS
> + $(Q)if test ! -f $(LINUX_DIR)/tools/power/cpupower/Makefile ; then \
> + echo "Your kernel version is too old and does not have the cpupower tool." ; \
> + echo "At least kernel 3.4 must be used." ; \
> + exit 1 ; \
> + fi
> +
> + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
> + CROSS=$(TARGET_CROSS) \
> + CPUFREQ_BENCH=false \
> + DEBUG=false \
> + cpupower
> +endef
> +
> +define LINUX_TOOL_CPUPOWER_INSTALL_STAGING_CMDS
> + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
> + CROSS=$(TARGET_CROSS) \
> + CPUFREQ_BENCH=false \
> + DEBUG=false \
> + DESTDIR=$(STAGING_DIR) \
> + cpupower_install
> +endef
> +
> +define LINUX_TOOL_CPUPOWER_INSTALL_TARGET_CMDS
> + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
> + CROSS=$(TARGET_CROSS) \
> + CPUFREQ_BENCH=false \
> + DEBUG=false \
> + DESTDIR=$(TARGET_DIR) \
> + cpupower_install
> +endef
> --
> 2.4.3
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 3/3] package/perf: migrate perf to use the new linux-tools infrastructure
2015-07-12 16:44 [Buildroot] [PATCH 1/3] linux: add linux-tools infra Romain Naour
2015-07-12 16:44 ` [Buildroot] [PATCH 2/3] linux-tools: add cpupower Romain Naour
@ 2015-07-12 16:44 ` Romain Naour
2015-07-13 15:41 ` Yann E. MORIN
2015-07-12 18:40 ` [Buildroot] [PATCH 1/3] linux: add linux-tools infra Yann E. MORIN
2 siblings, 1 reply; 6+ messages in thread
From: Romain Naour @ 2015-07-12 16:44 UTC (permalink / raw)
To: buildroot
Remove perf package and add legacy handling.
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
Config.in.legacy | 7 +++++++
linux/Config.tools.in | 18 ++++++++++++++++
package/perf/perf.mk => linux/linux-tool-perf.mk | 26 ++++++++++--------------
package/Config.in | 1 -
package/perf/Config.in | 21 -------------------
5 files changed, 36 insertions(+), 37 deletions(-)
rename package/perf/perf.mk => linux/linux-tool-perf.mk (78%)
delete mode 100644 package/perf/Config.in
diff --git a/Config.in.legacy b/Config.in.legacy
index edf9912..a5f84e8 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -107,6 +107,13 @@ endif
###############################################################################
comment "Legacy options removed in 2015.08"
+config BR2_PACKAGE_PERF
+ bool "perf"
+ select BR2_LEGACY
+ select BR2_LINUX_KERNEL_TOOL_PERF
+ help
+ Perf package has been moved to linux tools package.
+
config BR2_PACKAGE_GPU_VIV_BIN_MX6Q
bool "gpu-viv-bin-mx6q"
select BR2_LEGACY
diff --git a/linux/Config.tools.in b/linux/Config.tools.in
index 008e68c..0c94d55 100644
--- a/linux/Config.tools.in
+++ b/linux/Config.tools.in
@@ -8,4 +8,22 @@ config BR2_LINUX_KERNEL_TOOL_CPUPOWER
cpupower is a collection of tools to examine and tune power
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 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/
+
endmenu
diff --git a/package/perf/perf.mk b/linux/linux-tool-perf.mk
similarity index 78%
rename from package/perf/perf.mk
rename to linux/linux-tool-perf.mk
index 36989fc..a91a511 100644
--- a/package/perf/perf.mk
+++ b/linux/linux-tool-perf.mk
@@ -1,16 +1,14 @@
################################################################################
#
-# perf
+# Linux kernel Perf tool
#
################################################################################
-# Source taken from the Linux kernel tree
-PERF_SOURCE =
-PERF_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
+LINUX_TOOLS += perf
-PERF_DEPENDENCIES = linux host-flex host-bison
+LINUX_TOOL_PERF_DEPENDENCIES = host-flex host-bison
-PERF_MAKE_FLAGS = \
+LINUX_TOOL_PERF_MAKE_FLAGS = \
$(LINUX_MAKE_FLAGS) \
NO_LIBAUDIT=1 \
NO_NEWT=1 \
@@ -29,16 +27,16 @@ PERF_MAKE_FLAGS = \
# backtrace will contain only several functions from the top of stack,
# instead of the complete backtrace.
ifeq ($(BR2_arc),y)
-PERF_MAKE_FLAGS += NO_BACKTRACE=1
+LINUX_TOOL_PERF_MAKE_FLAGS += NO_BACKTRACE=1
endif
ifeq ($(BR2_PACKAGE_ELFUTILS),y)
-PERF_DEPENDENCIES += elfutils
+LINUX_TOOL_PERF_DEPENDENCIES += elfutils
else
-PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
+LINUX_TOOL_PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
endif
-define PERF_BUILD_CMDS
+define LINUX_TOOL_PERF_BUILD_CMDS
$(Q)if test ! -f $(LINUX_DIR)/tools/perf/Makefile ; then \
echo "Your kernel version is too old and does not have the perf tool." ; \
echo "At least kernel 2.6.31 must be used." ; \
@@ -54,15 +52,13 @@ define PERF_BUILD_CMDS
fi \
fi
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
- $(PERF_MAKE_FLAGS) O=$(@D)
+ $(LINUX_TOOL_PERF_MAKE_FLAGS) O=$(@D)
endef
# After installation, we remove the Perl and Python scripts from the
# target.
-define PERF_INSTALL_TARGET_CMDS
+define LINUX_TOOL_PERF_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
- $(PERF_MAKE_FLAGS) O=$(@D) install
+ $(LINUX_TOOL_PERF_MAKE_FLAGS) O=$(@D) install
$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/
endef
-
-$(eval $(generic-package))
diff --git a/package/Config.in b/package/Config.in
index e1b81a9..4e2e5a9 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -88,7 +88,6 @@ endif
source "package/netperf/Config.in"
source "package/oprofile/Config.in"
source "package/pax-utils/Config.in"
- source "package/perf/Config.in"
source "package/pv/Config.in"
source "package/racehound/Config.in"
source "package/ramsmp/Config.in"
diff --git a/package/perf/Config.in b/package/perf/Config.in
deleted file mode 100644
index 05c9870..0000000
--- a/package/perf/Config.in
+++ /dev/null
@@ -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
--
2.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 3/3] package/perf: migrate perf to use the new linux-tools infrastructure
2015-07-12 16:44 ` [Buildroot] [PATCH 3/3] package/perf: migrate perf to use the new linux-tools infrastructure Romain Naour
@ 2015-07-13 15:41 ` Yann E. MORIN
0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2015-07-13 15:41 UTC (permalink / raw)
To: buildroot
Romain, All,
On 2015-07-12 18:44 +0200, Romain Naour spake thusly:
> Remove perf package and add legacy handling.
>
> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Regards,
Yann E. MORIN.
> ---
> Config.in.legacy | 7 +++++++
> linux/Config.tools.in | 18 ++++++++++++++++
> package/perf/perf.mk => linux/linux-tool-perf.mk | 26 ++++++++++--------------
> package/Config.in | 1 -
> package/perf/Config.in | 21 -------------------
> 5 files changed, 36 insertions(+), 37 deletions(-)
> rename package/perf/perf.mk => linux/linux-tool-perf.mk (78%)
> delete mode 100644 package/perf/Config.in
>
> diff --git a/Config.in.legacy b/Config.in.legacy
> index edf9912..a5f84e8 100644
> --- a/Config.in.legacy
> +++ b/Config.in.legacy
> @@ -107,6 +107,13 @@ endif
> ###############################################################################
> comment "Legacy options removed in 2015.08"
>
> +config BR2_PACKAGE_PERF
> + bool "perf"
> + select BR2_LEGACY
> + select BR2_LINUX_KERNEL_TOOL_PERF
> + help
> + Perf package has been moved to linux tools package.
> +
> config BR2_PACKAGE_GPU_VIV_BIN_MX6Q
> bool "gpu-viv-bin-mx6q"
> select BR2_LEGACY
> diff --git a/linux/Config.tools.in b/linux/Config.tools.in
> index 008e68c..0c94d55 100644
> --- a/linux/Config.tools.in
> +++ b/linux/Config.tools.in
> @@ -8,4 +8,22 @@ config BR2_LINUX_KERNEL_TOOL_CPUPOWER
> cpupower is a collection of tools to examine and tune power
> 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 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/
> +
> endmenu
> diff --git a/package/perf/perf.mk b/linux/linux-tool-perf.mk
> similarity index 78%
> rename from package/perf/perf.mk
> rename to linux/linux-tool-perf.mk
> index 36989fc..a91a511 100644
> --- a/package/perf/perf.mk
> +++ b/linux/linux-tool-perf.mk
> @@ -1,16 +1,14 @@
> ################################################################################
> #
> -# perf
> +# Linux kernel Perf tool
> #
> ################################################################################
>
> -# Source taken from the Linux kernel tree
> -PERF_SOURCE =
> -PERF_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
> +LINUX_TOOLS += perf
>
> -PERF_DEPENDENCIES = linux host-flex host-bison
> +LINUX_TOOL_PERF_DEPENDENCIES = host-flex host-bison
>
> -PERF_MAKE_FLAGS = \
> +LINUX_TOOL_PERF_MAKE_FLAGS = \
> $(LINUX_MAKE_FLAGS) \
> NO_LIBAUDIT=1 \
> NO_NEWT=1 \
> @@ -29,16 +27,16 @@ PERF_MAKE_FLAGS = \
> # backtrace will contain only several functions from the top of stack,
> # instead of the complete backtrace.
> ifeq ($(BR2_arc),y)
> -PERF_MAKE_FLAGS += NO_BACKTRACE=1
> +LINUX_TOOL_PERF_MAKE_FLAGS += NO_BACKTRACE=1
> endif
>
> ifeq ($(BR2_PACKAGE_ELFUTILS),y)
> -PERF_DEPENDENCIES += elfutils
> +LINUX_TOOL_PERF_DEPENDENCIES += elfutils
> else
> -PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
> +LINUX_TOOL_PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
> endif
>
> -define PERF_BUILD_CMDS
> +define LINUX_TOOL_PERF_BUILD_CMDS
> $(Q)if test ! -f $(LINUX_DIR)/tools/perf/Makefile ; then \
> echo "Your kernel version is too old and does not have the perf tool." ; \
> echo "At least kernel 2.6.31 must be used." ; \
> @@ -54,15 +52,13 @@ define PERF_BUILD_CMDS
> fi \
> fi
> $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
> - $(PERF_MAKE_FLAGS) O=$(@D)
> + $(LINUX_TOOL_PERF_MAKE_FLAGS) O=$(@D)
> endef
>
> # After installation, we remove the Perl and Python scripts from the
> # target.
> -define PERF_INSTALL_TARGET_CMDS
> +define LINUX_TOOL_PERF_INSTALL_TARGET_CMDS
> $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
> - $(PERF_MAKE_FLAGS) O=$(@D) install
> + $(LINUX_TOOL_PERF_MAKE_FLAGS) O=$(@D) install
> $(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/
> endef
> -
> -$(eval $(generic-package))
> diff --git a/package/Config.in b/package/Config.in
> index e1b81a9..4e2e5a9 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -88,7 +88,6 @@ endif
> source "package/netperf/Config.in"
> source "package/oprofile/Config.in"
> source "package/pax-utils/Config.in"
> - source "package/perf/Config.in"
> source "package/pv/Config.in"
> source "package/racehound/Config.in"
> source "package/ramsmp/Config.in"
> diff --git a/package/perf/Config.in b/package/perf/Config.in
> deleted file mode 100644
> index 05c9870..0000000
> --- a/package/perf/Config.in
> +++ /dev/null
> @@ -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
> --
> 2.4.3
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 1/3] linux: add linux-tools infra
2015-07-12 16:44 [Buildroot] [PATCH 1/3] linux: add linux-tools infra Romain Naour
2015-07-12 16:44 ` [Buildroot] [PATCH 2/3] linux-tools: add cpupower Romain Naour
2015-07-12 16:44 ` [Buildroot] [PATCH 3/3] package/perf: migrate perf to use the new linux-tools infrastructure Romain Naour
@ 2015-07-12 18:40 ` Yann E. MORIN
2 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2015-07-12 18:40 UTC (permalink / raw)
To: buildroot
Romain, All,
On 2015-07-12 18:44 +0200, Romain Naour spake thusly:
> This commit add an infrastructure to build linux kernel
> tools available in the kernel sources.
>
> Currently, the only linux kernel tool packaged in Buildroot
> is perf and it's packaged as a separate generic package.
> This is a problem for licence information raised in this
> thread [1].
>
> Since these tools require to build a Linux kernel, we can
> use some hooks in linux package like we did for linux
> extensions [2] and remove the perf package.
>
> [1] http://lists.busybox.net/pipermail/buildroot/2015-May/128783.html
> [2] http://lists.busybox.net/pipermail/buildroot/2015-March/121835.html
>
> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
(Needless to say I like this! ;-] )
Regards,
Yann E. MORIN.
> ---
> linux/linux.mk | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/linux/linux.mk b/linux/linux.mk
> index eca1450..d483c11 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -325,6 +325,8 @@ define LINUX_INSTALL_TARGET_CMDS
> $(LINUX_INSTALL_HOST_TOOLS)
> endef
>
> +# Include all our externsions and tools definitions.
> +#
> # Note: our package infrastructure uses the full-path of the last-scanned
> # Makefile to determine what package we're currently defining, using the
> # last directory component in the path. As such, including other Makefile,
> @@ -334,6 +336,7 @@ endef
> # the current Makefile, we are OK. But this is a hard requirement: files
> # included here *must* be in the same directory!
> include $(sort $(wildcard linux/linux-ext-*.mk))
> +include $(sort $(wildcard linux/linux-tool-*.mk))
>
> LINUX_PATCH_DEPENDENCIES += $(foreach ext,$(LINUX_EXTENSIONS),\
> $(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),$(ext)))
> @@ -342,6 +345,27 @@ LINUX_PRE_PATCH_HOOKS += $(foreach ext,$(LINUX_EXTENSIONS),\
> $(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),\
> $(call UPPERCASE,$(ext))_PREPARE_KERNEL))
>
> +# Install Linux kernel tools in staging directory since some tools
> +# may install shared libraries and headers (e.g. cpupower). The
> +# kernel image is NOT installed in staging directory.
> +LINUX_INSTALL_STAGING = $(if $(strip $(LINUX_TOOLS)),YES,NO)
> +
> +LINUX_DEPENDENCIES += $(foreach tool,$(LINUX_TOOLS),\
> + $(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
> + $(LINUX_TOOL_$(call UPPERCASE,$(tool))_DEPENDENCIES)))
> +
> +LINUX_POST_BUILD_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
> + $(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
> + LINUX_TOOL_$(call UPPERCASE,$(tool))_BUILD_CMDS))
> +
> +LINUX_POST_INSTALL_STAGING_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
> + $(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
> + LINUX_TOOL_$(call UPPERCASE,$(tool))_INSTALL_STAGING_CMDS))
> +
> +LINUX_POST_INSTALL_TARGET_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
> + $(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
> + LINUX_TOOL_$(call UPPERCASE,$(tool))_INSTALL_TARGET_CMDS))
> +
> $(eval $(kconfig-package))
>
> # Support for rebuilding the kernel after the cpio archive has
> --
> 2.4.3
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-07-13 15:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-12 16:44 [Buildroot] [PATCH 1/3] linux: add linux-tools infra Romain Naour
2015-07-12 16:44 ` [Buildroot] [PATCH 2/3] linux-tools: add cpupower Romain Naour
2015-07-12 19:14 ` Yann E. MORIN
2015-07-12 16:44 ` [Buildroot] [PATCH 3/3] package/perf: migrate perf to use the new linux-tools infrastructure Romain Naour
2015-07-13 15:41 ` Yann E. MORIN
2015-07-12 18:40 ` [Buildroot] [PATCH 1/3] linux: add linux-tools infra Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox