mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sangwon Hong <qpakzk@gmail.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Taeung Song <treeze.taeung@gmail.com>,
	Sangwon Hong <qpakzk@gmail.com>
Subject: [PATCH] perf mem: Show perf mem report usage by -h option
Date: Wed,  7 Feb 2018 03:47:27 +0900	[thread overview]
Message-ID: <1517942847-40371-1-git-send-email-qpakzk@gmail.com> (raw)

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

Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Taeung Song <treeze.taeung@gmail.com>
Signed-off-by: Sangwon Hong <qpakzk@gmail.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

                 reply	other threads:[~2018-02-06 18:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517942847-40371-1-git-send-email-qpakzk@gmail.com \
    --to=qpakzk@gmail.com \
    --cc=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=treeze.taeung@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®