From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 598DE592B for ; Thu, 21 May 2015 09:30:32 +0200 (CEST) Received: by wgbgq6 with SMTP id gq6so76235986wgb.3 for ; Thu, 21 May 2015 00:30:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=q8oq39WOMLXyk0nS9mq04wjPb/p6XjuqiFNYwD58QFE=; b=AgeCtqKMxCluH9PA3s5PFAfNq5vzRjQTPxBTL4CBZn5XBQ8KiyTnSDT2tPLKTDA5Mj oXVVJWd869aHZbT0KgueDmr9ZXMgo/F39kf9sVdB+0FdlzsATSJSau9PkD8m6+Cw+WzS 5BiBPZch78c0/AEyZRNntOK56BGnaXaMqOPp2oGyuJiLMTWBrPby1nRxhp0SQkyvihvm 57zcb9skQ7Nm2W8WMILbhfoi/5aBaka0zwol0iBEe0tLpEYHzsM4MSwjHU8/eX1OadKF M5da/w4GmKIQ93x5EIwnhvF0hJY1mSvbxDIyJE8IaqB7olz8iaQpUKfGdYRiINne1MDr D03A== X-Gm-Message-State: ALoCoQlaT5DGYOdmQEk8VlPAaQyosGmPH8NFVzJzjB0syXiXv02X14FAWQAWb6bFXaitbXLvVNoK X-Received: by 10.194.71.51 with SMTP id r19mr2834659wju.74.1432193432230; Thu, 21 May 2015 00:30:32 -0700 (PDT) Received: from xps13.localnet ([62.159.77.186]) by mx.google.com with ESMTPSA id mc20sm1130508wic.15.2015.05.21.00.30.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 May 2015 00:30:31 -0700 (PDT) From: Thomas Monjalon To: "Dumitrescu, Cristian" Date: Thu, 21 May 2015 09:29:46 +0200 Message-ID: <1677593.4Cv3TcNdFE@xps13> Organization: 6WIND User-Agent: KMail/4.14.7 (Linux/4.0.1-1-ARCH; KDE/4.14.7; x86_64; ; ) In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D891263236A93E@IRSMSX108.ger.corp.intel.com> References: <1430396143-10936-1-git-send-email-michalx.k.jastrzebski@intel.com> <2017641.P0ts6fjbPO@xps13> <3EB4FA525960D640B5BDFFD6A3D891263236A93E@IRSMSX108.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] pipeline: add statistics for librte_pipeline ports and tables X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2015 07:30:32 -0000 2015-05-20 23:41, Dumitrescu, Cristian: > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > 2015-05-20 13:57, Dumitrescu, Cristian: > > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > > > Thanks for the detailed explanation. > > > > > > > > You are raising a trade-off problem about > > > > feature/maintenance/performance. > > > > I think we must choose among 4 solutions: > > > > 1/ always enabled > > > > 2/ build-time log level > > > > 3/ run-time option > > > > 4/ build-time option > > > > > > > > It's good to have this discussion and let other contributors giving their > > > > opinion. > > > > > > > > 2015-05-19 22:41, Dumitrescu, Cristian: > > > > > 1. What is the technical solution to avoid performance loss due to stats > > > > > support? > > > > > Generally, I would agree with you that config options should be avoided, > > > > > especially those that alter the API (function prototypes, data structure > > > > > layouts, etc). Please note this is not the case for any of our patches, > > > > > as only the stats collection is enabled/disabled, while the data > > > > > structures and functions are not changed by the build time option. > > > > > > > > > > But what can you do for statistics? We all know that collecting the stats > > > > > sucks up CPU cycles, especially due to memory accesses, so stats always > > > > > have a run-time cost. Traditionally, stats are typically enabled for > > > > > debugging purposes and then turned off for the release version when > > > > > performance is required. How can this be done if build time flags are > > > > > not used? > > > > > > > > Statistics in drivers are always enabled (first solution). > > > > If those statistics are only used for debugging, why not using the build- > > > > time option CONFIG_RTE_LOG_LEVEL? (second solution) > > > > > > Can you please describe what solution 2 on your list (build-time log > > > level) consists of? > > > > > > I see log level useful for printing messages when an event takes place, > > > but this is not what these stats patches are about. We want to poll > > > for those counters on demand: if the build-time flag is off, then the > > > value of those counters is 0; when the build-time is on, then the stats > > > counters have the real value. Basically, the build-time flag only > > > enables/disables the update of the counters at run-time, which is where > > > CPU cycles are consumed. I am not sure how the log levels can help here? > > > > I think that counting stats is a kind of logging. > > Some stats are always counted (see drivers) and you want to use these ones > > only for debugging (after rebuilding DPDK with some debug options). > > So I suggest, as second solution, to check CONFIG_RTE_LOG_LEVEL is at > > debug > > level instead of having one option per module. > > It would be implemented with "#if RTE_LOG_LEVEL == RTE_LOG_DEBUG" in > > RTE_PIPELINE_STATS_ADD. > > The problem I see with this approach is that you cannot turn off debug > messages while still having the statistics collected. We should allow > people to collects the stats without getting the debug messages. How do > we do this? By setting build-time log level to debug, you would enable stats and debug messages. Then you can adjust the log messages level with the run-time option --log-level.