From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B67759E3 for ; Tue, 20 Jun 2017 10:34:15 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jun 2017 01:34:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,364,1493708400"; d="scan'208";a="115237702" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga005.jf.intel.com with ESMTP; 20 Jun 2017 01:34:13 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 20 Jun 2017 09:34:06 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.133]) by irsmsx155.ger.corp.intel.com ([169.254.14.182]) with mapi id 14.03.0319.002; Tue, 20 Jun 2017 09:34:05 +0100 From: "De Lara Guarch, Pablo" To: Thomas Monjalon CC: "dev@dpdk.org" , "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH v3] app/testpmd: print statistics periodically Thread-Index: AQHS5byCuL4GxorJnUmshKidCG0A5KIsp/cAgADMV4A= Date: Tue, 20 Jun 2017 08:34:05 +0000 Message-ID: References: <20170609014656.27396-1-pablo.de.lara.guarch@intel.com> <20170615014817.12543-1-pablo.de.lara.guarch@intel.com> <9249424.xGZGaBmtM9@xps> In-Reply-To: <9249424.xGZGaBmtM9@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTkxYTMxOGEtMTljOS00NWNmLThjZmMtNDRiYmU3ZWE4ZGUwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImluWmpJUytkK2ZcL0JVQU1NKzFnN1c1MmxEcEY5UWY4M0VUanVIWmxGaThrPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3] app/testpmd: print statistics periodically 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: Tue, 20 Jun 2017 08:34:16 -0000 > -----Original Message----- > From: Thomas Monjalon [mailto:thomas@monjalon.net] > Sent: Monday, June 19, 2017 10:22 PM > To: De Lara Guarch, Pablo > Cc: dev@dpdk.org; Wu, Jingjing > Subject: Re: [dpdk-dev] [PATCH v3] app/testpmd: print statistics > periodically >=20 > 15/06/2017 03:48, Pablo de Lara: > > +print_stats(void) > > +{ > > + uint8_t i; > > + const char clr[] =3D { 27, '[', '2', 'J', '\0' }; > > + const char topLeft[] =3D { 27, '[', '1', ';', '1', 'H', '\0' }; >=20 > Spotted a CamelCase ;) > Is there a punishment planned in the contributor's guide? Sorry, got this from another app, will fix this. >=20 > > + if (stats_period !=3D 0) { > > + uint64_t prev_tsc =3D 0, cur_tsc, timer_tsc =3D 0; > > + uint64_t timer_period; > > + > > + /* Convert to number of cycles */ > > + timer_period =3D stats_period * rte_get_timer_hz(); > > + > > + while (1) { > > + cur_tsc =3D rte_rdtsc(); > > + timer_tsc +=3D cur_tsc - prev_tsc; >=20 > Please forget (Intel) TSC wording and prefer the more generic > rte_get_timer_cycles() function. Good point, will fix in the v4. Thanks, Pablo