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 7ED1EA00C2; Thu, 24 Nov 2022 01:54:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 237A342D82; Thu, 24 Nov 2022 01:54:40 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 66EB042C4D for ; Thu, 24 Nov 2022 01:54:38 +0100 (CET) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NHfdL6TjQzHw2q; Thu, 24 Nov 2022 08:53:58 +0800 (CST) Received: from [10.67.100.224] (10.67.100.224) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 24 Nov 2022 08:54:35 +0800 Subject: Re: [RFC PATCH 3/4] testpmd: add show lcores command To: Robin Jarry , CC: Bruce Richardson , Jerin Jacob , Kevin Laatz , Konstantin Ananyev , =?UTF-8?Q?Mattias_R=c3=b6nnblom?= , =?UTF-8?Q?Morten_Br=c3=b8rup?= References: <20221123101931.1688238-1-rjarry@redhat.com> <20221123101931.1688238-4-rjarry@redhat.com> From: fengchengwen Message-ID: Date: Thu, 24 Nov 2022 08:54:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20221123101931.1688238-4-rjarry@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.100.224] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected 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 Hi Robin, On 2022/11/23 18:19, Robin Jarry wrote: > Add a simple command that calls rte_lcore_dump(). > > Signed-off-by: Robin Jarry > --- > app/test-pmd/cmdline.c | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index b32dc8bfd445..d290938ffb4e 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -7151,6 +7151,36 @@ static cmdline_parse_inst_t cmd_showfwdall = { > }, > }; > > +/* show lcores */ > +struct lcores_result { > + cmdline_fixed_string_t show; > + cmdline_fixed_string_t lcores; > +}; > + > +static cmdline_parse_token_string_t cmd_lcores_action = > + TOKEN_STRING_INITIALIZER(struct lcores_result, show, "show"); > +static cmdline_parse_token_string_t cmd_lcores_lcores = > + TOKEN_STRING_INITIALIZER(struct lcores_result, lcores, "lcores"); > + > +static void > +cmd_showlcores_parsed(__rte_unused void *parsed_result, > + __rte_unused struct cmdline *cl, > + __rte_unused void *data) > +{ > + rte_lcore_dump(stdout); > +} > + > +static cmdline_parse_inst_t cmd_showlcores = { > + .f = cmd_showlcores_parsed, > + .data = NULL, > + .help_str = "show lcores", > + .tokens = { > + (void *)&cmd_lcores_action, > + (void *)&cmd_lcores_lcores, > + NULL, > + }, > +}; There are many dump_xxx cmd, suggest the commands as dump_lcores: testpmd> dump_ dump_physmem [Mul-choice STRING]: Dump status dump_memzone [Mul-choice STRING]: Dump status dump_socket_mem [Mul-choice STRING]: Dump status dump_struct_sizes [Mul-choice STRING]: Dump status dump_ring [Mul-choice STRING]: Dump status dump_mempool [Mul-choice STRING]: Dump status dump_devargs [Mul-choice STRING]: Dump status dump_log_types [Mul-choice STRING]: Dump status dump_ring [Mul-choice STRING]: dump_ring|dump_mempool : Dump one ring/mempool dump_mempool [Mul-choice STRING]: dump_ring|dump_mempool : Dump one ring/mempool > + > /* *** READ A RING DESCRIPTOR OF A PORT RX/TX QUEUE *** */ > struct cmd_read_rxd_txd_result { > cmdline_fixed_string_t read; > @@ -12637,6 +12667,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = { > (cmdline_parse_inst_t *)&cmd_showdevice, > (cmdline_parse_inst_t *)&cmd_showcfg, > (cmdline_parse_inst_t *)&cmd_showfwdall, > + (cmdline_parse_inst_t *)&cmd_showlcores, > (cmdline_parse_inst_t *)&cmd_start, > (cmdline_parse_inst_t *)&cmd_start_tx_first, > (cmdline_parse_inst_t *)&cmd_start_tx_first_n, >