diff options
Diffstat (limited to 'tools/perf/builtin-mem.c')
-rw-r--r-- | tools/perf/builtin-mem.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index 2e3ade69a58e..4a1a6c94a5eb 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c | |||
@@ -21,11 +21,6 @@ struct perf_mem { | |||
21 | DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); | 21 | DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); |
22 | }; | 22 | }; |
23 | 23 | ||
24 | static const char * const mem_usage[] = { | ||
25 | "perf mem [<options>] {record <command> |report}", | ||
26 | NULL | ||
27 | }; | ||
28 | |||
29 | static int __cmd_record(int argc, const char **argv) | 24 | static int __cmd_record(int argc, const char **argv) |
30 | { | 25 | { |
31 | int rec_argc, i = 0, j; | 26 | int rec_argc, i = 0, j; |
@@ -220,9 +215,15 @@ int cmd_mem(int argc, const char **argv, const char *prefix __maybe_unused) | |||
220 | " between columns '.' is reserved."), | 215 | " between columns '.' is reserved."), |
221 | OPT_END() | 216 | OPT_END() |
222 | }; | 217 | }; |
218 | const char *const mem_subcommands[] = { "record", "report", NULL }; | ||
219 | const char *mem_usage[] = { | ||
220 | NULL, | ||
221 | NULL | ||
222 | }; | ||
223 | |||
223 | 224 | ||
224 | argc = parse_options(argc, argv, mem_options, mem_usage, | 225 | argc = parse_options_subcommand(argc, argv, mem_options, mem_subcommands, |
225 | PARSE_OPT_STOP_AT_NON_OPTION); | 226 | mem_usage, PARSE_OPT_STOP_AT_NON_OPTION); |
226 | 227 | ||
227 | if (!argc || !(strncmp(argv[0], "rec", 3) || mem_operation)) | 228 | if (!argc || !(strncmp(argv[0], "rec", 3) || mem_operation)) |
228 | usage_with_options(mem_usage, mem_options); | 229 | usage_with_options(mem_usage, mem_options); |