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 93B84A0579; Fri, 9 Apr 2021 15:01:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1CA5F4068B; Fri, 9 Apr 2021 15:01:54 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 0BDA44014D for ; Fri, 9 Apr 2021 15:01:51 +0200 (CEST) IronPort-SDR: c+IHz9ITwImp+CPkn4rzskVvOkNfIFclLJKiEzegdcX3C8t0NQcmquB3NXs4ZxBeoLNC9GQBZ1 NuaTFQxufPCQ== X-IronPort-AV: E=McAfee;i="6000,8403,9949"; a="214188481" X-IronPort-AV: E=Sophos;i="5.82,209,1613462400"; d="scan'208";a="214188481" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 06:01:50 -0700 IronPort-SDR: PugmA6+vDmvrxpHDDrZRv10OMsG+4DJnfOB11iVhOyS9KSs6w/HJrTEZjG7ENxkmi5ecbKL92r AzsG59T8LMzg== X-IronPort-AV: E=Sophos;i="5.82,209,1613462400"; d="scan'208";a="422718035" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.3.224]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 09 Apr 2021 06:01:49 -0700 Date: Fri, 9 Apr 2021 14:01:45 +0100 From: Bruce Richardson To: David Marchand Cc: dev@dpdk.org, thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru Message-ID: <20210409130145.GA1381@bricha3-MOBL.ger.corp.intel.com> References: <20210409124334.24479-1-david.marchand@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210409124334.24479-1-david.marchand@redhat.com> Subject: Re: [dpdk-dev] [PATCH] log: deduce log type from filename 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 Fri, Apr 09, 2021 at 02:43:34PM +0200, David Marchand wrote: > Let's try to enforce the convention where drivers use a pmd. logtype > with their class reflected in it and libraries use a lib. logtype. > > RTE_LOG_REGISTER now interprets the log type name: > - if none or a name starting with a . is passed, then the default logtype > is used as a prefix, > - else the name is used as is to deal with components that do not comply > with the current convention, > > Note: achieved with below command (+ manual edit on crypto/virtio, > compress/mlx5 and regex/mlx5). > $ git grep -l RTE_LOG_REGISTER drivers/ | > while read file; do > pattern=${file##drivers/}; > class=${pattern%%/*}; > pattern=${pattern#$class/}; > pattern=pmd.$class.${pattern%%/*}; > sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\(\|\..*\),/RTE_LOG_REGISTER(\1, \2,/' $file; > done > > $ git grep -l RTE_LOG_REGISTER lib/ | > while read file; do > pattern=${file##lib/librte_}; > pattern=lib.${pattern%%/*}; > sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\(\|\..*\),/RTE_LOG_REGISTER(\1, \2,/' $file; > done > > Signed-off-by: David Marchand > --- > This is an alternative to the devtools check I had proposed [1]. > This can be seen as a RFC, but if people are happy with it, I don't see > much to add. > > 1: https://patchwork.dpdk.org/project/dpdk/list/?series=15796 > > --- > diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c > index 91bee65e7b..fb315f02e9 100644 > --- a/drivers/common/dpaax/dpaax_iova_table.c > +++ b/drivers/common/dpaax/dpaax_iova_table.c > @@ -460,4 +460,4 @@ dpaax_handle_memevents(void) > dpaax_memevent_cb, NULL); > } > > -RTE_LOG_REGISTER(dpaax_logger, pmd.common.dpaax, ERR); > +RTE_LOG_REGISTER(dpaax_logger, , ERR); Sorry, but this blank field looks really wrong to me, and I'd rather find a better solution. How about as part of the cflags for each component adding "-D" flag with the default component log name, that can be used in place of the blank, or added to as needed? /Bruce