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 76BB88D90 for ; Wed, 5 Oct 2016 14:01:39 +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 1brkwG-0001OM-R7; Wed, 05 Oct 2016 14:04:49 +0200 To: David Marchand , "Wiles, Keith" References: <1474011832-29987-1-git-send-email-olivier.matz@6wind.com> <2969629.OOuc7vtRSA@xps13> <104cb490-b39a-58e6-2031-d99e023474f2@6wind.com> <036D8827-DFD7-421D-8133-3011D42CEAB4@intel.com> Cc: Thomas Monjalon , "dev@dpdk.org" From: Olivier Matz Message-ID: <193391f4-322d-b62b-2997-a32db4d852b4@6wind.com> Date: Wed, 5 Oct 2016 14:01:29 +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=utf-8 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: Wed, 05 Oct 2016 12:01:39 -0000 Hi David, On 10/04/2016 10:28 AM, David Marchand wrote: > On Mon, Oct 3, 2016 at 6:27 PM, Wiles, Keith wrote: >>> On Oct 3, 2016, at 10:37 AM, Olivier Matz wrote: >>> What makes you feel it's easier to add a log level instead of adding a >>> new RTE_LOG_DP() function? >> >> It seems to me the log levels are for displaying logs at different levels adding a new macro to not log is just a hack because we do not have a log level for data path. This is why I would like to see a log level added and not a new macro. >> >> It also appears the new RTE_LOG() will always be in the code as you moved the test to the RTE_LOG_DP() macro. This would mean all RTE_LOG() in the code will always call rte_log(), correct? >> >> If using a new DEBUG_DP (maybe DATAPATH is a better log level name) level we can use the same macro as before and modify the level only. This way we can remove via the compiler any log that is below the default RTE_LOG_LEVEL. I see keeping the rte_log() could be a performance problem or code blot when you really want to remove them all. >> >> The DATAPATH log level would be above (smaller number) then DEBUG in the enum list. To remove all debug logs just set the RTE_LOG_LEVEL to RTE_LOG_DATAPATH. > > If I try to draw a parrallel to syslog (well, the log subsystem in eal > has always been bound to syslog ...), what you propose here is like > adding a new level in syslog while you have syslog facilities. > > With the current log api, we have types and levels, can't we filter at > build time depending on the log "type" ? > Here we would strip PMD type logs > INFO. I think we may have dataplane logs in other part of the code: in the application (log type = USER), and surely in some dpdk libraries. Moreover, as the behavior of the macro changes (in one case it is stripped at compilation, in the other case not), I'd say having different functions is clearer for the developer than having a different behavior depending on log level or log type. Regards, Olivier