From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3173EA0547; Fri, 12 Mar 2021 19:17:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5677C1608DF; Fri, 12 Mar 2021 19:17:33 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id DEA651608DC for ; Fri, 12 Mar 2021 19:17:31 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 8C64E5C0198; Fri, 12 Mar 2021 13:17:31 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 12 Mar 2021 13:17:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=zFZQ/OVIs26CT S/5cSETH6uU4SwlQijreQHjhnc3KmM=; b=DXFLLiPDdb1+UK10YktZzAgXeUfHb JbkVQr9Un0sbYRhgrr7p+gvh17ScS528bvz+2tOzbcf3vwpZfrpGV/YPRH0Q8rhe lapSIsZVE+Ec4G5Gu5PZZ699zaMjfvx+qnYaaAF/TWaRU9nDkqVs7bAROhb1GWq3 xPUyreg3bV9OkHCfnCtSYy7kYh87P0WO2uGcmgv3nuoGrIiJ1ZxEZjzf5gKSEnR8 Jqf/IZCWaxL+NF6S0gJaM4bUKQRGi65L2xB3XeKI8cU0gGRNhN/9nuaqIM2rbuOk Sb4BRC54qS5rZI+r96EK+WkLGQMCXYMA0RNH5TxXEVJOPE3FtccwtBw7g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=zFZQ/OVIs26CTS/5cSETH6uU4SwlQijreQHjhnc3KmM=; b=LJTOZZVB F5+pxCVmoqvoL+FQkbPqTW6u7Q6305dWG9SRqt8pc8ic3nYBur+xYYBG90tSRvZ4 OQuiBVqy44p7RKyvQw0sLA7eg2jzcqpIC0koFDpKjyIt6FoKNdALr+kytcOga4hX w1yifFRmxNQCormpFkCZpizjlNH/hpPpUwRNELB5LbwLVpLy+zKTsvEqbI9cgUTc cvHEHUlXFvCmPXDZsm6KWWzkGwaAgkvKoGsOE34FKC3INB+GzX0sPc5FPjC6vFBp LpUnfWj6twOr1F/PhJOTFOR3UmRBhjy65Y3nLDgEruHAigmNmQS5HUN1eAqiCTQW WYw6j9Sj/6cZoA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddvvddguddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedt gfeutdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 6E5FB240054; Fri, 12 Mar 2021 13:17:30 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com, bruce.richardson@intel.com, mb@smartsharesystems.com, Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam Date: Fri, 12 Mar 2021 19:17:11 +0100 Message-Id: <20210312181720.242252-3-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312181720.242252-1-thomas@monjalon.net> References: <20210309233116.1934666-1-thomas@monjalon.net> <20210312181720.242252-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 02/11] eal: improve options usage text X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The description of the EAL options was printed before the application description provided via the hook. It is better to let the application print the global syntax and describes the detail of the EAL options below. Also, some useless lines are removed, and the alignment of few options is fixed. Signed-off-by: Thomas Monjalon --- lib/librte_eal/common/eal_common_options.c | 11 +++++------ lib/librte_eal/freebsd/eal.c | 8 ++++---- lib/librte_eal/linux/eal.c | 12 ++++++------ lib/librte_eal/windows/eal.c | 10 ++++------ 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 622c7bc429..0635b0d4ce 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -2022,8 +2022,7 @@ rte_vect_set_max_simd_bitwidth(uint16_t bitwidth) void eal_common_usage(void) { - printf("[options]\n\n" - "EAL common options:\n" + printf("EAL common options:\n" " -c COREMASK Hexadecimal bitmask of cores to run on\n" " -l CORELIST List of cores to run on\n" " The argument format is [-c2][,c3[-c4],...]\n" @@ -2053,7 +2052,7 @@ eal_common_usage(void) " --"OPT_VDEV" Add a virtual device.\n" " The argument format is [,key=val,...]\n" " (ex: --vdev=net_pcap0,iface=eth2).\n" - " --"OPT_IOVA_MODE" Set IOVA mode. 'pa' for IOVA_PA\n" + " --"OPT_IOVA_MODE" Set IOVA mode. 'pa' for IOVA_PA\n" " 'va' for IOVA_VA\n" " -d LIB.so|DIR Add a driver or driver directory\n" " (can be used multiple times)\n" @@ -2092,11 +2091,11 @@ eal_common_usage(void) #endif /* !RTE_EXEC_ENV_WINDOWS */ " -v Display version information on startup\n" " -h, --help This help\n" - " --"OPT_IN_MEMORY" Operate entirely in memory. This will\n" + " --"OPT_IN_MEMORY" Operate entirely in memory. This will\n" " disable secondary process support\n" " --"OPT_BASE_VIRTADDR" Base virtual address\n" - " --"OPT_TELEMETRY" Enable telemetry support (on by default)\n" - " --"OPT_NO_TELEMETRY" Disable telemetry support\n" + " --"OPT_TELEMETRY" Enable telemetry support (on by default)\n" + " --"OPT_NO_TELEMETRY" Disable telemetry support\n" " --"OPT_FORCE_MAX_SIMD_BITWIDTH" Force the max SIMD bitwidth\n" "\nEAL options for DEBUG use only:\n" " --"OPT_HUGE_UNLINK" Unlink hugepage files after init\n" diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c index afbbb1c523..f466616566 100644 --- a/lib/librte_eal/freebsd/eal.c +++ b/lib/librte_eal/freebsd/eal.c @@ -421,13 +421,13 @@ eal_usage(const char *prgname) { rte_usage_hook_t hook = eal_get_application_usage_hook(); - printf("\nUsage: %s ", prgname); - eal_common_usage(); - /* Allow the application to print its usage message too if hook is set */ if (hook) { - printf("===== Application Usage =====\n\n"); + /* Print application usage through EAL options parsing. */ (hook)(prgname); + printf("\n"); } + + eal_common_usage(); } static inline size_t diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c index bc966150a5..7c1d296192 100644 --- a/lib/librte_eal/linux/eal.c +++ b/lib/librte_eal/linux/eal.c @@ -534,7 +534,12 @@ eal_usage(const char *prgname) { rte_usage_hook_t hook = eal_get_application_usage_hook(); - printf("\nUsage: %s ", prgname); + if (hook) { + /* Print application usage through EAL options parsing. */ + (hook)(prgname); + printf("\n"); + } + eal_common_usage(); printf("EAL Linux options:\n" " --"OPT_SOCKET_MEM" Memory to allocate on sockets (comma separated values)\n" @@ -548,11 +553,6 @@ eal_usage(const char *prgname) " --"OPT_SINGLE_FILE_SEGMENTS" Put all hugepage memory in single files\n" " --"OPT_MATCH_ALLOCATIONS" Free hugepages exactly as allocated\n" "\n"); - /* Allow the application to print its usage message too if hook is set */ - if (hook) { - printf("===== Application Usage =====\n\n"); - (hook)(prgname); - } } static int diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c index 2fc3d6141c..ec13ac1a9f 100644 --- a/lib/librte_eal/windows/eal.c +++ b/lib/librte_eal/windows/eal.c @@ -79,15 +79,13 @@ eal_usage(const char *prgname) { rte_usage_hook_t hook = eal_get_application_usage_hook(); - printf("\nUsage: %s ", prgname); - eal_common_usage(); - /* Allow the application to print its usage message too - * if hook is set - */ if (hook) { - printf("===== Application Usage =====\n\n"); + /* Print application usage through EAL options parsing. */ (hook)(prgname); + printf("\n"); } + + eal_common_usage(); } /* Parse the arguments for --log-level only */ -- 2.30.1