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 4A915A0597; Thu, 9 Apr 2020 19:11:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C24391C0D4; Thu, 9 Apr 2020 19:11:24 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id D80AD1C0CB for ; Thu, 9 Apr 2020 19:11:23 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 37F295C2847; Thu, 9 Apr 2020 13:11:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 09 Apr 2020 13:11:23 -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=mesmtp; bh=ZWCYN1C2psczKcb23sXMTfbxwADbPrcK2N65JCITQqY=; b=gpQ/d9zCA6KF lONK9fdgHOrlbdEg/OmhreT6glAr3fKI5liSjz+kMEstjK3wttTNFfhxbhdeWx8a 0SbJTWMIAa3URG0H40YhU4I1FyKDoiRpwAXD4OO9qrZf7TkFW0SEHdARbDuFVL66 IqBjjlDN3kJzaywVF6Yq2CG37IkyPjw= 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=fm2; bh=ZWCYN1C2psczKcb23sXMTfbxwADbPrcK2N65JCITQ qY=; b=w/tNjeCQlKW9hCsthnNdZ/kOccDWuWiOtab21Wq5U9983WNMFn54D3uv+ ojBNqn3liBVRFe5MBg4Gl2nIpqQYrMa+n89kCMfkMjGgmNeXHVholYpGU2AXZcgq 8nK54LqNlSC5nd7tEhEYRSiEDFWNf2eTToy+oGPNZC8fGfJOr67YxlcV7Pl/KAYi ybErdDwECraiDBN61j8I5PYJj/PiRWZdejkBwkDBjgflpdRrLBQOixw+/InGknbC CNnulg7MPGUXS/WRTptqSlOfbUCxH5fFnkwpEOW8rLV0C7i2L1mqqFsfaeL6SZkv 58M/1/GeGtEOaAvXu0X72z+dZtkpg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudelgddutdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecukf hppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght 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 B06E33280063; Thu, 9 Apr 2020 13:11:20 -0400 (EDT) From: Thomas Monjalon To: Jerin Jacob Cc: Jerin Jacob , dpdk-dev , "Richardson, Bruce" , David Marchand , Mattias =?ISO-8859-1?Q?R=F6nnblom?= , Sunil Kumar Kori , Olivier Matz Date: Thu, 09 Apr 2020 19:11:18 +0200 Message-ID: <14100064.JCcGWNJJiE@thomas> In-Reply-To: References: <20200329144342.1543749-1-jerinj@marvell.com> <6115809.K2JlShyGXD@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4 00/33] DPDK Trace support 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" 09/04/2020 18:34, Jerin Jacob: > On Thu, Apr 9, 2020 at 9:30 PM Thomas Monjalon wrote: > > 09/04/2020 17:36, Jerin Jacob: > > > On Thu, Apr 9, 2020 at 7:30 PM Thomas Monjalon wrote: > > > > As discussed somewhere else, please do not introduce global level > > > > in rte_trace. I think it is useless. If we need to change the level > > > > of all trace types, we can just use a wildcard (globbing or regexp). > > > > > > Currently, In the log library, when EAL command-line argument > > > specifies the "--log-level=val" it, will call > > > the rte_log_global_level_set(val) > > > > > > Is the suggestion to make rte_log_global_level_set() as an internal > > > EAL API or remove that feature? > > > > Completely remove global level. > > Why would we need 2 levels of level? > > > > > If we remove, then I dont know, how we can map --log-level or > > > --trace-level EAL command-line argument. > > > > They are setting levels with regex or globbing. > > --log-level supports 3 syntaxes today: > > - int (global level) > > - globbing:int > > - regex,int > > Here is my understanding. > > IMO, Actual Syntax is > - int (global level) > - globbing: int (global level) > - regex: int (global level) The level apply to the logs matching the pattern (globbing or regex) so I don't understand why you call it "global". > i.e > > 1) Each log/trace has a "level" > 2) There is a global level. See [1] > 3) The trace will be emitted when > a) When it is enabled(not applicable for log as it is always enabled) > AND > b) it is less than the global level. When it is less than both global and logtype level. See rte_log_can_log(). > The global level will be useful to control what category of trace > "level" needs to enable. > I think, it is useful to trace only DEBUG or CRITICAL events, Any > reason for thinking, it is not. > > > [1] > /** > * Set the global log level. > * > * After this call, logs with a level lower or equal than the level > * passed as argument will be displayed. > * > * @param level > * Log level. A value between RTE_LOG_EMERG (1) and RTE_LOG_DEBUG (8). > */ > void rte_log_set_global_level(uint32_t level); rte_log_can_log(uint32_t logtype, uint32_t level) { int log_level; if (level > rte_log_get_global_level()) return false; log_level = rte_log_get_level(logtype); if (log_level < 0) return false; if (level > (uint32_t)log_level) return false; return true; } The global level is just disabling some logs even if it is enabled in the logtype level. It only makes usage complicate. We should consider only logtype levels. Currently, the global log level is disabled by default by setting the global level to DEBUG: RTE_INIT_PRIO(rte_log_init, LOG) { [...] rte_log_set_global_level(RTE_LOG_DEBUG); It was done by Pavan 2 years ago.