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 96BC5A0A0E; Tue, 11 May 2021 13:16:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1881340697; Tue, 11 May 2021 13:16:13 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id EB0B440140 for ; Tue, 11 May 2021 13:16:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620731770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nmcQC7DTz19oppxuOiKG6RCm9v253Csqzgb8T72e9uk=; b=UEVjkFO+URkskmhTkYcIaN9h6O5emP8KhQBLIG9TT1ZwUzC0w+5/30IwHdBhoz2wKnOMVZ +slk+mLz31EDbmU9tpTL1H9k6wOSZSybCurUcyNWg7/10E8WrF/JBtVpWpGuN77V+FlMEh e1HbjdMGmWm/1ZOQfYBoflLtM6M1u+0= Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-378-CGhVHefyNUOGclkwNcvNjQ-1; Tue, 11 May 2021 07:16:07 -0400 X-MC-Unique: CGhVHefyNUOGclkwNcvNjQ-1 Received: by mail-vs1-f72.google.com with SMTP id p23-20020a67d7170000b02902276bd91076so9544166vsj.4 for ; Tue, 11 May 2021 04:16:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nmcQC7DTz19oppxuOiKG6RCm9v253Csqzgb8T72e9uk=; b=bk0ja11dk3mZa9/d2/khVLjnSt9o0AUiuXJlgEIY+RudxB3U4cb097SGoiBk+frr8a 02Hz112PWmMwldNwAbaSOR0z6llvGg4T9pIi28ZAQiZHnzmTrAOdk5YBT3QthVEPSwba JA3oUvNIvk8pV/p5y066gT1fvXOPNiDwxZ6AOSGDhMNfQu4GMcYFRdSM+h29bCwiPm8b t0R1gK0QVmXB8T5RehB66EmQc9iW8EiWf1zw31ogrOphwWaCU7vVRBtsuEHEfF1OdgqQ 4v8aH1bf0yzcb4Jxf35mfv+sEJjFwxWcl8a3ihoZ6Hpn5ICdq7CYqFe86sLif6MwrHAh 4qRQ== X-Gm-Message-State: AOAM5331QRsWf3kEsaT2VDxt9kPNV81zVAPdi8Tnm69UBFWvsLB/3qnM ByHMIHorrXAHzxS+3SciiAK1+g16UoHjFgNleFeXF3TleybbAugRL6uyvhVC9BMulS13NHYPe8P 3HvKojAevg/Vq2R4pyMI= X-Received: by 2002:a67:f645:: with SMTP id u5mr24239125vso.18.1620731767153; Tue, 11 May 2021 04:16:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn0akoAv/upIoPMSCHRRjQGfRitlLaDxMn2INI93ezV51evJGgsmZjbMxLSqJrX1eyMLWNo1KKRsjsmTkzJSc= X-Received: by 2002:a67:f645:: with SMTP id u5mr24239096vso.18.1620731766879; Tue, 11 May 2021 04:16:06 -0700 (PDT) MIME-Version: 1.0 References: <20210409124334.24479-1-david.marchand@redhat.com> <20210511100927.824319-1-thomas@monjalon.net> In-Reply-To: <20210511100927.824319-1-thomas@monjalon.net> From: David Marchand Date: Tue, 11 May 2021 13:15:55 +0200 Message-ID: To: Thomas Monjalon Cc: dev , Andrew Rybchenko , "Yigit, Ferruh" , Bruce Richardson Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3] 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 12:09 PM 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. These exceptions can be updated in the commands below: > > Note: achieved with below commands + reverted change on net/bonding + > edits on crypto/virtio, compress/mlx5, regex/mlx5, baseband, bus and > mempool drivers. > > $ 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_DEFAULT(\1,/' $file; > sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file; > done Becomes: 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 > --- > > Changes since v2: > - use RTE_LOG_REGISTER_DEFAULT in baseband, bus, mempool > by adding the variable log_prefix in drivers/meson.build Compared the registered logtypes before/after, all good. Thanks for this addition. -- David Marchand