From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3] app/testpmd: print statistics periodically Date: Thu, 06 Jul 2017 01:51:40 +0200 Message-ID: <2035419.FSHShSjrGD@xps> References: <20170609014656.27396-1-pablo.de.lara.guarch@intel.com> <9249424.xGZGaBmtM9@xps> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, "Wu, Jingjing" To: "De Lara Guarch, Pablo" Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id E68B12C8 for ; Thu, 6 Jul 2017 01:51:41 +0200 (CEST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 20/06/2017 10:34, De Lara Guarch, Pablo: > > > + if (stats_period != 0) { > > > + uint64_t prev_tsc = 0, cur_tsc, timer_tsc = 0; > > > + uint64_t timer_period; > > > + > > > + /* Convert to number of cycles */ > > > + timer_period = stats_period * rte_get_timer_hz(); > > > + > > > + while (1) { > > > + cur_tsc = rte_rdtsc(); > > > + timer_tsc += cur_tsc - prev_tsc; > > > > Please forget (Intel) TSC wording and prefer the more generic > > rte_get_timer_cycles() function. > > Good point, will fix in the v4. Waiting for v4.