Skip to contentSkip to conversation

package/linux-tools: introduce linux mm tools

PATCH Applied Dmitry Rokosov via buildroot 2 participants 7 messages Feb 6, 2024 – Feb 7, 2024

lore
Share & tools
lore
#0 lore raw

v2 cover package/linux-tools: introduce linux mm tools

This toolset was designed to facilitate the testing, monitoring, and tracing of various things with virtual memory, pages, and slab objects. It is an invaluable resource for identifying and analyzing memory-related issues, such as leaks and bottlenecks, and can greatly enhance one's understanding of memory utilization within a system.

Also this patch series includes multilib build support for all linux-tools.

Changes v2 since v1 at [1]:
- instead of comparing kernel versions, verify the presence of the tools/{mm|vm}/Makefile
- add multilib build support patch for all linux-tools

Links:

    [1] https://lore.kernel.org/all/[email protected]/

Dmitry Rokosov (1):
package/linux-tools: introduce linux mm tools

Konstantin Menyaev (1):
package/linux-tools: multilib build supported

 package/linux-tools/Config.in                 | 18 ++++++++
 package/linux-tools/linux-tool-gpio.mk.in     |  2 +-
 package/linux-tools/linux-tool-iio.mk.in      |  2 +-
 package/linux-tools/linux-tool-mm.mk.in       | 41 +++++++++++++++++++
 package/linux-tools/linux-tool-pci.mk.in      |  2 +-
 package/linux-tools/linux-tool-perf.mk.in     |  2 +-
 .../linux-tools/linux-tool-selftests.mk.in    |  2 +-
 package/linux-tools/linux-tool-tmon.mk.in     |  2 +-
 package/linux-tools/linux-tools.mk            |  2 +
 9 files changed, 67 insertions(+), 6 deletions(-)
 create mode 100644 package/linux-tools/linux-tool-mm.mk.in
Signature · 6 lines
2.43.0

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

PATCH v2 1/2 package/linux-tools: introduce linux mm tools

This toolset was designed to facilitate the testing, monitoring, and tracing of various things with virtual memory, pages, and slab objects. It is an invaluable resource for identifying and analyzing memory-related issues, such as leaks and bottlenecks, and can greatly enhance one's understanding of memory utilization within a system.

The mm toolset includes:
- page_owner_sort: userspace helper to sort the output of /sys/kernel/debug/page_owner, which helps to know who allocates the page from kernel context
- slabinfo: the tool which gets reports about slabs, for example show empty slabs, modify of slab debug options at runtime, display all information about a slabcache
- page-types: a handy tool for querying page flags

---
 package/linux-tools/Config.in           | 18 +++++++++++
 package/linux-tools/linux-tool-mm.mk.in | 41 +++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 package/linux-tools/linux-tool-mm.mk.in
package/linux-tools/Config.in +18 -0
index 8a0b6d5802cc..ede966ec792d 100644
@@ -185,4 +185,22 @@ config BR2_PACKAGE_LINUX_TOOLS_HV_VSS_DAEMON
 
 endif # BR2_PACKAGE_LINUX_TOOLS_HV
 
+config BR2_PACKAGE_LINUX_TOOLS_MM
+	bool "mm"
+	select BR2_PACKAGE_LINUX_TOOLS
+	help
+	  mm is a toolset for testing/monitoring/tracing vm/pages/slabs objects.
+
+	  - page_owner_sort: userspace helper to sort the output of
+	  /sys/kernel/debug/page_owner, which helps to know who allocates
+	  the page from kernel context
+
+	  - slabinfo: the tool which gets reports about slabs, for example
+	  show empty slabs, modify of slab debug options at runtime, display
+	  all information about a slabcache
+
+	  - page-types: a handy tool for querying page flags
+
+	  These tools are available only from kernel version 3.4.
+
 endmenu
package/linux-tools/linux-tool-mm.mk.in new file +41 -0

41 lines not on this page · raw message

Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Dmitry, All,

On 2024-02-06 22:25 +0300, Dmitry Rokosov spake thusly:

Quoted 15 lines

This toolset was designed to facilitate the testing, monitoring, and tracing of various things with virtual memory, pages, and slab objects. It is an invaluable resource for identifying and analyzing memory-related issues, such as leaks and bottlenecks, and can greatly enhance one's understanding of memory utilization within a system.

