From patchwork Tue Mar 28 01:40:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13190285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E01D0C6FD1D for ; Tue, 28 Mar 2023 01:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1HgwpDVPMgPPKscNns3OwIouAkAV5+uTxxTfd53GQfc=; b=L040/9wwQf0WZO CHOFt0/z4CUMy8VVPlu+31pwvbJbLmM1RiKLMIyutolZ3BUZ9xDiXuCmqbQAe81TgBYaS9xxbBkGV 0ixVuHNR6NPUz4lRKWlRXSzP3QvVrTG100zTHJLuL9knuR00HhcAzVGttirr4mUIji1acEAwqGdHg HWqffHnd9q+Fvov2aMhpWhUOoADVXwkAW+6Z9RsKu6LrMoPLsu43tNLIdbh4OU21BrTVTX8CoDhGd Kd0U0TW8D9attYiy3wjlV4AyZME/hRxw0t3EiOs95wOa5k5Jpg6wfCjfzqs7AP4wObhg5ZesDGbcL rhBlr4KYgbSDqvVxJwyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgyL9-00CnSc-09; Tue, 28 Mar 2023 01:41:35 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgyL3-00CnRS-2r for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2023 01:41:31 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id m6-20020a056902118600b00aeb1e3dbd1bso10402293ybu.9 for ; Mon, 27 Mar 2023 18:41:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679967688; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=verDCOyK5Vg94wY3RYziaAnvJXO3pRUoQeewltL/GMo=; b=ndnM0GnxAOGbyZy68kGiLzbQMq4EeNAsxSUT51Bn6RMCvx2haDbE+mktB1A7n60kkf LutpwxHw8zyfU9PxO983Ja7NQcDetX6Z2aa9dt8IwGXI/HJ/9IOIu2Pvebk4pyfG815X xM0/qdH1XYOdZkC4QIeYFOVRFdSHjBVkrm7FxGI/JsU5Z971jcdx70WuEksPrOwW4mMQ u+R5U77kTBA3RtHekOgY8tlhG5HjoUmpbq4siVNJNUoekTQ2yEgcIsDWqxcr3+VaVMRl 2rR5mhMfyO7QsW304uMlWQ7pblkGURwaXaLW3G5XeMCXPOqvC/rAiRbxB/1tsEa4IJgG YdGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679967688; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=verDCOyK5Vg94wY3RYziaAnvJXO3pRUoQeewltL/GMo=; b=WdFhkVn9aMuuSpDSc2USu6wu0U4ahnEMAuftE+oKR84X5NsoiHVI2JLO4ccxryDYvv v+pH/aDfeNB1fLQPv0f3/fjhMEFU5k6m8UZkM/KD7yZKzd61UjrEuRIWQ776irXj4sOD vnetBQASY0PpqqLVd+anasnNJvVBN/sYZ/SLCt9gev0/DA/NWXNp7fO/egirr1i4jPdF zEeFfGavAGRzGwKOcn+FyV2uzLvbDp+SwwpNPcb2Y+LDLrnT4dVhepZ/VTUx1NuQytBB R/KT+NKa0HRxQMKstOXHHLdh9hIpImmDfu7/lX29dA+6AILtA/BMmDE4eNpVeaV3g7S8 WLWw== X-Gm-Message-State: AAQBX9dkmnRjrjuGUPLHH8Mp9dMl6NYZjekFdGFF/8EJjQAzXMfNvRAw F8sSwHXlJJfo+JIKM9GpOx8QZIyhs8hw X-Google-Smtp-Source: AKy350YwGBCHh+XFGIs5PnSfm8ziU1iAddLYb++rz17r47e/PoS0PBSTU4sb5sYQtlNpV7zfvdyxIqDVAcsK X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a544:20a5:5228:d98f]) (user=irogers job=sendgmr) by 2002:a81:ac13:0:b0:545:bade:c57e with SMTP id k19-20020a81ac13000000b00545badec57emr4179381ywh.5.1679967687965; Mon, 27 Mar 2023 18:41:27 -0700 (PDT) Date: Mon, 27 Mar 2023 18:40:54 -0700 In-Reply-To: <20230328014058.870413-1-irogers@google.com> Message-Id: <20230328014058.870413-3-irogers@google.com> Mime-Version: 1.0 References: <20230328014058.870413-1-irogers@google.com> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Subject: [PATCH v1 2/6] perf usage: Move usage strings From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Mathieu Poirier , Suzuki K Poulose , Kan Liang , Raul Silvera , Athira Rajeev , Ravi Bangoria , Florian Fischer , Rob Herring , Xing Zhengjun , Sean Christopherson , Chengdong Li , Denis Nikitin , " =?utf-8?q?Martin_Li=C5=A1ka?= " , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230327_184129_922271_D6DB4E66 X-CRM114-Status: GOOD ( 13.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This simplifies linking a main function when perf.c isn't present. Signed-off-by: Ian Rogers --- 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);