From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by dpdk.org (Postfix) with ESMTP id E20E93005 for ; Wed, 12 Apr 2017 15:29:24 +0200 (CEST) Received: by mail-wr0-f175.google.com with SMTP id l28so17547512wre.0 for ; Wed, 12 Apr 2017 06:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=nq57CSmt4fo/kImu9ckggFgVps+ZNhHA7eO9NOPdJ2k=; b=ktnP10nF8a3u7hBREUF4ufouh6OrRDAxFJNpvDiTsJYJRPdzQURVNqQLDi8kohPxYJ +6m3fc0BT4/ndGJmgx5ya1UfYUhqbR9f0KQOpb3s0P6v38HKfCWlK+wGRksc3J2a+bPn QkoJwFAxprY8GSTtSXDN45Kn3Ei9q36bPx69uG9VhQ9VAhBjPMrnFt1+opsbQhvxqXVY VqTVnSI11ZkhF8fK6hb4eW6/DgSR+Dp7otcG7mFTrjAjgpQA2D3ppP7Sww8d3XVd/N+T uMOSIItmCUzNCnnC/9N5j22vq19zPyadp9III3oQABGNMpWyNjbCOvdgCicPh2wWx/2g KIsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=nq57CSmt4fo/kImu9ckggFgVps+ZNhHA7eO9NOPdJ2k=; b=QN9AabbxcS6rVpYRPsiAtB+xwAcRvk1wv86ZfmZXWYf+dqU10TeBEG3JOtpDysPaCi ZwxLEuTSQ39Ui4Fr1iXyf5oCqXehoYKKJ85uGT/64FlycyLluCrzTbqWAXxBItLV4DaV +hwifT1Y6PWbOKHrGZPfcY/eEqQtfKNHpBOYBJs0hK6Hq0patKRx+9aT3OtAUXw6p2vY nCcJOKNnxeqjSlCRWFS4UxhTr4d3LUv4bCV7mCyCaZfKVpzXSr3UtNTMXJMPKK4K1pV4 r5PD+Nu2WRK7rIlhOdMNWLTztlana4+8HuxyEL/kGE3teyvkzdlw+YBQ4b21xW9bLpvY y2zA== X-Gm-Message-State: AN3rC/7a/NtclpujdixXCvOwrzQMivKyF9B1pIuC0eZEhl0kjo52vHataub42atnchsKoayM X-Received: by 10.223.176.202 with SMTP id j10mr3392524wra.10.1492003764502; Wed, 12 Apr 2017 06:29:24 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id x20sm125100wme.0.2017.04.12.06.29.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Apr 2017 06:29:23 -0700 (PDT) From: Thomas Monjalon To: "De Lara Guarch, Pablo" Cc: Olivier Matz , dev@dpdk.org Date: Wed, 12 Apr 2017 15:29:23 +0200 Message-ID: <1731928.s789XWeaOP@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <20170329155323.4760-1-olivier.matz@6wind.com> <3021295.5zDAG2DLiv@xps13> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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:29:25 -0000 2017-04-12 13:11, De Lara Guarch, Pablo: > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > Sent: Wednesday, April 12, 2017 11:38 AM > > 2017-04-12 09:26, De Lara Guarch, Pablo: > > > 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 that > > all of them > > > should be fixed before the release is out. > > > Is that correct? > > > > 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 here: > > @@ -139,7 +266,11 @@ rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap) > } > } > > - if ((level > rte_logs.level) || !(logtype & rte_logs.type)) > + if (level > rte_logs.level) > + return 0; > + if (logtype >= 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 = 64 in decimal. > Therefore, logtype = 64 >= 34 = 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 34. > > Am I missing something? I think you are right. We are mixing old logtype and new ones. Should we redefine RTE_LOGTYPE_* values to the new values registered in rte_log_init?