From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 87E032E8A for ; Wed, 12 Apr 2017 15:11:54 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP; 12 Apr 2017 06:11:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,190,1488873600"; d="scan'208";a="73016278" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by orsmga002.jf.intel.com with ESMTP; 12 Apr 2017 06:11:52 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.239]) by irsmsx110.ger.corp.intel.com ([169.254.15.151]) with mapi id 14.03.0319.002; Wed, 12 Apr 2017 14:11:51 +0100 From: "De Lara Guarch, Pablo" To: Thomas Monjalon CC: Olivier Matz , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 0/8] eal: dynamic logs Thread-Index: AQHSrWLYCYBKRhKbW0CJ5n09VnxKCaHBgIkwgAAFgACAADox8A== Date: Wed, 12 Apr 2017 13:11:50 +0000 Message-ID: References: <20170329155323.4760-1-olivier.matz@6wind.com> <20170404164040.24132-1-olivier.matz@6wind.com> <3021295.5zDAG2DLiv@xps13> In-Reply-To: <3021295.5zDAG2DLiv@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTBlODM4N2ItNDYzYi00MWI5LTkzNDQtMjBjZDU3MGYxN2ZiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImFrZ1wvUXp1aFdTTUNYWWhmS1ltV0NlbkwwcE5yc0VnY0tiaDlqYUpnWjlvPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 0/8] eal: dynamic logs 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: Wed, 12 Apr 2017 13:11:55 -0000 Hi Thomas, > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Wednesday, April 12, 2017 11:38 AM > To: De Lara Guarch, Pablo > Cc: Olivier Matz; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v3 0/8] eal: dynamic logs >=20 > 2017-04-12 09:26, De Lara Guarch, Pablo: > > Hi Olivier, > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Olivier Matz > > > > > > The objective of this patchset is to introduce a framework to > > > support dynamic log types in EAL. It also provides one example of use > > > (in i40e). > > > > > > Features: > > > - log types are identified by a string > > > - at registration, a uniq identifier is associated to a log type > > > - each log type can have its level changed dynamically > > > - extend command line parameters to set the log level of a specific > > > type, or logs matching a regular expression > > > - keep compat with other legacy types (eal, malloc, ring, user*, > > > etc... keep their hardcoded log type value) > > > > > > Next step is to adapt drivers, libs and apps to use this new API. At = the > > > end, we can expect that all non-dataplane logs are moved to be > dynamic, > > > so we can enable/disable them at runtime, without recompiling. Many > > > debug options can probably be removed from configuration: > > > $ git grep DEBUG config/common_base | wc -l > > > 89 > [...] > > With this patch, all logs that use logtype "USERX" (e.g. > RTE_LOGTYPE_USER1) are not shown anymore. > > Should these macro be removed? > > > > Right now, all applications using this won't show these, so I assume th= at > all of them > > should be fixed before the release is out. > > Is that correct? >=20 > Is it a bug in the commit http://dpdk.org/commit/c1b5fa9 ? > Note this line: > __rte_log_register("user1", 24); This also happens with libraries, like HASH. I think the problem might be h= ere: @@ -139,7 +266,11 @@ rte_vlog(uint32_t level, uint32_t logtype, const char = *format, va_list ap) } } =20 - if ((level > rte_logs.level) || !(logtype & rte_logs.type)) + if (level > rte_logs.level) + return 0; + if (logtype >=3D rte_logs.dynamic_types_len) + return -1; + if (level > rte_logs.dynamic_types[logtype].loglevel) return 0; Type used to be a mask, so for instance, RTE_LOGTYPE_HASH 0x0...40 =3D 64 i= n decimal. Therefore, logtype =3D 64 >=3D 34 =3D rte_logs.dynamic_types_len), so this = won't be shown. However, the PMDs or EAL will show it, because their logtype is less than 3= 4. Am I missing something? Thanks, Pablo