lkml.org 
[lkml]   [2018]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf mem: Show perf mem report usage by -h option
Date
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
\
 
 \ /
  Last update: 2018-02-06 19:48    [W:0.026 / U:2.416 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site