perf tools: Move cmd_version() to builtin-version.c
authorJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 8 Dec 2015 04:21:48 +0000 (22:21 -0600)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 9 Dec 2015 16:42:03 +0000 (13:42 -0300)
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>
tools/perf/Build
tools/perf/builtin-version.c [new file with mode: 0644]
tools/perf/util/help.c

index 2c7aaf2ba11972d3f7459e5cfb1d774a5d12099d..2a41217e9d88633358a478cbe8b81f2484ee3b16 100644 (file)
@@ -20,6 +20,7 @@ perf-y += builtin-kvm.o
 perf-y += builtin-inject.o
 perf-y += builtin-mem.o
 perf-y += builtin-data.o
+perf-y += builtin-version.o
 
 perf-$(CONFIG_AUDIT) += builtin-trace.o
 perf-$(CONFIG_LIBELF) += builtin-probe.o
diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c
new file mode 100644 (file)
index 0000000..9b10cda
--- /dev/null
@@ -0,0 +1,10 @@
+#include "util/util.h"
+#include "builtin.h"
+#include "perf.h"
+
+int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused,
+               const char *prefix __maybe_unused)
+{
+       printf("perf version %s\n", perf_version_string);
+       return 0;
+}
index fa1fc4acb8a4768ea2d967ae12757ceec63557c5..929c93f2c333826eaf9a76be1057b22a324ab1e3 100644 (file)
@@ -332,10 +332,3 @@ const char *help_unknown_cmd(const char *cmd)
 
        exit(1);
 }
-
-int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused,
-               const char *prefix __maybe_unused)
-{
-       printf("perf version %s\n", perf_version_string);
-       return 0;
-}