From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id E4F462C23 for ; Tue, 18 Apr 2017 11:57:14 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id u2so50192336wmu.0 for ; Tue, 18 Apr 2017 02:57:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qF/6UyEh2cO5WOaWZdVBscWn2v5nLUInGiq0nFvJ+yU=; b=vAPuiIE3wgg8usWWk4VRsFf7uQb9vMfG6Dp6UyIr4TktFZ5a1gwbjTxgkE/zh9jplm VkJfeK7JTO3whJ/Ddi8HHEx5wGd+vEUN3A0ztcFiI2xBCYAwggxqyImBEre/FXsz/+0l sg2qD1jG7omyjYhD5ByWli0AluZn1TvosCapwvNrCcHFqlPXTqgCvWZ002I7iXMWx+l3 MA3JNxvyb2xjqk3zA+bE8HRG0EQVAXZ83f2oH6mhsbbL5+oGwgcwvOuW6fpkLtXusdWK dbSqj0TdqS5s2jfXgbFRypQ+j3Yme8Mp5g9TTtGGLDsQtOkbY+X+fahh/n8X8qbK39qk tdyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qF/6UyEh2cO5WOaWZdVBscWn2v5nLUInGiq0nFvJ+yU=; b=qkKUpEjTbxJr2JzksgxeKSFXmxd0xDbxvtQ0NrqnBs+JqshHuIHEKlgGUx8Qfb8g2o gLM4eGfaCbgVlbpjT4QfmzJEyJw7jWWKJQ2pBXp8VqMDwhVGbFHGEW+k0one7EpAP0vm Zuofv3OHNao4R7uYy80UtmGsZlFY/r6kwoO3l2/5EH7aiNtpG2AZAu9Hj3ssv0nawBE+ tXF9EpxU9hW9jxru+lzhxxHbtonm3VL1Nt3DtbMfEQoLYweIRcf+SPTvrcIM92MA5zxL U3a/Nd+NQMsAr7+Fx7ndYVFp259panDZObVFzhcQR20JDZhJFf35r58BUTOCql+vAi2l Vv3Q== X-Gm-Message-State: AN3rC/6Oj3hd/W7auE2Vonw8QxAbIXnF5IqUVXVGUhjr90il/W8VG8XZ iLXEb6t3uwWv1Oqr X-Received: by 10.28.133.139 with SMTP id h133mr12745150wmd.87.1492509433861; Tue, 18 Apr 2017 02:57:13 -0700 (PDT) Received: from glumotte.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id j71sm4522222wmd.12.2017.04.18.02.57.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Apr 2017 02:57:13 -0700 (PDT) Date: Tue, 18 Apr 2017 11:57:40 +0200 From: Olivier MATZ To: Pablo de Lara Cc: thomas.monjalon@6wind.com, stephen@networkplumber.org, dev@dpdk.org Message-ID: <20170418115740.00d3b39f@glumotte.dev.6wind.com> In-Reply-To: <1492090967-51332-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1492011332-5846-1-git-send-email-pablo.de.lara.guarch@intel.com> <1492090967-51332-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3] eal: redefine logtype values 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: , X-List-Received-Date: Tue, 18 Apr 2017 09:57:15 -0000 Hi Pablo, On Thu, 13 Apr 2017 14:42:47 +0100, Pablo de Lara wrote: > After the changes in commit c1b5fa94a46f > ("eal: support dynamic log types"), logtype is not treated as a > bitmask, but a decimal value. Therefore, values have to be > converted. > > Fixes: c1b5fa94a46f ("eal: support dynamic log types") > > Signed-off-by: Pablo de Lara > --- > > Changes in v3: > - Created array of structures containing logtype id and string > - Added left shift to convert new decimal values to bitmask for backward compatibility > > Changes in v2: > - Used new RTE_LOGTYPE values in rte_log_init() > > lib/librte_eal/common/eal_common_log.c | 37 +++---------- > lib/librte_eal/common/include/rte_log.h | 94 +++++++++++++++++++++++---------- > 2 files changed, 73 insertions(+), 58 deletions(-) [...] > @@ -111,6 +111,42 @@ extern struct rte_logs rte_logs; > #define RTE_LOG_INFO 7U /**< Informational. */ > #define RTE_LOG_DEBUG 8U /**< Debug-level messages. */ > > +struct logtype { > + uint32_t log_id; > + char logtype[32]; > +}; > + > +static const struct logtype logtype_strings[] = { > + {RTE_LOGTYPE_EAL, "eal"}, > + {RTE_LOGTYPE_MALLOC, "malloc"}, > + {RTE_LOGTYPE_RING, "ring"}, > + {RTE_LOGTYPE_MEMPOOL, "mempool"}, > + {RTE_LOGTYPE_TIMER, "timer"}, > + {RTE_LOGTYPE_PMD, "pmd"}, > + {RTE_LOGTYPE_HASH, "hash"}, > + {RTE_LOGTYPE_LPM, "lpm"}, > + {RTE_LOGTYPE_KNI, "kni"}, > + {RTE_LOGTYPE_ACL, "acl"}, > + {RTE_LOGTYPE_POWER, "power"}, > + {RTE_LOGTYPE_METER, "meter"}, > + {RTE_LOGTYPE_SCHED, "sched"}, > + {RTE_LOGTYPE_PORT, "port"}, > + {RTE_LOGTYPE_TABLE, "table"}, > + {RTE_LOGTYPE_PIPELINE, "pipeline"}, > + {RTE_LOGTYPE_MBUF, "mbuf"}, > + {RTE_LOGTYPE_CRYPTODEV, "cryptodev"}, > + {RTE_LOGTYPE_EFD, "efd"}, > + {RTE_LOGTYPE_EVENTDEV, "eventdev"}, > + {RTE_LOGTYPE_USER1, "user1"}, > + {RTE_LOGTYPE_USER2, "user2"}, > + {RTE_LOGTYPE_USER3, "user3"}, > + {RTE_LOGTYPE_USER4, "user4"}, > + {RTE_LOGTYPE_USER5, "user5"}, > + {RTE_LOGTYPE_USER6, "user6"}, > + {RTE_LOGTYPE_USER7, "user7"}, > + {RTE_LOGTYPE_USER8, "user8"} > +}; > + > /** > * Change the stream that will be used by the logging system. > * Could it go in eal_common_log.c instead? I think we don't need it in the header file, and it would avoid to pollute the global namespace. Apart from that, I tested the patch and it works. Thanks! I wonder if we can now remove the use or USERx logs in apps. It still has to work for compat, but it would be better to register a new logtype instead. I have a patch to do that in testpmd, I'll send it today. Not sure it should go in the release or not. Regards, Olivier