From patchwork Mon Apr 10 16:25:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13206511 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 B024CC77B70 for ; Mon, 10 Apr 2023 16:26:38 +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=ImNSl1Scnw3EXU1Kvpqq5SBUf2KhXv82InUbsaX9l8I=; b=gQy0nglbcB+FiN jOXAG5f390ZlDk/smFpZCM7iu6Uqru/30fHd2ywMyQgrL5cwj0ZapZLatuOWHBQK5mpRvlH1jP8XT vUeV27NjmSh160bBsrH8D1Ob5XW3BMP/2SnZ5CTwJuKnaRX9VTIY+ESlnoI+LRlifKerQty+z2UUr SH9P7mQjft5NzYczhR+SON1Vfwk9iOp6hdAKQ3g0mrnhZdYm+j1gaS5h2kwTHEiUN+5Mzt3iMlQ28 kUM3EWzTO5TL0J6bg7I/wHDRN7eIG0tfHXTQktvuj67pyH40CCm2vE10aQl642EKuaA4qVIZs8t/d 1Pr/WUr5xMmObZcLqvoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pluL0-00FXRN-2Y; Mon, 10 Apr 2023 16:25:50 +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 1pluKx-00FXPE-11 for linux-arm-kernel@lists.infradead.org; Mon, 10 Apr 2023 16:25:49 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 67-20020a250146000000b00b714602d43fso6034619ybb.10 for ; Mon, 10 Apr 2023 09:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1681143946; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=ltJwrJcS5zG2bCT4+GplpXfeO819XnkFUs/Trn7Oeps=; b=JOp/+aX/o5synz6pDxP1umm3bEXkb7P1Ea8j436nJfKATGjPyb6qB2aOkLPNVNcvj8 2maWSZuv2uiKpFb44vh5H7Qa3XdxdXS6evU1KNkO8gHiiN/fE09plTF+YNcDOuI+rke9 EUy9Q09MqBdqt4sduXNh44rI9+/qLZvJvFNsWaoSlV7MMcn1FkfZzB8NZcmYA5CpJVCH 31nfPzq/cONcl4BeaPjxpoNAr+9KUK6doWTQa2HktlaYXIfxXQ72Y4JmmEPBbfJafHFx j5xD9AG7NErwtUBDfVxXQv3oWjThGlizVMKIiAxKKD9AaCAVmicJjq4hNOebUyNKYmtg dbhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681143946; 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=ltJwrJcS5zG2bCT4+GplpXfeO819XnkFUs/Trn7Oeps=; b=jOI2W5rIfZhqxUSXigzBc7XqGJGGC3l8s5qWAZVvgnriY3rSNtc3qmG6AQUA4whWgh N1a40Pz4vX6k3hZl5d9/V5qRuHIln9bdMWxz1KzObB3w+ZALREGs5T4FyvYlnTqFQToM Lcf0tUoheVk1Cy+R13dLZDv9/U+pmSOuhs4rUYvQXJFWxKk8h0btxg5elseQLK5LthNG Capl/b5SP7cmEwgcqqVmLJp0qSj7sFiAO8Z3iqh1vYDHfR5fb37kSqgBvDJs5nRf9Saf stAf87fjqaTQuZmXCdi/4hxfk92MoPwUvLWfbxBQ6IaG+5QRh1vtCQfFPxyjy5khePtu CpSQ== X-Gm-Message-State: AAQBX9c5JIA7oSjyPyw/ONhxTCd/n3ehdMt3Bq8QGFe7QxbpXhj2LP0X 905S3OmfJbFPuK2u13az6B8tjiFhB6os X-Google-Smtp-Source: AKy350brhH8r3zG3fNPseFmqcLKPZ39CearAHRvBHkmjMWzSvwbZzj45ONsmp2U3Z0wDblFv+5IYvENPp9aw X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:fc51:6a03:541d:a18d]) (user=irogers job=sendgmr) by 2002:a05:6902:909:b0:a27:3ecc:ffe7 with SMTP id bu9-20020a056902090900b00a273eccffe7mr9982639ybb.3.1681143945997; Mon, 10 Apr 2023 09:25:45 -0700 (PDT) Date: Mon, 10 Apr 2023 09:25:07 -0700 In-Reply-To: <20230410162511.3055900-1-irogers@google.com> Message-Id: <20230410162511.3055900-3-irogers@google.com> Mime-Version: 1.0 References: <20230410162511.3055900-1-irogers@google.com> X-Mailer: git-send-email 2.40.0.577.gac1e443424-goog Subject: [PATCH v2 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-20230410_092547_360757_15CABC92 X-CRM114-Status: GOOD ( 13.34 ) 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 The usage function is part of util.h, move the usage strings there too. 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);