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 587D4A034F; Wed, 6 May 2020 17:44:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 26B7F1DA0D; Wed, 6 May 2020 17:44:38 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 56D481DA0C for ; Wed, 6 May 2020 17:44:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588779875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MhZhAmC9l8xex1awS0o2KIRngCPoeIqwJ4w3iYIDftI=; b=ck3p0O2ANbg1DVxOvBq/NFRQPFrxZGkLs8VTOcQP7iQGp5Wng2z/n7/tCpiGbfdH8paEeM Ek+rkbKSlGnQAkCqQwCxQmSnimrHaBI80dPc+l4YOJco/DhI1bYpFGbxkRE7Zp8FuL+npx nj4I8jFiIcussZYAoqvfHWeUgxvZcpI= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-146-FYZdGBOCPkGS-eyf-OR-7g-1; Wed, 06 May 2020 11:44:31 -0400 X-MC-Unique: FYZdGBOCPkGS-eyf-OR-7g-1 Received: by mail-vk1-f197.google.com with SMTP id n28so753842vkl.4 for ; Wed, 06 May 2020 08:44:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MhZhAmC9l8xex1awS0o2KIRngCPoeIqwJ4w3iYIDftI=; b=jaooPymiYNQjOfgWrn6kFDMWnn5YkMMG57c07KeiXi6ci6J1O4DUYYs+ipyXsBtiB5 4855tbRJpCWDrpWd9C1Q0qnQ+rFkY8Cqpg6xyPo94nFH4e0uUl++yj42PFsv74G0X+5o 7lWMfVimTQ5CLefr82pCXEzhxlwiYUWwoRoppe81RXKJKVtITYJq2ZtWE6/S1TERhWJV 4XoUqD+2tczLgCFPk2KuVe0nI/A2k/6apvQDpP6/JqxeOO3w8d2kMWNvX3DHbW//X6xd JlTxpMhiTOIS3cpVx7XZoRwawytGz7ARJDr0XuWjURCIpwD+Uld1wUXDAKey69Kk355C 9uQA== X-Gm-Message-State: AGi0PuZfZd4WH+8IXLihs1puNlJCgUaH8KFkYSMDdlBTPE4iGo086zk6 DJMtJtzQFfnn0OSKvXWb+Twm6aQ6uRy67rGmOCCh6mxmY2sx3uJpkTjsiVFuN18riahXW1PDCbe fHC3b4QytrprOa01mOaM= X-Received: by 2002:a1f:8fc1:: with SMTP id r184mr7585505vkd.12.1588779870869; Wed, 06 May 2020 08:44:30 -0700 (PDT) X-Google-Smtp-Source: APiQypLIUggbmBtvRPUAK/Rpxi266mxEMrpXuJ/4uhvZKwl7lmI3pNgR2xf1ALCbWZmWZHL7OmbvjkWIgHkiC+vRs2U= X-Received: by 2002:a1f:8fc1:: with SMTP id r184mr7585483vkd.12.1588779870593; Wed, 06 May 2020 08:44:30 -0700 (PDT) MIME-Version: 1.0 References: <20200501155649.2959-1-harry.van.haaren@intel.com> In-Reply-To: <20200501155649.2959-1-harry.van.haaren@intel.com> From: David Marchand Date: Wed, 6 May 2020 17:44:19 +0200 Message-ID: To: Harry van Haaren Cc: dev , Honnappa Nagarahalli , Phil Yang X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [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" On Fri, May 1, 2020 at 5:56 PM Harry van Haaren wrote: > > 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 -EBUS= Y"); > } > > - unregister_all(); > + /* Performance test: call in a loop, and measure tsc() */ > + const uint32_t perf_iters =3D (1 << 12); > + uint64_t start =3D rte_rdtsc(); > + for (uint32_t i =3D 0; i < perf_iters; i++) { - How long does this test take now? We tend to put performance tests in dedicated tests to avoid issues in Trav= is. I suppose this is quick, but still want a confirmation. - Centos7/RHEL7 gcc is not happy with this. http://mails.dpdk.org/archives/test-report/2020-May/129993.html ../app/test/test_service_cores.c: In function =E2=80=98service_app_lcore_po= ll_impl=E2=80=99: ../app/test/test_service_cores.c:795:2: error: =E2=80=98for=E2=80=99 loop i= nitial declarations are only allowed in C99 mode for (uint32_t i =3D 0; i < perf_iters; i++) { ^ ../app/test/test_service_cores.c:795:2: note: use option -std=3Dc99 or -std=3Dgnu99 to compile your code > + int err =3D service_run_on_app_core_func(&id); > + TEST_ASSERT_EQUAL(0, err, "perf test: returned run failur= e"); > + } > + uint64_t end =3D 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; > } > - Can you look at Phil comments too? --=20 David Marchand