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

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
[yann.morin.1998@free.fr:
  - 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
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
Dmitry Rokosov 2024-02-06 22:25:33 +03:00 committed by Yann E. MORIN
parent c0b5beea44
commit 39aaf091ae
2 changed files with 56 additions and 0 deletions
package/linux-tools

View File

@ -38,6 +38,25 @@ config BR2_PACKAGE_LINUX_TOOLS_IIO
These tools are available only from kernel version 4.7.
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.
config BR2_PACKAGE_LINUX_TOOLS_PCI
bool "pci"
select BR2_PACKAGE_LINUX_TOOLS

View File

@ -0,0 +1,37 @@
################################################################################
#
# mm
#
################################################################################
LINUX_TOOLS += mm
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) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR)/tools \
$(MM_MAKE_OPTS) $${MM_SUBDIR}
endef
# For install no need to recheck both cases: we know at least one
# exists, because that was checked at build time already; we just
# need to find which of the two: if not one, then the other.
define MM_INSTALL_TARGET_CMDS
$(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \
MM_SUBDIR=vm; \
else \
MM_SUBDIR=mm; \
fi ; \
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
$(LINUX_MAKE_FLAGS) \
INSTALL_ROOT=$(TARGET_DIR) \
DESTDIR=$(TARGET_DIR) \
$${MM_SUBDIR}_install
endef