From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 801E9A0350; Wed, 24 Jun 2020 17:33:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 868D51D97D; Wed, 24 Jun 2020 17:33:17 +0200 (CEST) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id A4F741C1AB for ; Wed, 24 Jun 2020 17:33:16 +0200 (CEST) Received: by mail-io1-f68.google.com with SMTP id i4so2580411iov.11 for ; Wed, 24 Jun 2020 08:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7t6I90EnDe51Wuk1miDgGkFaFpp6rxoGttCRkWNKaVo=; b=b2XYWTPyCbiHrRZmycjpAt2ZhMBSGvrg/Va5tMfc75CEP/CjWTU2J/vF3fqj5siQQa AH3sDudZCBp5BDL4qUJak9WMukqMci3inXSHP6+nnIY1nSytcEcXhhbXKi4LXJkNiclP qlyyXT1JNzBPD3UtzHCQXGpnKdPZ3NILL3QSG/m3c/L6vWcSviJj83jfnz4Vq8aW02Ms P3M0BAd0PgHEPNgFiw+KyY9TaWI2k+oLPPbQrWZfd4LB6/0R+SSuQFHzn12VLpLsc77R jSsmo/e63grPzwU6aMMJzpmiq707yu6CRAplc1acjyrNk+EnO94w1U1XwS4pJlUpFexe Ryyw== 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=7t6I90EnDe51Wuk1miDgGkFaFpp6rxoGttCRkWNKaVo=; b=TCE464kiba4XIP/tK51bx5/3NxG+KTZENHXftZkkYPHvz7R94SjGhqiROfpwZt1lXq Y8kbuXvv7joNn0eBVtkjKIqU51bHtOgvWT/jkCf/l2dMt74kIyAqhBO0w4dCacIbJh5X hjHAfqQz/Czj1ZGqkUoL4H6kOAwhSbsF0YElU2dV9dn16e3PYwer+DfH7aZEMJzriAki Cm44zu5fOU99cUIxjObmCNT6P82jVboWUxIg4db2EAuBmVWkIRiYClzFm501dcVv8/Bq dn6lKwtM9U3/6uAcgyauoAs82LUJUnDENp5uimHaZ4X9ZaffgU90/Dh6GVGjq1tzHXfY dAmg== X-Gm-Message-State: AOAM532VL2KVEoqvUKntj2mP7EC3AyvxT/DKuyUfX6KxErL/+Bh5x9fq m74+9YPVcW1+SEdFQhUC35bXBQU/PyVA2HKch34= X-Google-Smtp-Source: ABdhPJzFv1XvBMT1Ok14ulKXTRmmMbi9PlQnV3vdfdLbxGlMoyEuWWIXF2Nz2cUb6w2Uq46d+syjWecQEP8hmb+r6XI= X-Received: by 2002:a02:6a26:: with SMTP id l38mr29778478jac.60.1593012795786; Wed, 24 Jun 2020 08:33:15 -0700 (PDT) MIME-Version: 1.0 References: <20200617063047.1555518-1-jerinj@marvell.com> <20200617063047.1555518-2-jerinj@marvell.com> <4becf100-7f0f-d051-a40c-3944e101381a@solarflare.com> In-Reply-To: <4becf100-7f0f-d051-a40c-3944e101381a@solarflare.com> From: Jerin Jacob Date: Wed, 24 Jun 2020 21:02:59 +0530 Message-ID: To: Andrew Rybchenko Cc: David Marchand , Jerin Jacob Kollanukkaran , dev , Thomas Monjalon , Olivier Matz Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 01/13] eal/log: introduce log register macro X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Wed, Jun 24, 2020 at 8:56 PM Andrew Rybchenko wrote: > > On 6/24/20 4:11 PM, Jerin Jacob wrote: > > On Wed, Jun 17, 2020 at 3:51 PM Andrew Rybchenko > > wrote: > >> > >> On 6/17/20 1:02 PM, David Marchand wrote: > >>> On Wed, Jun 17, 2020 at 8:30 AM wrote: > >>>> > >>>> From: Jerin Jacob > >>>> > >>>> Introducing the RTE_LOG_REGISTER macro to avoid the code duplication > >>>> in the log registration process. > >>>> > >>>> It is a wrapper macro for declaring the logtype, register the log and sets > >>> > >>> Having the logtype variable declared as part of the macro will force > >>> us to have global symbols (for the cases where it is needed). > >>> I'd rather leave the declaration to the caller, and only handle the > >>> registering part in this macro. > >> > >> I agree with David that it is important to avoid global symbols > >> when it is not needed. > > > > David, Andrew, > > > > Since it is executed in "constructor" context, it will be always from > > the global variable. Right? > > i.e DPDK is not yet initialized in when "constructor" being called. > > In addition to that, It will be adding more lines of code in the > > consumer of this MACRO. > > Thoughts? > > The problem is rather 'extern' vs 'static'. Before the patch > many variables are static, but become externally visible after > the patch. OK. How about RTE_LOG_REGISTER_EXTERN or RTE_LOG_REGISTER_STATIC then? It will allow less code in the consumer of this macro. May be default we an make it as static so RTE_LOG_REGISTER and RTE_LOG_REGISTER_EXTERN for the different needs. Thoughts? > > >> > >>>> it's level in the constructor context. > >>>> > >>> > >>> > >> >