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 E52DFA0A0E; Tue, 11 May 2021 14:52:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6BDCA40140; Tue, 11 May 2021 14:52:39 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 61B914003E for ; Tue, 11 May 2021 14:52:37 +0200 (CEST) IronPort-SDR: QFPUFZdzIUGAfH2xPgboMSrkLBeZn7mi7Dvv5+DDGwfq9MWX6oxqyA/NmEYVwAOS1YHxtmwdiJ pfuahd0f+nJw== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="199497409" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="199497409" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2021 05:52:36 -0700 IronPort-SDR: EQGlFFB+9zkqtPi1mKDSt59iiJ0HY4hO6sz5I6XNeLZcDXpFhU2R18jsg8ptWlFT8Fq0ol1C3s UFUn0pbh/zyQ== X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="408782297" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.2.198]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 11 May 2021 05:52:34 -0700 Date: Tue, 11 May 2021 13:52:30 +0100 From: Bruce Richardson To: Thomas Monjalon Cc: dev@dpdk.org, andrew.rybchenko@oktetlabs.ru, ferruh.yigit@intel.com, David Marchand Message-ID: References: <20210409124334.24479-1-david.marchand@redhat.com> <20210511123810.1458374-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210511123810.1458374-1-thomas@monjalon.net> Subject: Re: [dpdk-dev] [PATCH v4] log: register with standardized names 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 Sender: "dev" On Tue, May 11, 2021 at 02:38:10PM +0200, Thomas Monjalon wrote: > From: David Marchand > > Let's try to enforce the convention where most drivers use a pmd. logtype > with their class reflected in it, and libraries use a lib. logtype. > > Introduce two new macros: > - RTE_LOG_REGISTER_DEFAULT can be used when a single logtype is > used in a component. It is associated to the default name provided > by the build system, > - RTE_LOG_REGISTER_SUFFIX can be used when multiple logtypes are used, > and then the passed name is appended to the default name, > > RTE_LOG_REGISTER is left untouched for existing external users > and for components that do not comply with the convention. > > There is a new Meson variable log_prefix to adapt the default name > for baseband (pmd.bb.), bus (no pmd.) and mempool (no pmd.) classes. > > Note: achieved with below commands + reverted change on net/bonding + > edits on crypto/virtio, compress/mlx5, regex/mlx5 > > $ git grep -l RTE_LOG_REGISTER drivers/ | > while read file; do > pattern=${file##drivers/}; > class=${pattern%%/*}; > pattern=${pattern#$class/}; > drv=${pattern%%/*}; > case "$class" in > baseband) pattern=pmd.bb.$drv;; > bus) pattern=bus.$drv;; > mempool) pattern=mempool.$drv;; > *) pattern=pmd.$class.$drv;; > esac > sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern',/RTE_LOG_REGISTER_DEFAULT(\1,/' $file; > sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file; > done > > $ git grep -l RTE_LOG_REGISTER lib/ | > while read file; do > pattern=${file##lib/}; > pattern=lib.${pattern%%/*}; > sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern',/RTE_LOG_REGISTER_DEFAULT(\1,/' $file; > sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file; > done > > Signed-off-by: David Marchand > Signed-off-by: Thomas Monjalon > --- >From meson build viewpoint, Acked-by: Bruce Richardson