From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Hunt, David" Subject: Re: [PATCH v9 12/18] examples/distributor: allow for extra stats Date: Tue, 14 Mar 2017 10:44:28 +0000 Message-ID: <678084d9-1686-7be7-d021-958be5c2a238@intel.com> References: <1488354455-142764-2-git-send-email-david.hunt@intel.com> <1488791433-186137-1-git-send-email-david.hunt@intel.com> <1488791433-186137-13-git-send-email-david.hunt@intel.com> <20170310164641.GC339712@bricha3-MOBL3.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Bruce Richardson Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 6394E69EC for ; Tue, 14 Mar 2017 11:44:30 +0100 (CET) In-Reply-To: <20170310164641.GC339712@bricha3-MOBL3.ger.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/3/2017 4:46 PM, Bruce Richardson wrote: > On Mon, Mar 06, 2017 at 09:10:27AM +0000, David Hunt wrote: >> + freq = rte_get_timer_hz(); >> + t = rte_rdtsc() + freq; >> + while (!quit_signal_dist) { >> + if (t < rte_rdtsc()) { >> + print_stats(); >> + t = rte_rdtsc() + freq; >> + } >> + } >> + > You can probably put in a usleep or nanosleep inot the while loop above. > No need to burn an entire core by polling the tsc. > > /Bruce Done in the next version. Dave.