Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1287652

[PATCH 11/11] perf tools: Move cmd_version() to builtin-version.c

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 11/11] perf tools: Move cmd_version() to builtin-version.c
Date 2015-12-09 18:00 +0100
Message-ID <qDQfW-2uA-45@gated-at.bofh.it> (permalink)
References <qDQfU-2uA-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Josh Poimboeuf <jpoimboe@redhat.com>

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             |  1 +
 tools/perf/builtin-version.c | 10 ++++++++++
 tools/perf/util/help.c       |  7 -------
 3 files changed, 11 insertions(+), 7 deletions(-)
 create mode 100644 tools/perf/builtin-version.c

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
 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
index 000000000000..9b10cda6b6dc
--- /dev/null
+++ b/tools/perf/builtin-version.c
@@ -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;
+}
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)
 
 	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;
-}
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/11] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-09 18:00 +0100
  [PATCH 11/11] perf tools: Move cmd_version() to builtin-version.c Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-09 18:00 +0100
  [PATCH 10/11] perf tools: Save cmdline arguments earlier Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-09 18:00 +0100
  [PATCH 07/11] perf tools: Fix write_numa_topology to put cpu_map instead of free Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-12-09 18:00 +0100
  Re: [GIT PULL 00/11] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2015-12-10 09:20 +0100

csiph-web