From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 836F26CB8 for ; Mon, 3 Oct 2016 17:37:41 +0200 (CEST) Received: from lfbn-1-5996-232.w90-110.abo.wanadoo.fr ([90.110.195.232] helo=[192.168.1.13]) by mail.droids-corp.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1br5MG-0006fb-NN; Mon, 03 Oct 2016 17:40:49 +0200 To: "Wiles, Keith" References: <1474011832-29987-1-git-send-email-olivier.matz@6wind.com> <2969629.OOuc7vtRSA@xps13> Cc: Thomas Monjalon , "dev@dpdk.org" , "david.marchand@6wind.com" From: Olivier Matz Message-ID: <104cb490-b39a-58e6-2031-d99e023474f2@6wind.com> Date: Mon, 3 Oct 2016 17:37:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] log: do not drop debug logs at compile time X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2016 15:37:41 -0000 On 10/03/2016 05:27 PM, Wiles, Keith wrote: > > Regards, > Keith > >> On Oct 3, 2016, at 10:02 AM, Olivier Matz wrote: >> >> Hi Keith, >> >> On 09/30/2016 05:48 PM, Wiles, Keith wrote: >>>> On Sep 30, 2016, at 4:33 AM, Thomas Monjalon wrote: >>>> >>>> 2016-09-16 09:43, Olivier Matz: >>>>> Today, all logs whose level is lower than INFO are dropped at >>>>> compile-time. This prevents from enabling debug logs at runtime using >>>>> --log-level=8. >>>>> >>>>> The rationale was to remove debug logs from the data path at >>>>> compile-time, avoiding a test at run-time. >>>>> >>>>> This patch changes the behavior of RTE_LOG() to avoid the compile-time >>>>> optimization, and introduces the RTE_LOG_DP() macro that has the same >>>>> behavior than the previous RTE_LOG(), for the rare cases where debug >>>>> logs are in the data path. >>>>> >>>>> So it is now possible to enable debug logs at run-time by just >>>>> specifying --log-level=8. Some drivers still have special compile-time >>>>> options to enable more debug log. Maintainers may consider to >>>>> remove/reduce them. >>>>> >>>>> Signed-off-by: Olivier Matz >>>> >>>> I think it is a good change. >>>> However I'm not sure we should take it for 16.11 as it was sent late and >>>> there is no review comment. >>>> It is neither really a fix nor really a feature. >>>> If there are some +1, and no opinions against, it will go in 16.11. >>>> Note that some drivers would need some changes to fully benefit of >>>> debug logs enabled at run-time. >>> >>> Would this be easier to add a new LOG level instead say DEBUG_DATAPATH and then change the RTE_LOG to exclude the new log level? >>> >>> >> >> The log levels are quite standard, I don't feel it would be very clear >> to have a new level for that. It would also prevent to have different >> log level inside data path. > > I am not following you here. Having one more log level for DEBUG in the data path is not a big change and you can still have any other log level in the data or anyplace else for that matter. Adding a new log level is not a big change, you are right. But to me it looks confusing to have DEBUG, INFO, ..., WARNING, ERROR, plus a DEBUG_DATAPATH. For instance, how do you compare levels? Or if your log stream forwards logs to syslog, you cannot do a 1:1 mapping with standard syslog levels. What makes you feel it's easier to add a log level instead of adding a new RTE_LOG_DP() function? Regards, Olivier