From 0adea51ab2e6a0d9c8336673c7c07abb7a8b858a Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Mon, 10 Apr 2023 09:25:07 -0700 Subject: [PATCH] perf usage: Move usage strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The usage function is part of util.h, move the usage strings there too. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Athira Rajeev Cc: Chengdong Li Cc: Denis Nikitin Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Raul Silvera Cc: Ravi Bangoria Cc: Rob Herring Cc: Sean Christopherson Cc: Suzuki Poulouse Cc: Will Deacon Cc: Xing Zhengjun Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230410162511.3055900-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-help.c | 1 + tools/perf/builtin.h | 3 --- tools/perf/perf.c | 6 ------ tools/perf/util/usage.c | 6 ++++++ tools/perf/util/util.h | 3 +++ 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index 3976aebe3677..3e7f52054fac 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c @@ -14,6 +14,7 @@ #include #include #include "util/debug.h" +#include "util/util.h" #include #include #include diff --git a/tools/perf/builtin.h b/tools/perf/builtin.h index d03afea86217..f2ab5bae2150 100644 --- a/tools/perf/builtin.h +++ b/tools/perf/builtin.h @@ -2,9 +2,6 @@ #ifndef BUILTIN_H #define BUILTIN_H -extern const char perf_usage_string[]; -extern const char perf_more_info_string[]; - void list_common_cmds_help(void); const char *help_unknown_cmd(const char *cmd); diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 4b1b31e78332..997bb9ea5ebc 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -39,12 +39,6 @@ #include #include -const char perf_usage_string[] = - "perf [--version] [--help] [OPTIONS] COMMAND [ARGS]"; - -const char perf_more_info_string[] = - "See 'perf help COMMAND' for more information on a specific command."; - static int use_pager = -1; const char *input_name; diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c index 196438ee4c9d..4c8ffbad2323 100644 --- a/tools/perf/util/usage.c +++ b/tools/perf/util/usage.c @@ -12,6 +12,12 @@ #include #include +const char perf_usage_string[] = + "perf [--version] [--help] [OPTIONS] COMMAND [ARGS]"; + +const char perf_more_info_string[] = + "See 'perf help COMMAND' for more information on a specific command."; + static __noreturn void usage_builtin(const char *err) { fprintf(stderr, "\n Usage: %s\n", err); diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 1d3b300af5a1..5010abf9e01e 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -15,6 +15,9 @@ #include #endif +extern const char perf_usage_string[]; +extern const char perf_more_info_string[]; + /* General helper functions */ void usage(const char *err) __noreturn; void die(const char *err, ...) __noreturn __printf(1, 2);