diff options
author | Josh Poimboeuf <jpoimboe@redhat.com> | 2015-12-07 23:21:48 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-12-09 11:42:03 -0500 |
commit | 0a4bb5da957b83ece8b4723c5bac7a5d29fbfb33 (patch) | |
tree | 42b723883ba38f98c98b8a11a24948407a51bc78 /tools | |
parent | 2bdb2c2729d2ba2f2f90b729d04254308096c5a0 (diff) |
perf tools: Move cmd_version() to builtin-version.c
Move cmd_version() to its own file so that help.c can be moved to a
library.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/e908b1b68f20ab6d8d33941d5571c23110622e60.1449548395.git.jpoimboe@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/Build | 1 | ||||
-rw-r--r-- | tools/perf/builtin-version.c | 10 | ||||
-rw-r--r-- | tools/perf/util/help.c | 7 |
3 files changed, 11 insertions, 7 deletions
diff --git a/tools/perf/Build b/tools/perf/Build index 2c7aaf2ba119..2a41217e9d88 100644 --- a/tools/perf/Build +++ b/tools/perf/Build | |||
@@ -20,6 +20,7 @@ perf-y += builtin-kvm.o | |||
20 | perf-y += builtin-inject.o | 20 | perf-y += builtin-inject.o |
21 | perf-y += builtin-mem.o | 21 | perf-y += builtin-mem.o |
22 | perf-y += builtin-data.o | 22 | perf-y += builtin-data.o |
23 | perf-y += builtin-version.o | ||
23 | 24 | ||
24 | perf-$(CONFIG_AUDIT) += builtin-trace.o | 25 | perf-$(CONFIG_AUDIT) += builtin-trace.o |
25 | perf-$(CONFIG_LIBELF) += builtin-probe.o | 26 | perf-$(CONFIG_LIBELF) += builtin-probe.o |
diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c new file mode 100644 index 000000000000..9b10cda6b6dc --- /dev/null +++ b/tools/perf/builtin-version.c | |||
@@ -0,0 +1,10 @@ | |||
1 | #include "util/util.h" | ||
2 | #include "builtin.h" | ||
3 | #include "perf.h" | ||
4 | |||
5 | int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused, | ||
6 | const char *prefix __maybe_unused) | ||
7 | { | ||
8 | printf("perf version %s\n", perf_version_string); | ||
9 | return 0; | ||
10 | } | ||
diff --git a/tools/perf/util/help.c b/tools/perf/util/help.c index fa1fc4acb8a4..929c93f2c333 100644 --- a/tools/perf/util/help.c +++ b/tools/perf/util/help.c | |||
@@ -332,10 +332,3 @@ const char *help_unknown_cmd(const char *cmd) | |||
332 | 332 | ||
333 | exit(1); | 333 | exit(1); |
334 | } | 334 | } |
335 | |||
336 | int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused, | ||
337 | const char *prefix __maybe_unused) | ||
338 | { | ||
339 | printf("perf version %s\n", perf_version_string); | ||
340 | return 0; | ||
341 | } | ||