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 0B297A0350; Wed, 24 Jun 2020 15:08:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C65CE1D70F; Wed, 24 Jun 2020 15:08:45 +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 6B5AF1D6EF for ; Wed, 24 Jun 2020 15:08:44 +0200 (CEST) Received: by mail-io1-f68.google.com with SMTP id f23so2035339iof.6 for ; Wed, 24 Jun 2020 06:08:44 -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=y1BAfgeIa6VqxcH2+3d5LhCXuR7be43HZPweRAtBj1c=; b=pyY4tNiIzWiwRCYE+8dcJsEIkFLHADAHwEodDwKvatiUijO3lFBSLbZYioMDJBcPAB F+UcBtjxC1qc3NEsLjS85O/s12YUyVrqCYyaYM2M9/uNFWz+tarkrtoS5a6nzHv/x30s Wzh2FeNcyyySxe64yv7RcCYwkaf5PJ2C2ynfIxPgnCV5pSl1Y1wV2hZp5+pnpkEDM9qx aUQoWWxYVHfzxtqqeN+q0nc2ImSZ+Ns1IY8wQTWYoIr83Nscxf2kh+/zoyEKI9fzyrN4 F7MyJBUJqajCspNNMZB/X32rubUy/WC3hWeSggyzysp/ZYr1nHO8oK1UEK6Xqxv6V/uG GwCg== 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=y1BAfgeIa6VqxcH2+3d5LhCXuR7be43HZPweRAtBj1c=; b=OGTVrDFLlKvCve7L+8hWAPxBmorDAy/enxVmJ3gH1K052DRJKf+KJxsiZn87ffKFcq yVHHSgwbzRvAPdWP51qmss3BIDXc/mefoWQExkOSi9i4NW9sSQiMWZ14JlAlWwmVhULx FcAvOpMk87IHCNK9jHJ2zz6Ne1FdrgeN5d0iNq+24VJ/AbRK4ti/SWSQComWXPqbLhgf xP7clxzwnh4kYG2HqayPvLxKSqNyBQdUiYaHByeJYjQ3DIOr14nPkoVfpSMX9B8zxleZ hvLpv413mI9XtYjX9nPnqGwrmGH8XhNLo18L6LiohAUdVLlLUNdbOzo0QQTkSVbwRwjv l5LQ== X-Gm-Message-State: AOAM531VUl4XiQ1QXrrlfuQ2bRv/1HGkl3Ju26EoUoDUqPuNWXriN1j9 sp6dm3VTUsXZNZao7YP5fmEWDzPKj6kKsGDDdKc= X-Google-Smtp-Source: ABdhPJzi3zFL/J6PIrWioSpkuEa8SC31zGRhVqdPogCvcnQ5Lu21xhgr7iLa5tirwbdOsOwckHPpj81xXE1DFRH56z4= X-Received: by 2002:a05:6602:2d95:: with SMTP id k21mr31520945iow.59.1593004123590; Wed, 24 Jun 2020 06:08:43 -0700 (PDT) MIME-Version: 1.0 References: <20200617063047.1555518-1-jerinj@marvell.com> <20200617063047.1555518-2-jerinj@marvell.com> <1766597.KjKJm3peCn@thomas> <72bd604c-3cbb-1c2a-44a9-d119e8fb0c2d@solarflare.com> In-Reply-To: <72bd604c-3cbb-1c2a-44a9-d119e8fb0c2d@solarflare.com> From: Jerin Jacob Date: Wed, 24 Jun 2020 18:38:27 +0530 Message-ID: To: Andrew Rybchenko Cc: Thomas Monjalon , Jerin Jacob , dpdk-dev , Olivier Matz , David Marchand 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 17, 2020 at 3:56 PM Andrew Rybchenko wrote: > > On 6/17/20 1:00 PM, Thomas Monjalon wrote: > > 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. > > Yes, rte_log_register_type_and_pick_level() should be used. > Otherwise, if a driver is loaded (the constructor is called) > after --log-level options processing, the level set using > the option is not applied. OK. I will change it in v2. > > > rte_log_register() should be deprecated. > > +1 >