From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 195AFA04B5; Mon, 7 Sep 2020 14:28:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8750E1C0CA; Mon, 7 Sep 2020 14:28:07 +0200 (CEST) Received: from mail.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id E197C1C0C9 for ; Mon, 7 Sep 2020 14:28:04 +0200 (CEST) Received: from [192.168.1.199] (139.159.243.11) by INCCAS002.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Sep 2020 20:28:02 +0800 To: Ferruh Yigit CC: , References: <20200825115305.58490-1-huwei013@chinasoftinc.com> <20200825115305.58490-9-huwei013@chinasoftinc.com> <35059247-3bfb-67c6-85fa-1b77a07d37aa@chinasoftinc.com> <08689091-37ab-9868-1ac9-5b8e8092ff73@intel.com> From: "Wei Hu (Xavier)" Message-ID: Date: Mon, 7 Sep 2020 20:28:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <08689091-37ab-9868-1ac9-5b8e8092ff73@intel.com> Content-Language: en-US X-Originating-IP: [139.159.243.11] Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 08/11] net/hns3: change the log level to INFO X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Hi, Ferruh Yigit On 2020/9/7 20:10, Ferruh Yigit wrote: > On 9/7/2020 12:34 PM, Wei Hu (Xavier) wrote: >> Hi,Ferruh Yigit >> >> On 2020/9/4 18:34, Ferruh Yigit wrote: >>> On 8/25/2020 12:53 PM, Wei Hu (Xavier) wrote: >>>> From: "Wei Hu (Xavier)" >>>> >>>> This patch changes the log level from NOTICE to INFO. >>>> >>>> Signed-off-by: Wei Hu (Xavier) >>>> --- >>>> drivers/net/hns3/hns3_ethdev.c | 4 ++-- >>>> 1 file changed, 2 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c >>>> index fca035d4f..3827d3277 100644 >>>> --- a/drivers/net/hns3/hns3_ethdev.c >>>> +++ b/drivers/net/hns3/hns3_ethdev.c >>>> @@ -5744,5 +5744,5 @@ static struct rte_pci_driver rte_hns3_pmd = { >>>> RTE_PMD_REGISTER_PCI(net_hns3, rte_hns3_pmd); >>>> RTE_PMD_REGISTER_PCI_TABLE(net_hns3, pci_id_hns3_map); >>>> RTE_PMD_REGISTER_KMOD_DEP(net_hns3, "* igb_uio | vfio-pci"); >>>> -RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, NOTICE); >>>> -RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, NOTICE); >>>> +RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, INFO); >>>> +RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, INFO); >>>> >>> Why making the PMD more verbose by default? You can update the log level >>> dynamically when need to be more verbose. >>> >>> Common approach is to set default PMD log level is to 'NOTICE', I think this is >>> good to make applications more usable. >> Currently hns3 PMD driver invokes the private macro named hns3_info in >> several places, we found that these information wouldn't never be logged. >> hns3_info -> rte_log(RTE_LOG_INFO, hns3_logtype_dirver,...) >> >> To display the related log information, we need to execute the following >> code in the application, right? Is there any other way? >> extern int hns3_logtype_driver; >> rte_log_set_level(hns3_logtype_driver, RTE_LOG_INFO); >> > Hi Xavier, > > This is mainly it. Setting log level to something ">= 'RTE_LOG_INFO'" using > 'rte_log_set_level()' will display INFO level logs. > > There are some variant functions too, 'rte_log_set_level_pattern()' & > 'rte_log_set_level_regexp()', these let use change log level of multiple > components, like "pmd.net.*" > > Another way is provide the log level to application via eal command > "--log-level=:", like "--log-level=*:debug". This arg is > wrapper to above APIs. > > Or if you are using testpmd, can change the log level via command "set log" > dynamically, like "set log pmd.net.hns3*". > Applications can do something similar to change log levels on demand based on > their need, so components doesn't need to be verbose by default. > Thanks for your detail description. Regards Xavier