diff options
Diffstat (limited to 'tools/perf/perf.c')
-rw-r--r-- | tools/perf/perf.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 95c58fc15284..eed3fb2a3af0 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c | |||
@@ -13,11 +13,12 @@ | |||
13 | #include "util/quote.h" | 13 | #include "util/quote.h" |
14 | #include "util/run-command.h" | 14 | #include "util/run-command.h" |
15 | #include "util/parse-events.h" | 15 | #include "util/parse-events.h" |
16 | #include "util/debug.h" | ||
16 | #include <api/fs/debugfs.h> | 17 | #include <api/fs/debugfs.h> |
17 | #include <pthread.h> | 18 | #include <pthread.h> |
18 | 19 | ||
19 | const char perf_usage_string[] = | 20 | const char perf_usage_string[] = |
20 | "perf [--version] [--help] COMMAND [ARGS]"; | 21 | "perf [--version] [--debug variable[=VALUE]] [--help] COMMAND [ARGS]"; |
21 | 22 | ||
22 | const char perf_more_info_string[] = | 23 | const char perf_more_info_string[] = |
23 | "See 'perf help COMMAND' for more information on a specific command."; | 24 | "See 'perf help COMMAND' for more information on a specific command."; |
@@ -212,6 +213,16 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) | |||
212 | printf("%s ", p->cmd); | 213 | printf("%s ", p->cmd); |
213 | } | 214 | } |
214 | exit(0); | 215 | exit(0); |
216 | } else if (!strcmp(cmd, "--debug")) { | ||
217 | if (*argc < 2) { | ||
218 | fprintf(stderr, "No variable specified for --debug.\n"); | ||
219 | usage(perf_usage_string); | ||
220 | } | ||
221 | if (perf_debug_option((*argv)[1])) | ||
222 | usage(perf_usage_string); | ||
223 | |||
224 | (*argv)++; | ||
225 | (*argc)--; | ||
215 | } else { | 226 | } else { |
216 | fprintf(stderr, "Unknown option: %s\n", cmd); | 227 | fprintf(stderr, "Unknown option: %s\n", cmd); |
217 | usage(perf_usage_string); | 228 | usage(perf_usage_string); |