The mm toolset includes:
- page_owner_sort: userspace helper to sort the output of /sys/kernel/debug/page_owner, which helps to know who allocates the page from kernel context
- slabinfo: the tool which gets reports about slabs, for example show empty slabs, modify of slab debug options at runtime, display all information about a slabcache
- page-types: a handy tool for querying page flags

Quoted 2 lines

I've applied, after making a few changes:

- don't depend on linux, already a patch dependency
- don't set CC: default is based on CROSS_COMPILE
- no need to fully recheck at install time
- move the option for alphabetical ordering
- fix check-package

See below for a few more omments...

Quoted 21 lines
---
 package/linux-tools/Config.in           | 18 +++++++++++
 package/linux-tools/linux-tool-mm.mk.in | 41 +++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 package/linux-tools/linux-tool-mm.mk.in
package/linux-tools/Config.in +7 -0
index 8a0b6d5802cc..ede966ec792d 100644
@@ -185,4 +185,22 @@ config BR2_PACKAGE_LINUX_TOOLS_HV_VSS_DAEMON
 
 endif # BR2_PACKAGE_LINUX_TOOLS_HV
 
+config BR2_PACKAGE_LINUX_TOOLS_MM
+	bool "mm"
+	select BR2_PACKAGE_LINUX_TOOLS
+	help
+	  mm is a toolset for testing/monitoring/tracing vm/pages/slabs objects.
+
+	  - page_owner_sort: userspace helper to sort the output of

package/linux-tools/Config.in config BR2_PACKAGE_LINUX_TOOLS_HV_VSS_DAEMON · line 204

