Message ID | 20210321223116.1340974-1-thomas@monjalon.net (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5E00EA034F; Sun, 21 Mar 2021 23:31:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E22D940041; Sun, 21 Mar 2021 23:31:54 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id AB54B4003D for <dev@dpdk.org>; Sun, 21 Mar 2021 23:31:53 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 759C510EF; Sun, 21 Mar 2021 18:31:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 21 Mar 2021 18:31:52 -0400 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=sEjXOXCW2NQbu MYFJYRfrDOoptdVVU7roIUQziUPQzQ=; b=UoF5jaEye/zfScDbMCOyYpruiZOk7 ce7Cbz39KJtwN40BvXG9vtcIIdeImdKyQzrtVnMMNtV/AE/TW0u92+pclcOL23f6 TSxDOR8tyKpbcU787apWapZwip4L6MNiwso08mMcqNKWuTFyXYvB2jf73cmgUSkf xCtohEUYBQtCFwzig9FykXwW7FNSB66goh/KLubYwS7YkQE8N/a1KApDqy4Oi7fs vHxYlpNF47UcqB9dN5XC1fDpneSKZYLtSeErf/ZK+6ae8WQUGhv4xYs6CdAl6B9L GKeqUuoxVLw+uIhTweMH0kgOC57c71TVRlDIDjzI3noXWfIPssVW+Lsiw== 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=sEjXOXCW2NQbuMYFJYRfrDOoptdVVU7roIUQziUPQzQ=; b=wWy8tYGR YUF134iTHK0xchGZ3KhE9Q9aef5ew9hqCsWgdwwjUKGb1sh5bZvdzluy916q+4wM nPeKYy1BF+AbJ6VzrWp4vIEIu4sjsFBrf2H2SvVZx68X+sOeldSHafnKv4wcICHH K9fsWxq8CVvwmc8boGhvLVR5Q1j9rcvOKVd75fPw+Uplo95tGTiFjeOzxcrNh7r+ M2BlRvCAchYq3z4XDz2m/PAwTG3bD6G8RHWzzx3cDZglpymildPnL9qbddwW5kHf kHdivuC71L0lYuEsncHLvgznHZabLtRuU0IWWpv3PODvthd6Lp0RwF6DKH0vgGWu s8MCBzHzIJRsLg== X-ME-Sender: <xms:V8lXYNYPAz5QbQgPYIvY8CUwwyKXv7AKZ7_rdEfb-jOX1YXZGAS56w> <xme:V8lXYEYexpxD_OxZ3EfpQVKEG44AK1tmU_Xcl5MLiLxsuUMxzbA1slVff91BHwnAi AJLj2c9AmQt6e9Izg> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgudeivdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghs sehmohhnjhgrlhhonhdrnhgvtheqnecuggftrfgrthhtvghrnhepvdehgfeivdejgedtve ehfefhteelfefgieevgfffveefjeegtdfguedthedtgeevnecukfhppeejjedrudefgedr vddtfedrudekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: <xmx:V8lXYP8fdlOK6Z-ATjAFOXFf09iIni4-eE6CP06ejyojZeXlgnETwA> <xmx:V8lXYLolApCMWxg80qlSVWLMJD3i2qhL7D_0EdiCiEoIiXb4Oz5nCQ> <xmx:V8lXYIrwio4tf1cz4wQh94Wk-x1I6mfmQ2V1stEeaO0HlEuG0JV8cQ> <xmx:WMlXYOGTOYy62XkEL3ecLE0d_344ZQQcCNl7wzgDHVTJ9mGtvh1CbQ> Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 4626E2402E7; Sun, 21 Mar 2021 18:31:51 -0400 (EDT) From: Thomas Monjalon <thomas@monjalon.net> To: dev@dpdk.org Cc: david.marchand@redhat.com Date: Sun, 21 Mar 2021 23:31:04 +0100 Message-Id: <20210321223116.1340974-1-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210309233116.1934666-1-thomas@monjalon.net> References: <20210309233116.1934666-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 00/11] improve options help X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
improve options help
|
|
Message
Thomas Monjalon
March 21, 2021, 10:31 p.m. UTC
The main intent of this series is to provide a nice help for the --log-level option. More patches are added to improve options help in general. v4: - fix more misses in testpmd help - add some "Fixes:" lines v3: - fix use of RTE_LOG_MAX - accept (with warning) log level higher than RTE_LOG_MAX v2: - fix use of the new macro RTE_LOG_MAX in level parsing - improve parameters type and name while moving functions Thomas Monjalon (11): eal: explain argv behaviour during init eal: improve options usage text eal: use macros for help option eal: move private log functions eal: introduce maximum log level macro eal: catch invalid log level number eal: add log level help app: fix exit messages app: hook in EAL usage help app/regex: fix usage text app/testpmd: fix usage text app/pdump/main.c | 2 + app/proc-info/main.c | 2 + app/test-acl/main.c | 2 + app/test-bbdev/main.c | 3 +- app/test-compress-perf/comp_perf_options.h | 2 + .../comp_perf_options_parse.c | 10 +-- app/test-compress-perf/main.c | 3 +- app/test-crypto-perf/cperf_options.h | 2 + app/test-crypto-perf/cperf_options_parsing.c | 10 +-- app/test-crypto-perf/main.c | 3 +- app/test-fib/main.c | 8 ++ app/test-flow-perf/main.c | 63 ++++++++-------- app/test-pmd/parameters.c | 43 +++-------- app/test-pmd/testpmd.c | 2 + app/test-pmd/testpmd.h | 1 + app/test-regex/main.c | 10 +-- app/test-sad/main.c | 7 ++ lib/librte_eal/common/eal_common_log.c | 50 ++++++++----- lib/librte_eal/common/eal_common_options.c | 73 ++++++++++++------- lib/librte_eal/common/eal_log.h | 32 ++++++++ lib/librte_eal/common/eal_private.h | 29 -------- lib/librte_eal/freebsd/eal.c | 10 +-- lib/librte_eal/include/rte_eal.h | 2 + lib/librte_eal/include/rte_log.h | 12 +++ lib/librte_eal/linux/eal.c | 17 +++-- lib/librte_eal/linux/eal_log.c | 4 +- lib/librte_eal/version.map | 1 + lib/librte_eal/windows/eal.c | 15 ++-- lib/librte_eal/windows/eal_log.c | 6 +- 29 files changed, 247 insertions(+), 177 deletions(-) create mode 100644 lib/librte_eal/common/eal_log.h
Comments
On Sun, Mar 21, 2021 at 11:31 PM Thomas Monjalon <thomas@monjalon.net> wrote: > > The main intent of this series is to provide a nice help > for the --log-level option. The changes on usage() and the --log-level help are not related and could have been separated in two series. Like a series with: eal: use macros for help option eal: move private log functions eal: introduce maximum log level macro eal: catch invalid log level number eal: add log level help About these --log-level related patches, I am ok with them (with just a comment on sorting logtypes). Then a series with: eal: explain argv behaviour during init eal: improve options usage text app: fix exit messages app: hook in EAL usage help app/regex: fix usage text app/testpmd: fix usage text For the usage() patches, the main enhancement comes from hooking the app/ usage() to rte_set_application_usage_hook(). As for the "eal: improve options usage text" patch, there are two changes in behavior. Taking testpmd as an example: """ Usage: ./build/app/dpdk-testpmd [EAL options] -- [testpmd options] --interactive: run in interactive mode. --cmdline-file: execute cli commands before startup. --auto-start: start forwarding on init [always when non-interactive]. --help: display this message and quit. --tx-first: start forwarding sending a burst first (only if interactive is disabled). --stats-period=PERIOD: statistics will be shown every PERIOD seconds (only if interactive is disabled). [snip] --hairpin-mode=0xXX: bitmask set the hairpin port mode. 0x10 - explicit Tx rule, 0x02 - hairpin ports paired 0x01 - hairpin ports loop, 0x00 - hairpin port self EAL common options: -c COREMASK Hexadecimal bitmask of cores to run on -l CORELIST List of cores to run on The argument format is <c1>[-c2][,c3[-c4],...] where c1, c2, etc are core indexes between 0 and 128 --lcores COREMAP Map lcore set to physical cpu set The argument format is [snip] """ - The "Usage: " lists [EAL options] first, so I would expect them to be listed first. Hence I am not a fan of the reordering. - Testpmd options are not identified anymore while it was easier before to find out about it with the "===== Application Usage =====" banner. Applications now must add a banner to differentiate their options from the EAL ones.
24/03/2021 16:03, David Marchand: > The changes on usage() and the --log-level help are not related and > could have been separated in two series. Yes, I will split. It will help merging the non-controversial patches. > - The "Usage: " lists [EAL options] first, so I would expect them to > be listed first. > Hence I am not a fan of the reordering. If not reordering, we print the EAL options before giving the line "Usage: ..." with the generic syntax of the application. > - Testpmd options are not identified anymore while it was easier > before to find out about it with the "===== Application Usage =====" > banner. > Applications now must add a banner to differentiate their options from > the EAL ones. I think the banner "Application Usage" is strange when printing (sic) application usage. The EAL options are already clearly identified, so I though it was clear enough: EAL common options: [...] EAL options for DEBUG use only: [...] EAL Linux options: [...]