lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1517942847-40371-1-git-send-email-qpakzk@gmail.com>
Date:   Wed,  7 Feb 2018 03:47:27 +0900
From:   Sangwon Hong <qpakzk@...il.com>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Taeung Song <treeze.taeung@...il.com>,
        Sangwon Hong <qpakzk@...il.com>
Subject: [PATCH] perf mem: Show perf mem report usage by -h option

When typing 'perf mem report -h', the result showed 'perf report' usage.
So change to show 'perf mem report' usage.

Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Taeung Song <treeze.taeung@...il.com>
Signed-off-by: Sangwon Hong <qpakzk@...il.com>
---
 tools/perf/builtin-mem.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index 5065646..311fbed 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -314,6 +314,25 @@ static int report_events(int argc, const char **argv, struct perf_mem *mem)
 	return ret;
 }
 
+static int __cmd_report(int argc, const char **argv, struct perf_mem *mem)
+{
+	int argc2;
+	const char *mem_report_usage[] = {
+		"perf mem [<options>] report",
+		NULL
+	};
+	struct option options[] = {
+	OPT_END()
+	};
+
+	argc2 = parse_options(argc, argv, options, mem_report_usage,
+			     PARSE_OPT_STOP_AT_NON_OPTION);
+	if (argc2)
+		usage_with_options(mem_report_usage, options);
+
+	return report_events(argc, argv, mem);
+}
+
 struct mem_mode {
 	const char *name;
 	int mode;
@@ -451,7 +470,7 @@ int cmd_mem(int argc, const char **argv)
 	if (!strncmp(argv[0], "rec", 3))
 		return __cmd_record(argc, argv, &mem);
 	else if (!strncmp(argv[0], "rep", 3))
-		return report_events(argc, argv, &mem);
+		return __cmd_report(argc, argv, &mem);
 	else
 		usage_with_options(mem_usage, mem_options);
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