Commit 54d11be6 authored by Audra Mitchell's avatar Audra Mitchell Committed by Jinjiang Tu
Browse files

tools/mm: update the usage output to be more organized

mainline inclusion
from mainline-v6.7-rc1
commit d8ea435f071592d82479414e97e3c70bed204666
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8XGY0
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d8ea435f071592d82479414e97e3c70bed204666

-------------------------------------------

Organize the usage options alphabetically and improve the description of
some options.  Also separate the more complicated cull options from the
single use compare options.

Link: https://lkml.kernel.org/r/20231013190350.579407-6-audra@redhat.com


Signed-off-by: default avatarAudra Mitchell <audra@redhat.com>
Acked-by: default avatarRafael Aquini <aquini@redhat.com>
Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
Cc: Georgi Djakov <djakov@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJinjiang Tu <tujinjiang@huawei.com>
parent e2e7475e
Loading
Loading
Loading
Loading
+20 −13
Original line number Original line Diff line number Diff line
@@ -634,19 +634,26 @@ static void print_allocator(FILE *out, int allocator)
static void usage(void)
static void usage(void)
{
{
	printf("Usage: ./page_owner_sort [OPTIONS] <input> <output>\n"
	printf("Usage: ./page_owner_sort [OPTIONS] <input> <output>\n"
		"-m\t\tSort by total memory.\n"
		"-a\t\t\tSort by memory allocation time.\n"
		"-s\t\tSort by the stack trace.\n"
		"-m\t\t\tSort by total memory.\n"
		"-t\t\tSort by times (default).\n"
		"-n\t\t\tSort by task command name.\n"
		"-p\t\tSort by pid.\n"
		"-p\t\t\tSort by pid.\n"
		"-P\t\tSort by tgid.\n"
		"-P\t\t\tSort by tgid.\n"
		"-n\t\tSort by task command name.\n"
		"-s\t\t\tSort by the stacktrace.\n"
		"-a\t\tSort by memory allocate time.\n"
		"-t\t\t\tSort by number of times record is seen (default).\n\n"
		"-d\t\tPrint debug information.\n"
		"--pid <pidlist>\t\tSelect by pid. This selects the information"
		"--pid <pidlist>\tSelect by pid. This selects the information of blocks whose process ID numbers appear in <pidlist>.\n"
		" of\n\t\t\tblocks whose process ID numbers appear in <pidlist>.\n"
		"--tgid <tgidlist>\tSelect by tgid. This selects the information of blocks whose Thread Group ID numbers appear in <tgidlist>.\n"
		"--tgid <tgidlist>\tSelect by tgid. This selects the information"
		"--name <cmdlist>\n\t\tSelect by command name. This selects the information of blocks whose command name appears in <cmdlist>.\n"
		" of\n\t\t\tblocks whose Thread Group ID numbers appear in "
		"--cull <rules>\tCull by user-defined rules.<rules> is a single argument in the form of a comma-separated list with some common fields predefined\n"
		"<tgidlist>.\n"
		"--sort <order>\tSpecify sort order as: [+|-]key[,[+|-]key[,...]]\n"
		"--name <cmdlist>\tSelect by command name. This selects the"
		" information\n\t\t\tof blocks whose command name appears in"
		" <cmdlist>.\n"
		"--cull <rules>\t\tCull by user-defined rules. <rules> is a "
		"single\n\t\t\targument in the form of a comma-separated list "
		"with some\n\t\t\tcommon fields predefined (pid, tgid, comm, "
		"stacktrace, allocator)\n"
		"--sort <order>\t\tSpecify sort order as: [+|-]key[,[+|-]key[,...]]\n"
	);
	);
}
}