Quoted 10 lines
package/linux-tools/Config.in +10 -0
+	  /sys/kernel/debug/page_owner, which helps to know who allocates
+	  the page from kernel context
+
+	  - slabinfo: the tool which gets reports about slabs, for example
+	  show empty slabs, modify of slab debug options at runtime, display
+	  all information about a slabcache
+
+	  - page-types: a handy tool for querying page flags
+
+	  These tools are available only from kernel version 3.4.
    $ ./utils/docker-run make check-package
    package/linux-tools/Config.in:244: help text: <tab><2 spaces><62 chars> (http://nightly.buildroot.org/#writing-rules-config-in)
    package/linux-tools/Config.in:247: help text: <tab><2 spaces><62 chars> (http://nightly.buildroot.org/#writing-rules-config-in)
    package/linux-tools/Config.in:250: help text: <tab><2 spaces><62 chars> (http://nightly.buildroot.org/#writing-rules-config-in)
    package/linux-tools/Config.in:251: help text: <tab><2 spaces><62 chars> (http://nightly.buildroot.org/#writing-rules-config-in)
Quoted 7 lines
package/linux-tools/Config.in +0 -0
 endmenu
package/linux-tools/linux-tool-mm.mk.in new file +0 -0
new file mode 100644
index 000000000000..5431e0574b04

package/linux-tools/linux-tool-mm.mk.in line 9

Quoted 9 lines
package/linux-tools/linux-tool-mm.mk.in new file +9 -0
@@ -0,0 +1,41 @@
+################################################################################
+#
+# mm
+#
+################################################################################
+
+LINUX_TOOLS += mm
+
+MM_DEPENDENCIES = linux

No need to add an explicit dependency: the linux-tools micro-infra already handles it in a generic way; indeed, there is no reason for each individual linux-tool to add a dependency on linux: they all have that dependency.

package/linux-tools/linux-tool-mm.mk.in line 10

Quoted 1 line
package/linux-tools/linux-tool-mm.mk.in new file +1 -0
+MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)"

No need to explicitly set CC: the kernel Makefile sets it based on CROSS_COMPILE already.

Quoted 14 lines
package/linux-tools/linux-tool-mm.mk.in new file +14 -0
+define MM_BUILD_CMDS
+	$(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \
+		MM_SUBDIR=vm; \
+	elif test -f $(LINUX_DIR)/tools/mm/Makefile ; then \
+		MM_SUBDIR=mm; \
+	else \
+		echo "Your kernel version is too old and does not have the mm tool." ; \
+		echo "At least kernel 3.4 must be used." ; \
+		exit 1 ; \
+	fi ; \
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+		$(MM_MAKE_OPTS) $${MM_SUBDIR}
+endef
+

package/linux-tools/linux-tool-mm.mk.in line 35

Quoted 10 lines
package/linux-tools/linux-tool-mm.mk.in new file +10 -0
+define MM_INSTALL_TARGET_CMDS
+	$(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \
+		MM_SUBDIR=vm; \
+	elif test -f $(LINUX_DIR)/tools/mm/Makefile ; then \
+		MM_SUBDIR=mm; \
+	else \
+		echo "Your kernel version is too old and does not have the mm tool." ; \
+		echo "At least kernel 3.4 must be used." ; \
+		exit 1 ; \
+	fi ; \

For install, we do need to know which directory to use, indeed, but we already do know one exists, as it was used at build, above; so we do not need the error case. I've simplified this part and added a comment to explain it.

Applied to master with those changes, thanks.

Regards,
Yann E. MORIN.

Quoted 9 lines
package/linux-tools/linux-tool-mm.mk.in new file +6 -0
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+		$(MM_MAKE_OPTS) \
+		INSTALL_ROOT=$(TARGET_DIR) \
+		DESTDIR=$(TARGET_DIR) \
+		$${MM_SUBDIR}_install
+endef
Signature · 1 line
2.43.0
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Hello Yann,

Thank you for such a quick response!

Quoted 60 lines · Yann E. MORIN

Dmitry, All,

On 2024-02-06 22:25 +0300, Dmitry Rokosov spake thusly:

Quoted 15 lines

This toolset was designed to facilitate the testing, monitoring, and tracing of various things with virtual memory, pages, and slab objects. It is an invaluable resource for identifying and analyzing memory-related issues, such as leaks and bottlenecks, and can greatly enhance one's understanding of memory utilization within a system.

The mm toolset includes:
- page_owner_sort: userspace helper to sort the output of /sys/kernel/debug/page_owner, which helps to know who allocates the page from kernel context
- slabinfo: the tool which gets reports about slabs, for example show empty slabs, modify of slab debug options at runtime, display all information about a slabcache
- page-types: a handy tool for querying page flags

Quoted 2 lines

I've applied, after making a few changes:

- don't depend on linux, already a patch dependency
- don't set CC: default is based on CROSS_COMPILE
- no need to fully recheck at install time
- move the option for alphabetical ordering
- fix check-package

See below for a few more omments...

Quoted 29 lines
---
 package/linux-tools/Config.in           | 18 +++++++++++
 package/linux-tools/linux-tool-mm.mk.in | 41 +++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 package/linux-tools/linux-tool-mm.mk.in
package/linux-tools/Config.in +15 -0
index 8a0b6d5802cc..ede966ec792d 100644
@@ -185,4 +185,22 @@ config BR2_PACKAGE_LINUX_TOOLS_HV_VSS_DAEMON
 
 endif # BR2_PACKAGE_LINUX_TOOLS_HV
 
+config BR2_PACKAGE_LINUX_TOOLS_MM
+	bool "mm"
+	select BR2_PACKAGE_LINUX_TOOLS
+	help
+	  mm is a toolset for testing/monitoring/tracing vm/pages/slabs objects.
+
+	  - page_owner_sort: userspace helper to sort the output of
+	  /sys/kernel/debug/page_owner, which helps to know who allocates
+	  the page from kernel context
+
+	  - slabinfo: the tool which gets reports about slabs, for example
+	  show empty slabs, modify of slab debug options at runtime, display
+	  all information about a slabcache
+
+	  - page-types: a handy tool for querying page flags
Quoted 9 lines

package/linux-tools/Config.in config BR2_PACKAGE_LINUX_TOOLS_HV_VSS_DAEMON · line 204

Quoted 2 lines
package/linux-tools/Config.in +2 -0
+
+	  These tools are available only from kernel version 3.4.
    $ ./utils/docker-run make check-package
    package/linux-tools/Config.in:244: help text: <tab><2 spaces><62 chars> (http://nightly.buildroot.org/#writing-rules-config-in)
    package/linux-tools/Config.in:247: help text: <tab><2 spaces><62 chars> (http://nightly.buildroot.org/#writing-rules-config-in)
    package/linux-tools/Config.in:250: help text: <tab><2 spaces><62 chars> (http://nightly.buildroot.org/#writing-rules-config-in)
    package/linux-tools/Config.in:251: help text: <tab><2 spaces><62 chars> (http://nightly.buildroot.org/#writing-rules-config-in)

I will run check-package for the next contribution. Thank you very much for fixing the coding style problems.

Quoted 13 lines
Quoted 13 lines
package/linux-tools/Config.in +0 -0
 endmenu
package/linux-tools/linux-tool-mm.mk.in new file +6 -0
new file mode 100644
index 000000000000..5431e0574b04
@@ -0,0 +1,41 @@
+################################################################################
+#
+# mm
+#
+################################################################################
+
Quoted 9 lines

package/linux-tools/linux-tool-mm.mk.in line 9

Quoted 3 lines
package/linux-tools/linux-tool-mm.mk.in new file +3 -0
+LINUX_TOOLS += mm
+
+MM_DEPENDENCIES = linux

No need to add an explicit dependency: the linux-tools micro-infra already handles it in a generic way; indeed, there is no reason for each individual linux-tool to add a dependency on linux: they all have that dependency.

Yep, you are totally right. It was needed for LINUX_VERSION_PROBED variable. Without this dependency we couldn't get LINUX_VERSION_PROBED environment value.

Quoted 5 lines

package/linux-tools/linux-tool-mm.mk.in line 10

Quoted 1 line
package/linux-tools/linux-tool-mm.mk.in new file +1 -0
+MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)"

No need to explicitly set CC: the kernel Makefile sets it based on CROSS_COMPILE already.

Hmmmm, very strange. AFAIR, withoug explicit CC I can't build linux-tools-mm with cross compilation. I will check the final merged patchset and back to the thread if any.

Quoted 30 lines
Quoted 14 lines
package/linux-tools/linux-tool-mm.mk.in new file +14 -0
+define MM_BUILD_CMDS
+	$(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \
+		MM_SUBDIR=vm; \
+	elif test -f $(LINUX_DIR)/tools/mm/Makefile ; then \
+		MM_SUBDIR=mm; \
+	else \
+		echo "Your kernel version is too old and does not have the mm tool." ; \
+		echo "At least kernel 3.4 must be used." ; \
+		exit 1 ; \
+	fi ; \
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+		$(MM_MAKE_OPTS) $${MM_SUBDIR}
+endef
+

package/linux-tools/linux-tool-mm.mk.in line 35

Quoted 10 lines
package/linux-tools/linux-tool-mm.mk.in new file +10 -0
+define MM_INSTALL_TARGET_CMDS
+	$(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \
+		MM_SUBDIR=vm; \
+	elif test -f $(LINUX_DIR)/tools/mm/Makefile ; then \
+		MM_SUBDIR=mm; \
+	else \
+		echo "Your kernel version is too old and does not have the mm tool." ; \
+		echo "At least kernel 3.4 must be used." ; \
+		exit 1 ; \
+	fi ; \

For install, we do need to know which directory to use, indeed, but we already do know one exists, as it was used at build, above; so we do not need the error case. I've simplified this part and added a comment to explain it.

Quoted 1 line

Applied to master with those changes, thanks.

Okay, many thanks, appreciate it so much!

Quoted 17 lines
Quoted 9 lines
package/linux-tools/linux-tool-mm.mk.in new file +6 -0
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+		$(MM_MAKE_OPTS) \
+		INSTALL_ROOT=$(TARGET_DIR) \
+		DESTDIR=$(TARGET_DIR) \
+		$${MM_SUBDIR}_install
+endef
Signature · 1 line
2.43.0
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
Signature · 6 lines
Thank you,
Dmitry
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

PATCH v2 2/2 package/linux-tools: multilib build supported

In reply to Dmitry Rokosov via buildroot

From: Konstantin Menyaev <[email protected]>

- LINUX_TOOLS_MAKE_OPTS option introduced:
allows to override CROSS_COMPILE param

---
 package/linux-tools/linux-tool-gpio.mk.in      | 2 +-
 package/linux-tools/linux-tool-iio.mk.in       | 2 +-
 package/linux-tools/linux-tool-mm.mk.in        | 2 +-
 package/linux-tools/linux-tool-pci.mk.in       | 2 +-
 package/linux-tools/linux-tool-perf.mk.in      | 2 +-
 package/linux-tools/linux-tool-selftests.mk.in | 2 +-
 package/linux-tools/linux-tool-tmon.mk.in      | 2 +-
 package/linux-tools/linux-tools.mk             | 2 ++
 8 files changed, 9 insertions(+), 7 deletions(-)
package/linux-tools/linux-tool-gpio.mk.in +1 -1
index e825db1b1127..dcee11002e8c 100644
@@ -6,7 +6,7 @@
 
 LINUX_TOOLS += gpio
 
-GPIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
+GPIO_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) LDFLAGS="$(TARGET_LDFLAGS)"
 
 define GPIO_BUILD_CMDS
 	$(Q)if ! grep install $(LINUX_DIR)/tools/gpio/Makefile >/dev/null 2>&1 ; then \
package/linux-tools/linux-tool-iio.mk.in +1 -1
index 27ab0ed7ed63..1372faafd1a8 100644
@@ -6,7 +6,7 @@
 
 LINUX_TOOLS += iio
 
-IIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
+IIO_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) LDFLAGS="$(TARGET_LDFLAGS)"
 
 define IIO_BUILD_CMDS
 	$(Q)if ! grep install $(LINUX_DIR)/tools/iio/Makefile >/dev/null 2>&1 ; then \
package/linux-tools/linux-tool-mm.mk.in +1 -1
index 5431e0574b04..51a54026dea4 100644
@@ -7,7 +7,7 @@
 LINUX_TOOLS += mm
 
 MM_DEPENDENCIES = linux
-MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)"
+MM_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) CC="$(TARGET_CC)"
 
 define MM_BUILD_CMDS
 	$(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \
package/linux-tools/linux-tool-pci.mk.in +1 -1
index 17246f5d7ed2..48c3435a5c8a 100644
@@ -6,7 +6,7 @@
 
 LINUX_TOOLS += pci
 
-PCI_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
+PCI_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) LDFLAGS="$(TARGET_LDFLAGS)"
 
 define PCI_BUILD_CMDS
 	$(Q)if ! grep install $(LINUX_DIR)/tools/pci/Makefile >/dev/null 2>&1 ; then \
package/linux-tools/linux-tool-perf.mk.in +1 -1
index ee308a85dfd1..38910cda7d75 100644
@@ -19,7 +19,7 @@ PERF_ARCH=$(NORMALIZED_ARCH)
 endif
 
 PERF_MAKE_FLAGS = \
-	$(LINUX_MAKE_FLAGS) \
+	$(LINUX_TOOLS_MAKE_OPTS) \
 	JOBS=$(PARALLEL_JOBS) \
 	ARCH=$(PERF_ARCH) \
 	DESTDIR=$(TARGET_DIR) \
package/linux-tools/linux-tool-selftests.mk.in +1 -1
index e29c7f59debd..144dd6616f2b 100644
@@ -22,7 +22,7 @@ SELFTESTS_DEPENDENCIES = \
 	$(if $(BR2_PACKAGE_OPENSSL),openssl)
 
 SELFTESTS_MAKE_FLAGS = \
-	$(LINUX_MAKE_FLAGS) \
+	$(LINUX_TOOLS_MAKE_OPTS) \
 	ARCH=$(SELFTESTS_ARCH)
 
 # O must be redefined here to overwrite the one used by Buildroot for
package/linux-tools/linux-tool-tmon.mk.in +1 -1
index 56c328c51fd7..7c33915049c2 100644
@@ -7,7 +7,7 @@
 LINUX_TOOLS += tmon
 
 TMON_DEPENDENCIES = host-pkgconf ncurses
-TMON_MAKE_OPTS = $(LINUX_MAKE_FLAGS) \
+TMON_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) \
 	CC=$(TARGET_CC) \
 	LDFLAGS="$(TARGET_LDFLAGS)" \
 	PKG_CONFIG_PATH=$(STAGING_DIR)/usr/lib/pkgconfig
package/linux-tools/linux-tools.mk +2 -0
index 81b1fbc17605..38bb2c83966a 100644
@@ -26,6 +26,8 @@ LINUX_TOOLS_PATCH_DEPENDENCIES = linux
 # may install shared libraries and headers (e.g. cpupower).
 LINUX_TOOLS_INSTALL_STAGING = YES
 
+LINUX_TOOLS_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CROSS_COMPILE="$(TARGET_CROSS)"
+
 LINUX_TOOLS_DEPENDENCIES += $(foreach tool,$(LINUX_TOOLS),\
 	$(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
 		$($(call UPPERCASE,$(tool))_DEPENDENCIES)))
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Re: [Buildroot] [PATCH v2 2/2] package/linux-tools: multilib build supported

Dmitry, All,

On 2024-02-06 22:25 +0300, Dmitry Rokosov spake thusly:

Quoted 4 lines

From: Konstantin Menyaev <[email protected]>

- LINUX_TOOLS_MAKE_OPTS option introduced:
allows to override CROSS_COMPILE param

What is the rationale for this? How is it supposed to be used?

CROSS_COMPILE is already part of LINUX_MAKE_FLAGS, so there is no reason to pass it explicitly either.

Otherwise, I am not convinced anout the "multilib" title either, because Buildroot does not do multilib systems anyway, so I am missing the point of the patch...

If you feel there really is a nedd, please resubmit with an extended commit log. Thanks!

Regards,
Yann E. MORIN.

Quoted 120 lines
---
 package/linux-tools/linux-tool-gpio.mk.in      | 2 +-
 package/linux-tools/linux-tool-iio.mk.in       | 2 +-
 package/linux-tools/linux-tool-mm.mk.in        | 2 +-
 package/linux-tools/linux-tool-pci.mk.in       | 2 +-
 package/linux-tools/linux-tool-perf.mk.in      | 2 +-
 package/linux-tools/linux-tool-selftests.mk.in | 2 +-
 package/linux-tools/linux-tool-tmon.mk.in      | 2 +-
 package/linux-tools/linux-tools.mk             | 2 ++
 8 files changed, 9 insertions(+), 7 deletions(-)
package/linux-tools/linux-tool-gpio.mk.in +1 -1
index e825db1b1127..dcee11002e8c 100644
@@ -6,7 +6,7 @@
 
 LINUX_TOOLS += gpio
 
-GPIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
+GPIO_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) LDFLAGS="$(TARGET_LDFLAGS)"
 
 define GPIO_BUILD_CMDS
 	$(Q)if ! grep install $(LINUX_DIR)/tools/gpio/Makefile >/dev/null 2>&1 ; then \
package/linux-tools/linux-tool-iio.mk.in +1 -1
index 27ab0ed7ed63..1372faafd1a8 100644
@@ -6,7 +6,7 @@
 
 LINUX_TOOLS += iio
 
-IIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
+IIO_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) LDFLAGS="$(TARGET_LDFLAGS)"
 
 define IIO_BUILD_CMDS
 	$(Q)if ! grep install $(LINUX_DIR)/tools/iio/Makefile >/dev/null 2>&1 ; then \
package/linux-tools/linux-tool-mm.mk.in +1 -1
index 5431e0574b04..51a54026dea4 100644
@@ -7,7 +7,7 @@
 LINUX_TOOLS += mm
 
 MM_DEPENDENCIES = linux
-MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)"
+MM_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) CC="$(TARGET_CC)"
 
 define MM_BUILD_CMDS
 	$(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \
package/linux-tools/linux-tool-pci.mk.in +1 -1
index 17246f5d7ed2..48c3435a5c8a 100644
@@ -6,7 +6,7 @@
 
 LINUX_TOOLS += pci
 
-PCI_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
+PCI_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) LDFLAGS="$(TARGET_LDFLAGS)"
 
 define PCI_BUILD_CMDS
 	$(Q)if ! grep install $(LINUX_DIR)/tools/pci/Makefile >/dev/null 2>&1 ; then \
package/linux-tools/linux-tool-perf.mk.in +1 -1
index ee308a85dfd1..38910cda7d75 100644
@@ -19,7 +19,7 @@ PERF_ARCH=$(NORMALIZED_ARCH)
 endif
 
 PERF_MAKE_FLAGS = \
-	$(LINUX_MAKE_FLAGS) \
+	$(LINUX_TOOLS_MAKE_OPTS) \
 	JOBS=$(PARALLEL_JOBS) \
 	ARCH=$(PERF_ARCH) \
 	DESTDIR=$(TARGET_DIR) \
package/linux-tools/linux-tool-selftests.mk.in +1 -1
index e29c7f59debd..144dd6616f2b 100644
@@ -22,7 +22,7 @@ SELFTESTS_DEPENDENCIES = \
 	$(if $(BR2_PACKAGE_OPENSSL),openssl)
 
 SELFTESTS_MAKE_FLAGS = \
-	$(LINUX_MAKE_FLAGS) \
+	$(LINUX_TOOLS_MAKE_OPTS) \
 	ARCH=$(SELFTESTS_ARCH)
 
 # O must be redefined here to overwrite the one used by Buildroot for
package/linux-tools/linux-tool-tmon.mk.in +1 -1
index 56c328c51fd7..7c33915049c2 100644
@@ -7,7 +7,7 @@
 LINUX_TOOLS += tmon
 
 TMON_DEPENDENCIES = host-pkgconf ncurses
-TMON_MAKE_OPTS = $(LINUX_MAKE_FLAGS) \
+TMON_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) \
 	CC=$(TARGET_CC) \
 	LDFLAGS="$(TARGET_LDFLAGS)" \
 	PKG_CONFIG_PATH=$(STAGING_DIR)/usr/lib/pkgconfig
