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 17FA3A04AD; Fri, 1 May 2020 17:56:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 707B11DA40; Fri, 1 May 2020 17:55:59 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 50E841252 for ; Fri, 1 May 2020 17:55:57 +0200 (CEST) IronPort-SDR: wH2oHanSIEZ/UuvTVw7O/VFBqeQqSR7pTmnBUixQxk1qd6G/rbaqyakEvlZr3OlFAxzzThcwiu 92mfe0O9kwWg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 May 2020 08:55:56 -0700 IronPort-SDR: v0T/3X4bbWfB70r+sQCPvw4BUHD8LOVrB+MHDxLVjP78xRx8pDoRXJKIcoW0vjCkFN8JE6H4Bl hH76yxP4jqrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,340,1583222400"; d="scan'208";a="283210557" Received: from silpixa00399779.ir.intel.com (HELO silpixa00399779.ger.corp.intel.com) ([10.237.222.209]) by fmsmga004.fm.intel.com with ESMTP; 01 May 2020 08:55:55 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: honnappa.nagarahalli@arm.com, phil.yang@arm.com, Harry van Haaren Date: Fri, 1 May 2020 16:56:49 +0100 Message-Id: <20200501155649.2959-1-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] test/service: add perf test for service on app lcore 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" Add a performance test to the service run on app lcore auto- test. This test runs the service in a tight loop, and measures cycles passed, printing the results. It provides a quick cycle cost value, enabling measuring performance of the function to run a service on an application lcore. Signed-off-by: Harry van Haaren --- I'm suggesting to merge this patch before the bugfix/C11 patch series, (v2 currently here: http://patches.dpdk.org/patch/69199/ ) as this would enable users to benchmark the "before" and "after" states of the bugfix/C11 patches easier. --- app/test/test_service_cores.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c index a922c7ddc..469243314 100644 --- a/app/test/test_service_cores.c +++ b/app/test/test_service_cores.c @@ -789,8 +789,18 @@ service_app_lcore_poll_impl(const int mt_safe) "MT Unsafe: App core1 didn't return -EBUSY"); } - unregister_all(); + /* Performance test: call in a loop, and measure tsc() */ + const uint32_t perf_iters = (1 << 12); + uint64_t start = rte_rdtsc(); + for (uint32_t i = 0; i < perf_iters; i++) { + int err = service_run_on_app_core_func(&id); + TEST_ASSERT_EQUAL(0, err, "perf test: returned run failure"); + } + uint64_t end = rte_rdtsc(); + printf("perf test for %s: %0.1f cycles per call\n", mt_safe ? + "MT Safe" : "MT Unsafe", (end - start)/(float)perf_iters); + unregister_all(); return TEST_SUCCESS; } -- 2.17.1