diff options
-rw-r--r-- | tools/perf/Documentation/perf.txt | 8 | ||||
-rw-r--r-- | tools/perf/perf.c | 14 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tools/perf/Documentation/perf.txt b/tools/perf/Documentation/perf.txt index 2b131776363e..864e37597252 100644 --- a/tools/perf/Documentation/perf.txt +++ b/tools/perf/Documentation/perf.txt | |||
@@ -27,6 +27,14 @@ OPTIONS | |||
27 | Setup buildid cache directory. It has higher priority than | 27 | Setup buildid cache directory. It has higher priority than |
28 | buildid.dir config file option. | 28 | buildid.dir config file option. |
29 | 29 | ||
30 | -v:: | ||
31 | --version:: | ||
32 | Display perf version. | ||
33 | |||
34 | -h:: | ||
35 | --help:: | ||
36 | Run perf help command. | ||
37 | |||
30 | DESCRIPTION | 38 | DESCRIPTION |
31 | ----------- | 39 | ----------- |
32 | Performance counters for Linux are a new kernel-based subsystem | 40 | Performance counters for Linux are a new kernel-based subsystem |
diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 1fded922bcc8..543713422d14 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c | |||
@@ -162,6 +162,20 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) | |||
162 | break; | 162 | break; |
163 | 163 | ||
164 | /* | 164 | /* |
165 | * Shortcut for '-h' and '-v' options to invoke help | ||
166 | * and version command. | ||
167 | */ | ||
168 | if (!strcmp(cmd, "-h")) { | ||
169 | (*argv)[0] = "--help"; | ||
170 | break; | ||
171 | } | ||
172 | |||
173 | if (!strcmp(cmd, "-v")) { | ||
174 | (*argv)[0] = "--version"; | ||
175 | break; | ||
176 | } | ||
177 | |||
178 | /* | ||
165 | * Check remaining flags. | 179 | * Check remaining flags. |
166 | */ | 180 | */ |
167 | if (!prefixcmp(cmd, CMD_EXEC_PATH)) { | 181 | if (!prefixcmp(cmd, CMD_EXEC_PATH)) { |