package/linux-tools/linux-tools.mk +2 -0
index 81b1fbc17605..38bb2c83966a 100644
@@ -26,6 +26,8 @@ LINUX_TOOLS_PATCH_DEPENDENCIES = linux
 # may install shared libraries and headers (e.g. cpupower).
 LINUX_TOOLS_INSTALL_STAGING = YES
 
+LINUX_TOOLS_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CROSS_COMPILE="$(TARGET_CROSS)"
+
 LINUX_TOOLS_DEPENDENCIES += $(foreach tool,$(LINUX_TOOLS),\
 	$(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
 		$($(call UPPERCASE,$(tool))_DEPENDENCIES)))
Signature · 1 line
2.43.0
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw

Re: [Buildroot] [PATCH v2 2/2] package/linux-tools: multilib build supported

Hello Yann,

Thank you very much for such a quick response!

Quoted 13 lines · Yann E. MORIN

Dmitry, All,

On 2024-02-06 22:25 +0300, Dmitry Rokosov spake thusly:

Quoted 4 lines

From: Konstantin Menyaev <[email protected]>

- LINUX_TOOLS_MAKE_OPTS option introduced:
allows to override CROSS_COMPILE param

What is the rationale for this? How is it supposed to be used?

CROSS_COMPILE is already part of LINUX_MAKE_FLAGS, so there is no reason to pass it explicitly either.

