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 1B66BA04A5; Wed, 17 Jun 2020 12:00:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CA8A21252; Wed, 17 Jun 2020 12:00:19 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 4A666FFA for ; Wed, 17 Jun 2020 12:00:18 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id E31415C00F4; Wed, 17 Jun 2020 06:00:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 17 Jun 2020 06:00:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= b/z5zDOthZnmfuglPfVyv17wzlwrztGsO7xPAsq381U=; b=qLGuaW4crfu6UinC lPIRM6i3td6W5evckuPPj2RX0FAp5/v9+hyj7vyYb4TcZqwruPvrFF2XAAca+xGy JPXZWjPUxzYbuMSAu6tolJGSCkPvFKUO8O0T6Bu/d18nsax4UlOeGzsKYYD8ZaDn mdpwALA0EEJofJNn2P3TAjCoGQVi9PXLU6KaIKodA2tAvA933/9KZZ4KCHJlIcxS 5HcCzHltoPomrSH4tInsJcyH8PkJBlWkHlnIs8pUwxCXJuYpS+FX+3CxPl+PDEEA sjWOwJaT2rURZ9qaJtJXZsDPz5oQsbb8KUfpVpiy1loWhIZjRSsUXZ0QzUBmg/k1 pM0O9Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=b/z5zDOthZnmfuglPfVyv17wzlwrztGsO7xPAsq38 1U=; b=kpM5DIT8Ay7bi4R5aK7EBUuPxdgpMW4snvFSTJG6+6znwFzC0xGx/GkzR Q9dTMDvf85zzSpDlCUxe7cJ8Ui2JdRWpbEnYWjIqWydWcLkfgE9VxTwkXGPGTpdD WWqYc0RDXM3naLs47f2zZ5Jmd9dzHY1WLEatjjUALsJQ5304B99rvLKyQUNIdghC TQ78HWI3CCRSKbQemAx0R6r3aYdrD5fYwuw70jv/SThss1QP3/218FzSDkW3Bmax S5cmJXsgqkAPfmaqHXcEuPez+YnVG7NNn7N9MvsJsxf6zzZpYU7YQplSmubkezgS Kez3MlveFZ+9RemkdhQKPAZYiy8JA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudejvddgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id BC0273060F09; Wed, 17 Jun 2020 06:00:16 -0400 (EDT) From: Thomas Monjalon To: Jerin Jacob Cc: dev@dpdk.org, olivier.matz@6wind.com, david.marchand@redhat.com, arybchenko@solarflare.com Date: Wed, 17 Jun 2020 12:00:15 +0200 Message-ID: <1766597.KjKJm3peCn@thomas> In-Reply-To: <20200617063047.1555518-2-jerinj@marvell.com> References: <20200617063047.1555518-1-jerinj@marvell.com> <20200617063047.1555518-2-jerinj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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" 17/06/2020 08:30, jerinj@marvell.com: > 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 > it's level in the constructor context. > > Signed-off-by: Jerin Jacob > --- > --- a/lib/librte_eal/include/rte_log.h > +++ b/lib/librte_eal/include/rte_log.h > +#define RTE_LOG_REGISTER(type, name, level) \ > +int type; \ > +RTE_INIT(__##type) \ > +{ \ > + type = rte_log_register(RTE_STR(name)); \ > + if (type >= 0) \ > + rte_log_set_level(type, RTE_LOG_##level); \ > +} It should use rte_log_register_type_and_pick_level() which works for drivers loaded later in the init sequence. rte_log_register() should be deprecated.