diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in index fb158f84d4..5a38f6dafe 100644 --- a/package/linux-tools/Config.in +++ b/package/linux-tools/Config.in @@ -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 diff --git a/package/linux-tools/linux-tool-mm.mk.in b/package/linux-tools/linux-tool-mm.mk.in new file mode 100644 index 0000000000..b2ec090fc0 --- /dev/null +++ b/package/linux-tools/linux-tool-mm.mk.in @@ -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