All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] tools/mm/page_owner_sort: fix --sort, add module filter, improve usage
@ 2026-08-19  2:16 Ye Liu
  2026-08-19  2:16 ` [PATCH v3 1/3] tools/mm/page_owner_sort: fix --sort option being silently ignored Ye Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ye Liu @ 2026-08-19  2:16 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Ye Liu, David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	Jonathan Corbet, Shuah Khan, linux-mm, linux-doc, linux-kernel

From: Ye Liu <liuye@kylinos.cn>

This series improves the page_owner_sort tool with a bug fix, a new
module-name feature, and better usage text.

Patch 1 fixes a long-standing bug where --sort was silently ignored
when used without a short option (-a, -m, -p, etc.).  The COMP_NO_FLAG
case fell through to COMP_NUM and overwrote the sort conditions
configured by parse_sort_args().

Patch 2 adds kernel module name support for sort, cull, and filter
operations.  Page owner stack traces already contain module names in
the "function+0xNN/0xNN [module]" format produced by %pS, but
page_owner_sort had no way to use them.  Records without module frames
are assigned "vmlinux".

  # Aggregate page usage per module
  ./page_owner_sort input.txt output.txt --cull=mod

  # Filter to records from xfs module only
  ./page_owner_sort input.txt output.txt --module xfs

  # Sort by module name, then by pid descending
  ./page_owner_sort input.txt output.txt --sort=mod,-pid

Patch 3 lists all available sort keys with abbreviations and examples
directly in the --sort help section so users no longer need to read
the source to discover valid keys.

Ye Liu (3):                                                            
  tools/mm/page_owner_sort: fix --sort option being silently ignored
  tools/mm/page_owner_sort: add module name sort/cull/filter support
  tools/mm/page_owner_sort: show available sort keys in usage text

 Documentation/mm/page_owner.rst |   8 +-
 tools/mm/page_owner_sort.c      | 134 +++++++++++++++++++++++++++-----
 2 files changed, 122 insertions(+), 20 deletions(-)
---
v3:
 - Patch 1: Use fallthrough to COMP_NUM per David's review.
 - Link:https://lore.kernel.org/all/20260803062056.1518070-1-ye.liu@linux.dev/
v2:
 - Patch 2: use regexec() directly in get_module() instead of search_pattern()
   to avoid excessive debug spam for the common vmlinux case when debug_on is true
 - Patch 2: anchor module regex to stack trace format "+0xNN/0xNN [module]" to
   prevent false matches on kernel thread comm names like [khugepaged]
 - Patch 2: add '-' to regex character class to support modules with hyphens
   (e.g. aa-bb-cc)
 - Link:https://lore.kernel.org/all/20260722023726.600200-1-ye.liu@linux.dev/
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-19  3:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19  2:16 [PATCH v3 0/3] tools/mm/page_owner_sort: fix --sort, add module filter, improve usage Ye Liu
2026-08-19  2:16 ` [PATCH v3 1/3] tools/mm/page_owner_sort: fix --sort option being silently ignored Ye Liu
2026-08-19  2:16 ` [PATCH v3 2/3] tools/mm/page_owner_sort: add module name sort/cull/filter support Ye Liu
2026-08-19  2:16 ` [PATCH v3 3/3] tools/mm/page_owner_sort: show available sort keys in usage text Ye Liu
2026-08-19  3:17 ` [PATCH v3 0/3] tools/mm/page_owner_sort: fix --sort, add module filter, improve usage Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.