From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by dpdk.org (Postfix) with ESMTP id 9078B9A8F for ; Wed, 20 May 2015 20:00:02 +0200 (CEST) Received: by pacwv17 with SMTP id wv17so75099053pac.2 for ; Wed, 20 May 2015 11:00:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=vuBUwL0ZTlrDLYiprU9FIEh736ZkquxvyYMtxsqHurI=; b=IfQmunP87hfnIo1JV2VAAjdr3J0145FMtnt256hJtlZrk3p8E4ieYvORNfzWxI1T2R hHRvAuxPpzoUv58eW9F1c3wt7SeYZP/sEcwdjo2p8ItMStAvBBHhxHGxoO4tT1hj4H6V lrDBELQcaw2e1uQM0fRlOdQ3ittp5yQ5GzbAu8DOFhS86txJKtfMKeGiAcxBctKwg9Wv bOlOxQRxbsV8kSpCG2KnEEprD7auxSBvZ0ZhstK6StxHSanxPI46G7OLt2yRXMAPBBSp aQw/1TUbSC5S56iwr45qkBr9N9LMyr6BPY9t5Fjn5aKomoS/48yDo/qHhuvm3ysXB3qu SJbg== X-Gm-Message-State: ALoCoQkyU5D9yjkaF+TVA0nNjfJQ5A3ESYRW9LJCyUxUWrUkCKy1uyJS3nQu61WJNAMyJp6asZRu X-Received: by 10.68.139.103 with SMTP id qx7mr66029264pbb.133.1432144801736; Wed, 20 May 2015 11:00:01 -0700 (PDT) Received: from uryu.home.lan (wsip-98-172-74-163.ph.ph.cox.net. [98.172.74.163]) by mx.google.com with ESMTPSA id l1sm16807660pdp.71.2015.05.20.10.59.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 11:00:00 -0700 (PDT) Date: Wed, 20 May 2015 10:59:46 -0700 From: Stephen Hemminger To: Thomas Monjalon Message-ID: <20150520105946.4ac86349@uryu.home.lan> In-Reply-To: <2017641.P0ts6fjbPO@xps13> References: <1430396143-10936-1-git-send-email-michalx.k.jastrzebski@intel.com> <43396928.Zqf8pLaHBD@xps13> <3EB4FA525960D640B5BDFFD6A3D891263236A65D@IRSMSX108.ger.corp.intel.com> <2017641.P0ts6fjbPO@xps13> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Wed, 20 May 2015 18:00:03 -0000 On Wed, 20 May 2015 16:44:35 +0200 Thomas Monjalon wrote: > Please Cristian, do not top post. > I'm replacing your comment in the right context. > > 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. > In my experience, per-queue or per-cpu statistics have no visible performance impact. And every real world deployment wants statistics