Skip to content

Commit

Permalink
perf tools: Move cmd_version() to builtin-version.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Josh Poimboeuf authored and Arnaldo Carvalho de Melo committed Dec 9, 2015
1 parent 2bdb2c2 commit 0a4bb5d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions tools/perf/Build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions tools/perf/builtin-version.c
Original file line number Diff line number Diff line change
@@ -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;
}
7 changes: 0 additions & 7 deletions tools/perf/util/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 0a4bb5d

Please sign in to comment.