Quoted 6 lines

Otherwise, I am not convinced anout the "multilib" title either, because Buildroot does not do multilib systems anyway, so I am missing the point of the patch...

If you feel there really is a nedd, please resubmit with an extended commit log. Thanks!

Okay, we will try to describe it with extra comments and resubmit the patch in the separate email.

Quoted 132 lines

Regards,
Yann E. MORIN.

Quoted 120 lines
---
 package/linux-tools/linux-tool-gpio.mk.in      | 2 +-
 package/linux-tools/linux-tool-iio.mk.in       | 2 +-
 package/linux-tools/linux-tool-mm.mk.in        | 2 +-
 package/linux-tools/linux-tool-pci.mk.in       | 2 +-
 package/linux-tools/linux-tool-perf.mk.in      | 2 +-
 package/linux-tools/linux-tool-selftests.mk.in | 2 +-
 package/linux-tools/linux-tool-tmon.mk.in      | 2 +-
 package/linux-tools/linux-tools.mk             | 2 ++
 8 files changed, 9 insertions(+), 7 deletions(-)
package/linux-tools/linux-tool-gpio.mk.in +1 -1
index e825db1b1127..dcee11002e8c 100644
@@ -6,7 +6,7 @@
 
 LINUX_TOOLS += gpio
 
-GPIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
+GPIO_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) LDFLAGS="$(TARGET_LDFLAGS)"
 
 define GPIO_BUILD_CMDS
 	$(Q)if ! grep install $(LINUX_DIR)/tools/gpio/Makefile >/dev/null 2>&1 ; then \
package/linux-tools/linux-tool-iio.mk.in +1 -1
index 27ab0ed7ed63..1372faafd1a8 100644
@@ -6,7 +6,7 @@
 
 LINUX_TOOLS += iio
 
-IIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
+IIO_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) LDFLAGS="$(TARGET_LDFLAGS)"
 
 define IIO_BUILD_CMDS
 	$(Q)if ! grep install $(LINUX_DIR)/tools/iio/Makefile >/dev/null 2>&1 ; then \
package/linux-tools/linux-tool-mm.mk.in +1 -1
index 5431e0574b04..51a54026dea4 100644
@@ -7,7 +7,7 @@
 LINUX_TOOLS += mm
 
 MM_DEPENDENCIES = linux
-MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)"
+MM_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) CC="$(TARGET_CC)"
 
 define MM_BUILD_CMDS
 	$(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \
package/linux-tools/linux-tool-pci.mk.in +1 -1
index 17246f5d7ed2..48c3435a5c8a 100644
@@ -6,7 +6,7 @@
 
 LINUX_TOOLS += pci
 
-PCI_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
+PCI_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) LDFLAGS="$(TARGET_LDFLAGS)"
 
 define PCI_BUILD_CMDS
 	$(Q)if ! grep install $(LINUX_DIR)/tools/pci/Makefile >/dev/null 2>&1 ; then \
