* [Buildroot] [PATCH v1] package/linux-tools: introduce linux mm tools
@ 2023-06-09 11:34 Dmitry Rokosov via buildroot
2023-06-22 17:18 ` Dmitry Rokosov via buildroot
2023-07-23 9:14 ` Thomas Petazzoni via buildroot
0 siblings, 2 replies; 8+ messages in thread
From: Dmitry Rokosov via buildroot @ 2023-06-09 11:34 UTC (permalink / raw)
To: Thomas Petazzoni, Yann E . MORIN, Herve Codina
Cc: kernel, Dmitry Rokosov, sdfw_system_team, rockosov, buildroot
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@sberdevices.ru>
---
package/linux-tools/Config.in | 18 ++++++++
package/linux-tools/linux-tool-mm.mk.in | 59 +++++++++++++++++++++++++
2 files changed, 77 insertions(+)
create mode 100644 package/linux-tools/linux-tool-mm.mk.in
diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in
index 880ad08f0f1c..3ecc45574b82 100644
--- a/package/linux-tools/Config.in
+++ b/package/linux-tools/Config.in
@@ -171,4 +171,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
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 000000000000..a59f1c46ff97
--- /dev/null
+++ b/package/linux-tools/linux-tool-mm.mk.in
@@ -0,0 +1,59 @@
+################################################################################
+#
+# mm
+#
+################################################################################
+
+LINUX_TOOLS += mm
+
+MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)"
+
+KVER = $(shell echo $(LINUX_VERSION_PROBED))
+KVER_MAJOR = $(word 1,$(subst ., ,$(KVER)))
+KVER_MINOR = $(word 2,$(subst ., ,$(KVER)))
+
+# For the first time tools/vm was introduced in the 3.4 kernel version
+KVER_MAJOR_MIN = 3
+KVER_MINOR_MIN = 4
+
+# Starting from 6.3 kernel version mm tools are located at tools/mm folder
+# instead of tools/vm
+KVER_MAJOR_MM = 6
+KVER_MINOR_MM = 3
+
+define MM_BUILD_CMDS
+ $(Q)if [ $(KVER_MAJOR) -lt $(KVER_MAJOR_MIN) ] || \
+ [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MIN) -a \
+ $(KVER_MINOR) -lt $(KVER_MINOR_MIN) ]; then \
+ echo -n "Your kernel version $(KVER_MAJOR).$(KVER_MINOR) is "; \
+ echo "too old and doesn't have the mm tools." ; \
+ echo -n "At least $(KVER_MAJOR_MIN).$(KVER_MINOR_MIN) "; \
+ echo "kernel must be used." ; \
+ exit 1 ; \
+ fi
+
+ $(Q)if [ $(KVER_MAJOR) -gt $(KVER_MAJOR_MM) ] || \
+ [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MM) -a \
+ $(KVER_MINOR) -ge $(KVER_MINOR_MM) ]; then \
+ MM=mm; \
+ else \
+ MM=vm; \
+ fi; \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+ $(MM_MAKE_OPTS) $${MM}
+endef
+
+define MM_INSTALL_TARGET_CMDS
+ $(Q)if [ $(KVER_MAJOR) -gt $(KVER_MAJOR_MM) ] || \
+ [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MM) -a \
+ $(KVER_MINOR) -ge $(KVER_MINOR_MM) ]; then \
+ MM=mm; \
+ else \
+ MM=vm; \
+ fi; \
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+ $(MM_MAKE_OPTS) \
+ INSTALL_ROOT=$(TARGET_DIR) \
+ DESTDIR=$(TARGET_DIR) \
+ $${MM}_install
+endef
--
2.36.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [Buildroot] [PATCH v1] package/linux-tools: introduce linux mm tools 2023-06-09 11:34 [Buildroot] [PATCH v1] package/linux-tools: introduce linux mm tools Dmitry Rokosov via buildroot @ 2023-06-22 17:18 ` Dmitry Rokosov via buildroot 2023-06-26 12:12 ` Dmitry Rokosov via buildroot 2023-07-23 9:14 ` Thomas Petazzoni via buildroot 1 sibling, 1 reply; 8+ messages in thread From: Dmitry Rokosov via buildroot @ 2023-06-22 17:18 UTC (permalink / raw) To: Thomas Petazzoni, Yann E . MORIN, Herve Codina, Peter Korsgaard, buildroot Cc: kernel, rockosov, sdfw_system_team Hello, Add Peter Korsgaard and move "buildroot" mailing list from Cc. Could you please take a look at this patchset? I believe that linux-mm tools are helpful for investigating kernel memory distribution in embedded systems. On Fri, Jun 09, 2023 at 02:34:15PM +0300, Dmitry Rokosov wrote: > 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@sberdevices.ru> > --- > package/linux-tools/Config.in | 18 ++++++++ > package/linux-tools/linux-tool-mm.mk.in | 59 +++++++++++++++++++++++++ > 2 files changed, 77 insertions(+) > create mode 100644 package/linux-tools/linux-tool-mm.mk.in > > diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in > index 880ad08f0f1c..3ecc45574b82 100644 > --- a/package/linux-tools/Config.in > +++ b/package/linux-tools/Config.in > @@ -171,4 +171,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 > 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 000000000000..a59f1c46ff97 > --- /dev/null > +++ b/package/linux-tools/linux-tool-mm.mk.in > @@ -0,0 +1,59 @@ > +################################################################################ > +# > +# mm > +# > +################################################################################ > + > +LINUX_TOOLS += mm > + > +MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)" > + > +KVER = $(shell echo $(LINUX_VERSION_PROBED)) > +KVER_MAJOR = $(word 1,$(subst ., ,$(KVER))) > +KVER_MINOR = $(word 2,$(subst ., ,$(KVER))) > + > +# For the first time tools/vm was introduced in the 3.4 kernel version > +KVER_MAJOR_MIN = 3 > +KVER_MINOR_MIN = 4 > + > +# Starting from 6.3 kernel version mm tools are located at tools/mm folder > +# instead of tools/vm > +KVER_MAJOR_MM = 6 > +KVER_MINOR_MM = 3 > + > +define MM_BUILD_CMDS > + $(Q)if [ $(KVER_MAJOR) -lt $(KVER_MAJOR_MIN) ] || \ > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MIN) -a \ > + $(KVER_MINOR) -lt $(KVER_MINOR_MIN) ]; then \ > + echo -n "Your kernel version $(KVER_MAJOR).$(KVER_MINOR) is "; \ > + echo "too old and doesn't have the mm tools." ; \ > + echo -n "At least $(KVER_MAJOR_MIN).$(KVER_MINOR_MIN) "; \ > + echo "kernel must be used." ; \ > + exit 1 ; \ > + fi > + > + $(Q)if [ $(KVER_MAJOR) -gt $(KVER_MAJOR_MM) ] || \ > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MM) -a \ > + $(KVER_MINOR) -ge $(KVER_MINOR_MM) ]; then \ > + MM=mm; \ > + else \ > + MM=vm; \ > + fi; \ > + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \ > + $(MM_MAKE_OPTS) $${MM} > +endef > + > +define MM_INSTALL_TARGET_CMDS > + $(Q)if [ $(KVER_MAJOR) -gt $(KVER_MAJOR_MM) ] || \ > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MM) -a \ > + $(KVER_MINOR) -ge $(KVER_MINOR_MM) ]; then \ > + MM=mm; \ > + else \ > + MM=vm; \ > + fi; \ > + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \ > + $(MM_MAKE_OPTS) \ > + INSTALL_ROOT=$(TARGET_DIR) \ > + DESTDIR=$(TARGET_DIR) \ > + $${MM}_install > +endef > -- > 2.36.0 > -- Thank you, Dmitry _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH v1] package/linux-tools: introduce linux mm tools 2023-06-22 17:18 ` Dmitry Rokosov via buildroot @ 2023-06-26 12:12 ` Dmitry Rokosov via buildroot 2023-06-26 15:47 ` Yann E. MORIN 0 siblings, 1 reply; 8+ messages in thread From: Dmitry Rokosov via buildroot @ 2023-06-26 12:12 UTC (permalink / raw) To: Thomas Petazzoni, Yann E . MORIN, Herve Codina, Peter Korsgaard, buildroot, Arnout Vandecappelle Cc: kernel, rockosov, sdfw_system_team Hello Arnout, Please take a look into this patchset. I appreciate any feedback. On Thu, Jun 22, 2023 at 08:18:06PM +0300, Dmitry Rokosov wrote: > Hello, > > Add Peter Korsgaard and move "buildroot" mailing list from Cc. > > Could you please take a look at this patchset? I believe that linux-mm > tools are helpful for investigating kernel memory distribution in > embedded systems. > > On Fri, Jun 09, 2023 at 02:34:15PM +0300, Dmitry Rokosov wrote: > > 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@sberdevices.ru> > > --- > > package/linux-tools/Config.in | 18 ++++++++ > > package/linux-tools/linux-tool-mm.mk.in | 59 +++++++++++++++++++++++++ > > 2 files changed, 77 insertions(+) > > create mode 100644 package/linux-tools/linux-tool-mm.mk.in > > > > diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in > > index 880ad08f0f1c..3ecc45574b82 100644 > > --- a/package/linux-tools/Config.in > > +++ b/package/linux-tools/Config.in > > @@ -171,4 +171,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 > > 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 000000000000..a59f1c46ff97 > > --- /dev/null > > +++ b/package/linux-tools/linux-tool-mm.mk.in > > @@ -0,0 +1,59 @@ > > +################################################################################ > > +# > > +# mm > > +# > > +################################################################################ > > + > > +LINUX_TOOLS += mm > > + > > +MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)" > > + > > +KVER = $(shell echo $(LINUX_VERSION_PROBED)) > > +KVER_MAJOR = $(word 1,$(subst ., ,$(KVER))) > > +KVER_MINOR = $(word 2,$(subst ., ,$(KVER))) > > + > > +# For the first time tools/vm was introduced in the 3.4 kernel version > > +KVER_MAJOR_MIN = 3 > > +KVER_MINOR_MIN = 4 > > + > > +# Starting from 6.3 kernel version mm tools are located at tools/mm folder > > +# instead of tools/vm > > +KVER_MAJOR_MM = 6 > > +KVER_MINOR_MM = 3 > > + > > +define MM_BUILD_CMDS > > + $(Q)if [ $(KVER_MAJOR) -lt $(KVER_MAJOR_MIN) ] || \ > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MIN) -a \ > > + $(KVER_MINOR) -lt $(KVER_MINOR_MIN) ]; then \ > > + echo -n "Your kernel version $(KVER_MAJOR).$(KVER_MINOR) is "; \ > > + echo "too old and doesn't have the mm tools." ; \ > > + echo -n "At least $(KVER_MAJOR_MIN).$(KVER_MINOR_MIN) "; \ > > + echo "kernel must be used." ; \ > > + exit 1 ; \ > > + fi > > + > > + $(Q)if [ $(KVER_MAJOR) -gt $(KVER_MAJOR_MM) ] || \ > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MM) -a \ > > + $(KVER_MINOR) -ge $(KVER_MINOR_MM) ]; then \ > > + MM=mm; \ > > + else \ > > + MM=vm; \ > > + fi; \ > > + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \ > > + $(MM_MAKE_OPTS) $${MM} > > +endef > > + > > +define MM_INSTALL_TARGET_CMDS > > + $(Q)if [ $(KVER_MAJOR) -gt $(KVER_MAJOR_MM) ] || \ > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MM) -a \ > > + $(KVER_MINOR) -ge $(KVER_MINOR_MM) ]; then \ > > + MM=mm; \ > > + else \ > > + MM=vm; \ > > + fi; \ > > + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \ > > + $(MM_MAKE_OPTS) \ > > + INSTALL_ROOT=$(TARGET_DIR) \ > > + DESTDIR=$(TARGET_DIR) \ > > + $${MM}_install > > +endef > > -- > > 2.36.0 > > > > -- > Thank you, > Dmitry -- Thank you, Dmitry _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH v1] package/linux-tools: introduce linux mm tools 2023-06-26 12:12 ` Dmitry Rokosov via buildroot @ 2023-06-26 15:47 ` Yann E. MORIN 2023-06-27 10:24 ` Dmitry Rokosov via buildroot 0 siblings, 1 reply; 8+ messages in thread From: Yann E. MORIN @ 2023-06-26 15:47 UTC (permalink / raw) To: Dmitry Rokosov Cc: Herve Codina, sdfw_system_team, Thomas Petazzoni, buildroot, kernel, rockosov Dmitry, All, On 2023-06-26 15:12 +0300, Dmitry Rokosov spake thusly: > Please take a look into this patchset. I appreciate any feedback. Don't be impatient. Your patch has been pending for about two seeks now. We have 495 pending patches: https://patchwork.ozlabs.org/project/buildroot/list/ some of witch are so much older... Yes, I know it can be frustrating. For various reasons, we've been a bit less active than usual the past few months, but we'll eventually get to it... Regards, Yann E. MORIN. > On Thu, Jun 22, 2023 at 08:18:06PM +0300, Dmitry Rokosov wrote: > > Hello, > > > > Add Peter Korsgaard and move "buildroot" mailing list from Cc. > > > > Could you please take a look at this patchset? I believe that linux-mm > > tools are helpful for investigating kernel memory distribution in > > embedded systems. > > > > On Fri, Jun 09, 2023 at 02:34:15PM +0300, Dmitry Rokosov wrote: > > > 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@sberdevices.ru> > > > --- > > > package/linux-tools/Config.in | 18 ++++++++ > > > package/linux-tools/linux-tool-mm.mk.in | 59 +++++++++++++++++++++++++ > > > 2 files changed, 77 insertions(+) > > > create mode 100644 package/linux-tools/linux-tool-mm.mk.in > > > > > > diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in > > > index 880ad08f0f1c..3ecc45574b82 100644 > > > --- a/package/linux-tools/Config.in > > > +++ b/package/linux-tools/Config.in > > > @@ -171,4 +171,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 > > > 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 000000000000..a59f1c46ff97 > > > --- /dev/null > > > +++ b/package/linux-tools/linux-tool-mm.mk.in > > > @@ -0,0 +1,59 @@ > > > +################################################################################ > > > +# > > > +# mm > > > +# > > > +################################################################################ > > > + > > > +LINUX_TOOLS += mm > > > + > > > +MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)" > > > + > > > +KVER = $(shell echo $(LINUX_VERSION_PROBED)) > > > +KVER_MAJOR = $(word 1,$(subst ., ,$(KVER))) > > > +KVER_MINOR = $(word 2,$(subst ., ,$(KVER))) > > > + > > > +# For the first time tools/vm was introduced in the 3.4 kernel version > > > +KVER_MAJOR_MIN = 3 > > > +KVER_MINOR_MIN = 4 > > > + > > > +# Starting from 6.3 kernel version mm tools are located at tools/mm folder > > > +# instead of tools/vm > > > +KVER_MAJOR_MM = 6 > > > +KVER_MINOR_MM = 3 > > > + > > > +define MM_BUILD_CMDS > > > + $(Q)if [ $(KVER_MAJOR) -lt $(KVER_MAJOR_MIN) ] || \ > > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MIN) -a \ > > > + $(KVER_MINOR) -lt $(KVER_MINOR_MIN) ]; then \ > > > + echo -n "Your kernel version $(KVER_MAJOR).$(KVER_MINOR) is "; \ > > > + echo "too old and doesn't have the mm tools." ; \ > > > + echo -n "At least $(KVER_MAJOR_MIN).$(KVER_MINOR_MIN) "; \ > > > + echo "kernel must be used." ; \ > > > + exit 1 ; \ > > > + fi > > > + > > > + $(Q)if [ $(KVER_MAJOR) -gt $(KVER_MAJOR_MM) ] || \ > > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MM) -a \ > > > + $(KVER_MINOR) -ge $(KVER_MINOR_MM) ]; then \ > > > + MM=mm; \ > > > + else \ > > > + MM=vm; \ > > > + fi; \ > > > + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \ > > > + $(MM_MAKE_OPTS) $${MM} > > > +endef > > > + > > > +define MM_INSTALL_TARGET_CMDS > > > + $(Q)if [ $(KVER_MAJOR) -gt $(KVER_MAJOR_MM) ] || \ > > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MM) -a \ > > > + $(KVER_MINOR) -ge $(KVER_MINOR_MM) ]; then \ > > > + MM=mm; \ > > > + else \ > > > + MM=vm; \ > > > + fi; \ > > > + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \ > > > + $(MM_MAKE_OPTS) \ > > > + INSTALL_ROOT=$(TARGET_DIR) \ > > > + DESTDIR=$(TARGET_DIR) \ > > > + $${MM}_install > > > +endef > > > -- > > > 2.36.0 > > > > > > > -- > > Thank you, > > Dmitry > > -- > Thank you, > Dmitry -- .-----------------.--------------------.------------------.--------------------. | 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 buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH v1] package/linux-tools: introduce linux mm tools 2023-06-26 15:47 ` Yann E. MORIN @ 2023-06-27 10:24 ` Dmitry Rokosov via buildroot [not found] ` <m25xz16e14.fsf@ja.int.chopps.org> 0 siblings, 1 reply; 8+ messages in thread From: Dmitry Rokosov via buildroot @ 2023-06-27 10:24 UTC (permalink / raw) To: Yann E. MORIN Cc: Herve Codina, sdfw_system_team, Thomas Petazzoni, buildroot, kernel, rockosov Hello Yann, On Mon, Jun 26, 2023 at 05:47:19PM +0200, Yann E. MORIN wrote: > Dmitry, All, > > On 2023-06-26 15:12 +0300, Dmitry Rokosov spake thusly: > > Please take a look into this patchset. I appreciate any feedback. > > Don't be impatient. Your patch has been pending for about two seeks now. > We have 495 pending patches: https://patchwork.ozlabs.org/project/buildroot/list/ > some of witch are so much older... > > Yes, I know it can be frustrating. For various reasons, we've been a bit > less active than usual the past few months, but we'll eventually get to > it... > > Regards, > Yann E. MORIN. > Thank you so much for the detailed reply! I wasn't aware of the backlog, and I apologize for any misunderstanding caused by my eagerness. I fully understand the situation now, so please don't worry - I'm happy to wait my turn. Thank you for your hard work in maintaining buildroot! > > On Thu, Jun 22, 2023 at 08:18:06PM +0300, Dmitry Rokosov wrote: > > > Hello, > > > > > > Add Peter Korsgaard and move "buildroot" mailing list from Cc. > > > > > > Could you please take a look at this patchset? I believe that linux-mm > > > tools are helpful for investigating kernel memory distribution in > > > embedded systems. > > > > > > On Fri, Jun 09, 2023 at 02:34:15PM +0300, Dmitry Rokosov wrote: > > > > 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@sberdevices.ru> > > > > --- > > > > package/linux-tools/Config.in | 18 ++++++++ > > > > package/linux-tools/linux-tool-mm.mk.in | 59 +++++++++++++++++++++++++ > > > > 2 files changed, 77 insertions(+) > > > > create mode 100644 package/linux-tools/linux-tool-mm.mk.in > > > > > > > > diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in > > > > index 880ad08f0f1c..3ecc45574b82 100644 > > > > --- a/package/linux-tools/Config.in > > > > +++ b/package/linux-tools/Config.in > > > > @@ -171,4 +171,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 > > > > 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 000000000000..a59f1c46ff97 > > > > --- /dev/null > > > > +++ b/package/linux-tools/linux-tool-mm.mk.in > > > > @@ -0,0 +1,59 @@ > > > > +################################################################################ > > > > +# > > > > +# mm > > > > +# > > > > +################################################################################ > > > > + > > > > +LINUX_TOOLS += mm > > > > + > > > > +MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)" > > > > + > > > > +KVER = $(shell echo $(LINUX_VERSION_PROBED)) > > > > +KVER_MAJOR = $(word 1,$(subst ., ,$(KVER))) > > > > +KVER_MINOR = $(word 2,$(subst ., ,$(KVER))) > > > > + > > > > +# For the first time tools/vm was introduced in the 3.4 kernel version > > > > +KVER_MAJOR_MIN = 3 > > > > +KVER_MINOR_MIN = 4 > > > > + > > > > +# Starting from 6.3 kernel version mm tools are located at tools/mm folder > > > > +# instead of tools/vm > > > > +KVER_MAJOR_MM = 6 > > > > +KVER_MINOR_MM = 3 > > > > + > > > > +define MM_BUILD_CMDS > > > > + $(Q)if [ $(KVER_MAJOR) -lt $(KVER_MAJOR_MIN) ] || \ > > > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MIN) -a \ > > > > + $(KVER_MINOR) -lt $(KVER_MINOR_MIN) ]; then \ > > > > + echo -n "Your kernel version $(KVER_MAJOR).$(KVER_MINOR) is "; \ > > > > + echo "too old and doesn't have the mm tools." ; \ > > > > + echo -n "At least $(KVER_MAJOR_MIN).$(KVER_MINOR_MIN) "; \ > > > > + echo "kernel must be used." ; \ > > > > + exit 1 ; \ > > > > + fi > > > > + > > > > + $(Q)if [ $(KVER_MAJOR) -gt $(KVER_MAJOR_MM) ] || \ > > > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MM) -a \ > > > > + $(KVER_MINOR) -ge $(KVER_MINOR_MM) ]; then \ > > > > + MM=mm; \ > > > > + else \ > > > > + MM=vm; \ > > > > + fi; \ > > > > + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \ > > > > + $(MM_MAKE_OPTS) $${MM} > > > > +endef > > > > + > > > > +define MM_INSTALL_TARGET_CMDS > > > > + $(Q)if [ $(KVER_MAJOR) -gt $(KVER_MAJOR_MM) ] || \ > > > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MM) -a \ > > > > + $(KVER_MINOR) -ge $(KVER_MINOR_MM) ]; then \ > > > > + MM=mm; \ > > > > + else \ > > > > + MM=vm; \ > > > > + fi; \ > > > > + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \ > > > > + $(MM_MAKE_OPTS) \ > > > > + INSTALL_ROOT=$(TARGET_DIR) \ > > > > + DESTDIR=$(TARGET_DIR) \ > > > > + $${MM}_install > > > > +endef > > > > -- > > > > 2.36.0 > > > > > > > > > > -- > > > Thank you, > > > Dmitry > > > > -- > > Thank you, > > Dmitry > > -- > .-----------------.--------------------.------------------.--------------------. > | 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. | > '------------------------------^-------^------------------^--------------------' -- Thank you, Dmitry _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <m25xz16e14.fsf@ja.int.chopps.org>]
[parent not found: <20240206115217.3r43du5b4wnt23a7@CAB-WSD-L081021>]
* Re: [Buildroot] [PATCH v1] package/linux-tools: introduce linux mm tools [not found] ` <20240206115217.3r43du5b4wnt23a7@CAB-WSD-L081021> @ 2024-02-06 19:47 ` Dmitry Rokosov via buildroot 0 siblings, 0 replies; 8+ messages in thread From: Dmitry Rokosov via buildroot @ 2024-02-06 19:47 UTC (permalink / raw) To: Christian Hopps Cc: rockosov, Herve Codina, buildroot, Thomas Petazzoni, sdfw_system_team, kernel, Dmitry Rokosov, Yann E. MORIN Hello Chris, I've sent v2 patch series, please take a look: https://lore.kernel.org/buildroot/20240206192543.7179-2-ddrokosov@salutedevices.com/ On Tue, Feb 06, 2024 at 02:52:17PM +0300, Dmitry Rokosov wrote: > Hello Chris, > > I had actually forgotten about this patch. Today, I will update it and > would appreciate it if you could review it. I will add you to the CC. > > On Tue, Feb 06, 2024 at 06:12:27AM -0500, Christian Hopps wrote: > > > > Hi Dmitry, et al., > > > > I locally modified this patch according to the suggestion and am using it successfully. Will you be resubmitting this patch, or could I resubmit it with the suggested changes? > > > > Thanks, > > Chris. > > > > Dmitry Rokosov via buildroot <buildroot@buildroot.org> writes: > > > > > Hello Yann, > > > > > > On Mon, Jun 26, 2023 at 05:47:19PM +0200, Yann E. MORIN wrote: > > > > Dmitry, All, > > > > > > > > On 2023-06-26 15:12 +0300, Dmitry Rokosov spake thusly: > > > > > Please take a look into this patchset. I appreciate any feedback. > > > > > > > > Don't be impatient. Your patch has been pending for about two seeks now. > > > > We have 495 pending patches: https://patchwork.ozlabs.org/project/buildroot/list/ > > > > some of witch are so much older... > > > > > > > > Yes, I know it can be frustrating. For various reasons, we've been a bit > > > > less active than usual the past few months, but we'll eventually get to > > > > it... > > > > > > > > Regards, > > > > Yann E. MORIN. > > > > > > > > > > Thank you so much for the detailed reply! I wasn't aware of the backlog, > > > and I apologize for any misunderstanding caused by my eagerness. I fully > > > understand the situation now, so please don't worry - I'm happy to wait > > > my turn. Thank you for your hard work in maintaining buildroot! > > > > > > > > On Thu, Jun 22, 2023 at 08:18:06PM +0300, Dmitry Rokosov wrote: > > > > > > Hello, > > > > > > > > > > > > Add Peter Korsgaard and move "buildroot" mailing list from Cc. > > > > > > > > > > > > Could you please take a look at this patchset? I believe that linux-mm > > > > > > tools are helpful for investigating kernel memory distribution in > > > > > > embedded systems. > > > > > > > > > > > > On Fri, Jun 09, 2023 at 02:34:15PM +0300, Dmitry Rokosov wrote: > > > > > > > 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@sberdevices.ru> > > > > > > > --- > > > > > > > package/linux-tools/Config.in | 18 ++++++++ > > > > > > > package/linux-tools/linux-tool-mm.mk.in | 59 +++++++++++++++++++++++++ > > > > > > > 2 files changed, 77 insertions(+) > > > > > > > create mode 100644 package/linux-tools/linux-tool-mm.mk.in > > > > > > > > > > > > > > diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in > > > > > > > index 880ad08f0f1c..3ecc45574b82 100644 > > > > > > > --- a/package/linux-tools/Config.in > > > > > > > +++ b/package/linux-tools/Config.in > > > > > > > @@ -171,4 +171,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 > > > > > > > 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 000000000000..a59f1c46ff97 > > > > > > > --- /dev/null > > > > > > > +++ b/package/linux-tools/linux-tool-mm.mk.in > > > > > > > @@ -0,0 +1,59 @@ > > > > > > > +################################################################################ > > > > > > > +# > > > > > > > +# mm > > > > > > > +# > > > > > > > +################################################################################ > > > > > > > + > > > > > > > +LINUX_TOOLS += mm > > > > > > > + > > > > > > > +MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)" > > > > > > > + > > > > > > > +KVER = $(shell echo $(LINUX_VERSION_PROBED)) > > > > > > > +KVER_MAJOR = $(word 1,$(subst ., ,$(KVER))) > > > > > > > +KVER_MINOR = $(word 2,$(subst ., ,$(KVER))) > > > > > > > + > > > > > > > +# For the first time tools/vm was introduced in the 3.4 kernel version > > > > > > > +KVER_MAJOR_MIN = 3 > > > > > > > +KVER_MINOR_MIN = 4 > > > > > > > + > > > > > > > +# Starting from 6.3 kernel version mm tools are located at tools/mm folder > > > > > > > +# instead of tools/vm > > > > > > > +KVER_MAJOR_MM = 6 > > > > > > > +KVER_MINOR_MM = 3 > > > > > > > + > > > > > > > +define MM_BUILD_CMDS > > > > > > > + $(Q)if [ $(KVER_MAJOR) -lt $(KVER_MAJOR_MIN) ] || \ > > > > > > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MIN) -a \ > > > > > > > + $(KVER_MINOR) -lt $(KVER_MINOR_MIN) ]; then \ > > > > > > > + echo -n "Your kernel version $(KVER_MAJOR).$(KVER_MINOR) is "; \ > > > > > > > + echo "too old and doesn't have the mm tools." ; \ > > > > > > > + echo -n "At least $(KVER_MAJOR_MIN).$(KVER_MINOR_MIN) "; \ > > > > > > > + echo "kernel must be used." ; \ > > > > > > > + exit 1 ; \ > > > > > > > + fi > > > > > > > + > > > > > > > + $(Q)if [ $(KVER_MAJOR) -gt $(KVER_MAJOR_MM) ] || \ > > > > > > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MM) -a \ > > > > > > > + $(KVER_MINOR) -ge $(KVER_MINOR_MM) ]; then \ > > > > > > > + MM=mm; \ > > > > > > > + else \ > > > > > > > + MM=vm; \ > > > > > > > + fi; \ > > > > > > > + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \ > > > > > > > + $(MM_MAKE_OPTS) $${MM} > > > > > > > +endef > > > > > > > + > > > > > > > +define MM_INSTALL_TARGET_CMDS > > > > > > > + $(Q)if [ $(KVER_MAJOR) -gt $(KVER_MAJOR_MM) ] || \ > > > > > > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MM) -a \ > > > > > > > + $(KVER_MINOR) -ge $(KVER_MINOR_MM) ]; then \ > > > > > > > + MM=mm; \ > > > > > > > + else \ > > > > > > > + MM=vm; \ > > > > > > > + fi; \ > > > > > > > + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \ > > > > > > > + $(MM_MAKE_OPTS) \ > > > > > > > + INSTALL_ROOT=$(TARGET_DIR) \ > > > > > > > + DESTDIR=$(TARGET_DIR) \ > > > > > > > + $${MM}_install > > > > > > > +endef > > > > > > > -- > > > > > > > 2.36.0 > > > > > > > > > > > > > > > > > > > -- > > > > > > Thank you, > > > > > > Dmitry > > > > > > > > > > -- > > > > > Thank you, > > > > > Dmitry > > > > > > > > -- > > > > .-----------------.--------------------.------------------.--------------------. > > > > | 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. | > > > > '------------------------------^-------^------------------^--------------------' > > > > -- > Thank you, > Dmitry -- Thank you, Dmitry _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH v1] package/linux-tools: introduce linux mm tools 2023-06-09 11:34 [Buildroot] [PATCH v1] package/linux-tools: introduce linux mm tools Dmitry Rokosov via buildroot 2023-06-22 17:18 ` Dmitry Rokosov via buildroot @ 2023-07-23 9:14 ` Thomas Petazzoni via buildroot 2023-07-24 11:03 ` Dmitry Rokosov via buildroot 1 sibling, 1 reply; 8+ messages in thread From: Thomas Petazzoni via buildroot @ 2023-07-23 9:14 UTC (permalink / raw) To: Dmitry Rokosov via buildroot Cc: rockosov, Herve Codina, sdfw_system_team, kernel, Dmitry Rokosov, Yann E . MORIN Hello Dmitry, On Fri, 9 Jun 2023 14:34:15 +0300 Dmitry Rokosov via buildroot <buildroot@buildroot.org> wrote: > 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@sberdevices.ru> Thanks for your patch, and sorry for the delay to get back to you with a review. > 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 000000000000..a59f1c46ff97 > --- /dev/null > +++ b/package/linux-tools/linux-tool-mm.mk.in > @@ -0,0 +1,59 @@ > +################################################################################ > +# > +# mm > +# > +################################################################################ > + > +LINUX_TOOLS += mm > + > +MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)" > + > +KVER = $(shell echo $(LINUX_VERSION_PROBED)) > +KVER_MAJOR = $(word 1,$(subst ., ,$(KVER))) > +KVER_MINOR = $(word 2,$(subst ., ,$(KVER))) All variables in a package must be prefixed with the package name. Indeed, all variables in Buildroot are global, so if you define KVER and another package defines KVER, they will conflict. > + > +# For the first time tools/vm was introduced in the 3.4 kernel version > +KVER_MAJOR_MIN = 3 > +KVER_MINOR_MIN = 4 > + > +# Starting from 6.3 kernel version mm tools are located at tools/mm folder > +# instead of tools/vm > +KVER_MAJOR_MM = 6 > +KVER_MINOR_MM = 3 > + > +define MM_BUILD_CMDS > + $(Q)if [ $(KVER_MAJOR) -lt $(KVER_MAJOR_MIN) ] || \ > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MIN) -a \ > + $(KVER_MINOR) -lt $(KVER_MINOR_MIN) ]; then \ > + echo -n "Your kernel version $(KVER_MAJOR).$(KVER_MINOR) is "; \ > + echo "too old and doesn't have the mm tools." ; \ > + echo -n "At least $(KVER_MAJOR_MIN).$(KVER_MINOR_MIN) "; \ > + echo "kernel must be used." ; \ > + exit 1 ; \ > + fi I think this is not the approach we should take here, because it's not the approach taken by the other makefiles in package/linux-tools/. Rather than testing the kernel version, we test the presence/absence of a Makefile. So something along the lines of: $(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \ MM_SUBDIR=vm elif test -f $(LINUX_DIR)/tools/mm/Makefile ; then \ MM_SUBDIR=m 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} or something along those lines. And of course, ditto for the install step. Could you rework your patch accordingly? Thanks a lot! Thomas -- Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH v1] package/linux-tools: introduce linux mm tools 2023-07-23 9:14 ` Thomas Petazzoni via buildroot @ 2023-07-24 11:03 ` Dmitry Rokosov via buildroot 0 siblings, 0 replies; 8+ messages in thread From: Dmitry Rokosov via buildroot @ 2023-07-24 11:03 UTC (permalink / raw) To: Thomas Petazzoni Cc: Herve Codina, Dmitry Rokosov via buildroot, sdfw_system_team, kernel, rockosov, Yann E . MORIN Hello Thomas, On Sun, Jul 23, 2023 at 11:14:49AM +0200, Thomas Petazzoni wrote: > Hello Dmitry, > > On Fri, 9 Jun 2023 14:34:15 +0300 > Dmitry Rokosov via buildroot <buildroot@buildroot.org> wrote: > > > 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@sberdevices.ru> > > Thanks for your patch, and sorry for the delay to get back to you with > a review. Many thanks for taking the time to review this patch series! Please don't worry about the delay, as I completely understand that you have a great deal of other review tasks to attend to. > > > > 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 000000000000..a59f1c46ff97 > > --- /dev/null > > +++ b/package/linux-tools/linux-tool-mm.mk.in > > @@ -0,0 +1,59 @@ > > +################################################################################ > > +# > > +# mm > > +# > > +################################################################################ > > + > > +LINUX_TOOLS += mm > > + > > +MM_MAKE_OPTS = $(LINUX_MAKE_FLAGS) CC="$(TARGET_CC)" > > + > > +KVER = $(shell echo $(LINUX_VERSION_PROBED)) > > +KVER_MAJOR = $(word 1,$(subst ., ,$(KVER))) > > +KVER_MINOR = $(word 2,$(subst ., ,$(KVER))) > > All variables in a package must be prefixed with the package name. > Indeed, all variables in Buildroot are global, so if you define KVER > and another package defines KVER, they will conflict. > > > + > > +# For the first time tools/vm was introduced in the 3.4 kernel version > > +KVER_MAJOR_MIN = 3 > > +KVER_MINOR_MIN = 4 > > + > > +# Starting from 6.3 kernel version mm tools are located at tools/mm folder > > +# instead of tools/vm > > +KVER_MAJOR_MM = 6 > > +KVER_MINOR_MM = 3 > > + > > +define MM_BUILD_CMDS > > + $(Q)if [ $(KVER_MAJOR) -lt $(KVER_MAJOR_MIN) ] || \ > > + [ $(KVER_MAJOR) -eq $(KVER_MAJOR_MIN) -a \ > > + $(KVER_MINOR) -lt $(KVER_MINOR_MIN) ]; then \ > > + echo -n "Your kernel version $(KVER_MAJOR).$(KVER_MINOR) is "; \ > > + echo "too old and doesn't have the mm tools." ; \ > > + echo -n "At least $(KVER_MAJOR_MIN).$(KVER_MINOR_MIN) "; \ > > + echo "kernel must be used." ; \ > > + exit 1 ; \ > > + fi > > I think this is not the approach we should take here, because it's not > the approach taken by the other makefiles in package/linux-tools/. > Rather than testing the kernel version, we test the presence/absence of > a Makefile. > > So something along the lines of: > > $(Q)if test -f $(LINUX_DIR)/tools/vm/Makefile ; then \ > MM_SUBDIR=vm > elif test -f $(LINUX_DIR)/tools/mm/Makefile ; then \ > MM_SUBDIR=m > 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} > > or something along those lines. And of course, ditto for the install > step. > > Could you rework your patch accordingly? Ah, okay. I had considered that approach but chose KVER testing instead. No problem, I will rework it in the next version. -- Thank you, Dmitry _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-02-06 19:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-09 11:34 [Buildroot] [PATCH v1] package/linux-tools: introduce linux mm tools Dmitry Rokosov via buildroot
2023-06-22 17:18 ` Dmitry Rokosov via buildroot
2023-06-26 12:12 ` Dmitry Rokosov via buildroot
2023-06-26 15:47 ` Yann E. MORIN
2023-06-27 10:24 ` Dmitry Rokosov via buildroot
[not found] ` <m25xz16e14.fsf@ja.int.chopps.org>
[not found] ` <20240206115217.3r43du5b4wnt23a7@CAB-WSD-L081021>
2024-02-06 19:47 ` Dmitry Rokosov via buildroot
2023-07-23 9:14 ` Thomas Petazzoni via buildroot
2023-07-24 11:03 ` Dmitry Rokosov via buildroot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox