diff --git a/tools/perf/Build b/tools/perf/Build index 2c7aaf2ba11972d3f7459e5cfb1d774a5d12099d..2a41217e9d88633358a478cbe8b81f2484ee3b16 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 0000000000000000000000000000000000000000..9b10cda6b6dcca3ef7ffedb95aec802851401464 --- /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 fa1fc4acb8a4768ea2d967ae12757ceec63557c5..929c93f2c333826eaf9a76be1057b22a324ab1e3 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; -}