package/linux-tools/linux-tool-perf.mk.in +1 -1
index ee308a85dfd1..38910cda7d75 100644
@@ -19,7 +19,7 @@ PERF_ARCH=$(NORMALIZED_ARCH)
 endif
 
 PERF_MAKE_FLAGS = \
-	$(LINUX_MAKE_FLAGS) \
+	$(LINUX_TOOLS_MAKE_OPTS) \
 	JOBS=$(PARALLEL_JOBS) \
 	ARCH=$(PERF_ARCH) \
 	DESTDIR=$(TARGET_DIR) \
package/linux-tools/linux-tool-selftests.mk.in +1 -1
index e29c7f59debd..144dd6616f2b 100644
@@ -22,7 +22,7 @@ SELFTESTS_DEPENDENCIES = \
 	$(if $(BR2_PACKAGE_OPENSSL),openssl)
 
 SELFTESTS_MAKE_FLAGS = \
-	$(LINUX_MAKE_FLAGS) \
+	$(LINUX_TOOLS_MAKE_OPTS) \
 	ARCH=$(SELFTESTS_ARCH)
 
 # O must be redefined here to overwrite the one used by Buildroot for
package/linux-tools/linux-tool-tmon.mk.in +1 -1
index 56c328c51fd7..7c33915049c2 100644
@@ -7,7 +7,7 @@
 LINUX_TOOLS += tmon
 
 TMON_DEPENDENCIES = host-pkgconf ncurses
-TMON_MAKE_OPTS = $(LINUX_MAKE_FLAGS) \
+TMON_MAKE_OPTS = $(LINUX_TOOLS_MAKE_OPTS) \
 	CC=$(TARGET_CC) \
 	LDFLAGS="$(TARGET_LDFLAGS)" \
 	PKG_CONFIG_PATH=$(STAGING_DIR)/usr/lib/pkgconfig
package/linux-tools/linux-tools.mk +2 -0
index 81b1fbc17605..38bb2c83966a 100644
@@ -26,6 +26,8 @@ LINUX_TOOLS_PATCH_DEPENDENCIES = linux
 # may install shared libraries and headers (e.g. cpupower).
 LINUX_TOOLS_INSTALL_STAGING = YES
 
+LINUX_TOOLS_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CROSS_COMPILE="$(TARGET_CROSS)"
+
 LINUX_TOOLS_DEPENDENCIES += $(foreach tool,$(LINUX_TOOLS),\
 	$(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
 		$($(call UPPERCASE,$(tool))_DEPENDENCIES)))
Signature · 1 line
2.43.0
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
Signature · 6 lines
Thank you,
Dmitry
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot