From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 172E1A04B0; Fri, 7 Aug 2020 18:29:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 547EB1C0B0; Fri, 7 Aug 2020 18:28:55 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A88961C034 for ; Fri, 7 Aug 2020 18:28:52 +0200 (CEST) IronPort-SDR: rmGopYm1m6qa/rbh0iMmY953YqHJHrg3+uxV4szEVfeKtxVouTQWjEvS9d+Bz73+VngfC8M4H7 QCF3QT7uQZVA== X-IronPort-AV: E=McAfee;i="6000,8403,9706"; a="141003387" X-IronPort-AV: E=Sophos;i="5.75,446,1589266800"; d="scan'208";a="141003387" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2020 09:28:52 -0700 IronPort-SDR: D8Kdubg4OKb9nJ288PKmWzlnZ78vUxRxFLADE1tDg+Hm4O1cQnIDFLkWA3FxAFMnwvs/A0Qtnh DhEReYCxHYig== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,446,1589266800"; d="scan'208";a="323799706" Received: from sivswdev08.ir.intel.com ([10.237.217.47]) by orsmga008.jf.intel.com with ESMTP; 07 Aug 2020 09:28:51 -0700 From: Konstantin Ananyev To: dev@dpdk.org Cc: jerinj@marvell.com, ruifeng.wang@arm.com, vladimir.medvedkin@intel.com, Konstantin Ananyev Date: Fri, 7 Aug 2020 17:28:24 +0100 Message-Id: <20200807162829.11690-3-konstantin.ananyev@intel.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200807162829.11690-1-konstantin.ananyev@intel.com> References: <20200807162829.11690-1-konstantin.ananyev@intel.com> Subject: [dpdk-dev] [PATCH 20.11 2/7] app/acl: few small improvements 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" - enhance output to print extra stats - use rte_rdtsc_precise() for cycle measurements Signed-off-by: Konstantin Ananyev --- app/test-acl/main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/test-acl/main.c b/app/test-acl/main.c index 0a5dfb621..d9b65517c 100644 --- a/app/test-acl/main.c +++ b/app/test-acl/main.c @@ -862,9 +862,10 @@ search_ip5tuples(__rte_unused void *arg) { uint64_t pkt, start, tm; uint32_t i, lcore; + long double st; lcore = rte_lcore_id(); - start = rte_rdtsc(); + start = rte_rdtsc_precise(); pkt = 0; for (i = 0; i != config.iter_num; i++) { @@ -872,12 +873,16 @@ search_ip5tuples(__rte_unused void *arg) config.trace_step, config.alg.name); } - tm = rte_rdtsc() - start; + tm = rte_rdtsc_precise() - start; + + st = (long double)tm / rte_get_timer_hz(); dump_verbose(DUMP_NONE, stdout, "%s @lcore %u: %" PRIu32 " iterations, %" PRIu64 " pkts, %" - PRIu32 " categories, %" PRIu64 " cycles, %#Lf cycles/pkt\n", - __func__, lcore, i, pkt, config.run_categories, - tm, (pkt == 0) ? 0 : (long double)tm / pkt); + PRIu32 " categories, %" PRIu64 " cycles (%.2Lf sec), " + "%.2Lf cycles/pkt, %.2Lf pkt/sec\n", + __func__, lcore, i, pkt, + config.run_categories, tm, st, + (pkt == 0) ? 0 : (long double)tm / pkt, pkt / st); return 0; } -- 2.17.1