kumquat-buildroot/package/linux-tools/linux-tool-mm.mk.in
Dmitry Rokosov 39aaf091ae 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>
2024-02-07 09:50:12 +01:00

38 lines
1.1 KiB
Makefile

################################################################################
#
# 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