From patchwork Fri Apr 28 12:09:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 98358 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp233555qgf; Fri, 28 Apr 2017 05:15:46 -0700 (PDT) X-Received: by 10.36.150.70 with SMTP id z67mr2497750itd.75.1493381746308; Fri, 28 Apr 2017 05:15:46 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u15si6675897iti.26.2017.04.28.05.15.46; Fri, 28 Apr 2017 05:15:46 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id DD3196071A; Fri, 28 Apr 2017 12:15:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 2D0E562C02; Fri, 28 Apr 2017 12:12:00 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id CEBDE606B6; Fri, 28 Apr 2017 12:11:32 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0129.outbound.protection.outlook.com [104.47.0.129]) by lists.linaro.org (Postfix) with ESMTPS id A9A9C62B67 for ; Fri, 28 Apr 2017 12:11:09 +0000 (UTC) Received: from HE1PR0701CA0081.eurprd07.prod.outlook.com (2603:10a6:3:64::25) by DB5PR07MB0903.eurprd07.prod.outlook.com (2a01:111:e400:5105::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.6; Fri, 28 Apr 2017 12:11:07 +0000 Received: from AM5EUR03FT026.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::206) by HE1PR0701CA0081.outlook.office365.com (2603:10a6:3:64::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1 via Frontend Transport; Fri, 28 Apr 2017 12:11:06 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by AM5EUR03FT026.mail.protection.outlook.com (10.152.16.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Fri, 28 Apr 2017 12:11:06 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wrj001652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wmx001645 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 28 Apr 2017 15:09:48 +0300 Message-ID: <20170428120958.17526-2-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170428120958.17526-1-petri.savolainen@linaro.org> References: <20170428120958.17526-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39410400002)(39850400002)(39860400002)(39450400003)(39840400002)(39400400002)(2980300002)(189002)(199003)(9170700003)(110136004)(38730400002)(2950100002)(6916009)(48376002)(36756003)(5660300001)(6666003)(305945005)(50466002)(106466001)(86362001)(77096006)(105596002)(47776003)(50986999)(2351001)(76176999)(189998001)(2906002)(33646002)(22756006)(1076002)(356003)(53936002)(8936002)(81166006)(50226002)(8676002)(5003940100001)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DB5PR07MB0903; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM5EUR03FT026; 1:qJeBKE0nJ8txBHjZGRv1UqbFcv1LDZelSvt1ZUg8oFgwoYRWFRNHDxZZBcOTtQDKKkdrCSuMIQN6q8X8yKSSuugR69fWMI4+jxwpG7gf4ReBSn2EgQQo3mWAvtlKTdOLhR/QkSP5ZghmC5A/lZhelr9QkGV8UmUk9XnHX3CLd/XJv1uBXs0pRdaacrvOyE18cfslqPsOnOk4mLbnGJ3lKncNSSgcE5/hbvBC/9nPtZFBG9he7YKBzEK60rG4Al85QLzBLh3K6I5KP+z/YjoNIb1QuOLwmEc6TEgU4FGFHf/2Y6yjg7zu7HFI5XAfBUL6nC1LH598xB43OHgdZIl80Y2EKSOGG4oItqi/nQg/ZmAjwzYgyKBFMrLey1scFHcKlHPj7y2VvAtkfvOnVReza7Qvj0NoIrmTCVQoSZRqNKwvKBFTsK9xXYcRvLv8FSB6VCRN7+Xbv6dqmPjbJAKNOjjfwsr58s+tndEipP+nU901H9fStFsELgNV7bCHooxMy2CR1PLmuzC93ElU/0ddJA== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 2537640c-5e8c-457b-55d8-08d48e2fa5f7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:DB5PR07MB0903; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB0903; 3:7Y08iCkTExUYCRLY/ifT2+8Qq2jR4Dp+qTQTdj3hBRw+y5juAQ2ymTtwFIiiOvy+p+C+4gIuo3O44Rm2mznytoKIVQldE6Rt4O7+7j1YXuQanS6TVYiE2pZyAAGxnAczDSnlqk6nN8nHOhDMIpAJeEx8HVLb5AzPC0dadkB0UTpFSA1p5CaP4FkPi1NLNSTy02vi5idJI9cUbVuxyJKoFEgVfIZuA59LLWlvGMCz/lCjJLIlKMLg4950b/AKjS/XI5tWAqGDC85jH7nSSWKLJvzlNVBguwy80QaxME9x0VKdT+4tmur9HTS9/rshacVOBFusg6tkzSw5P06h0mO4mSBW3SOXByKV5c9ZlWmDr7yhgPLqxgzJeK6/roxEw39Ny0JymkFXD8Xfe1xrPY9CMRnahSxfxXZB7wrghj24g1pHQ16sBv+j2EI3G2ktIYmYS2ZZBsGCC16NpYvQafrJPQ== X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB0903; 25:cSd4aWvVzzQD5FCZjCjlAogbHdwT60vq9nincv8kFw7dy8+YJbidl1fFtKWkPJCqkl/ih6FhY2qD4dYC5TacLm6+bQSMNTFnqPRsF5ek9djbkT5hN0LIdJvkm9RSlVgq4Yxzz8cjdyvqueDllGU+n8yAabp2DckJ3nQ2/kGG0XrpgbWydRzr6I/wbFBNUTbPTUXazGVQTGrJQNr5AkyUhaoJQQEF+ctkdklMfbuxjkQ/YQW6dGPCqbj1pXIjB0zJE8UySZDGLZm6qpuMPcd5XQa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pm8wvZWwjGgQkG0MXcDPk7i192/j8gI0uHiV2aJwq3GgpRSDL/IqBHj8VAs0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(13013025)(8121501046)(13023025)(13021025)(3002001)(10201501046)(93006095)(93003095)(6055026)(6041248)(20161123564025)(20161123555025)(20161123562025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(6072148); SRVR:DB5PR07MB0903; BCL:0; PCL:0; RULEID:; SRVR:DB5PR07MB0903; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB0903; 4:JUMBMXNckQoHWaVcVTrA0j1asQQBi6mipVaVvkxsWZJbx8MJcz8Rt4COddpTqjdmazlpl8cfDlGfeLp/U5Q8H5YoJVnDhdKD/a/gUE3Ph1dSXuOltRJA+Ata0tPSE789EZrt3kVfcx9F99+h021IiOs3hbOTZOEHWqAXbGjt0KphwRil7e1H7DEUKbT9b2xpxtx0nm+8zXR99KP9tT6YiBWYUs6nHYYFWnBQ3opMkOOJ0b9AWyTT94FvNJQW5gtSNbDa0w0u+xCGN3JIbazi5CbGnJD7kIFz0WGo3vkwitDGUyzVeb+5cAm5EKflBQ47VoP9V0XRYTh5diEAtdNzx28Mb3r9A8hb4BXwAJAP4J0uTWMTKWANBALgdltNolPiot+0H53zEas0kBWaXS8zkMiMI0YN54qhDh0krqvLT1IWfkT7go0LVV4IKCTluSPJvty/j1A1hr9KCwuRJnD6t32n/LSpsWABFZN/L5anEIROSBCNzW5Z6J1v4c7206oIWiBAfK5ggOLI/M1JeaIiD9okneHphL1Wqfjamq/FeqRj6OrzVN6yvjdW/6Hcgvk5LBtM/DWd+AcQsxNyW6PSLvjZZuPTZile304E2jW6sreSdTaM3LwjjC1VhIz1Npl18iNVKCJ9LjXsE+1CkEVWXe7bYqcQ8/X3vOCY1a0tI+MwqH4RA6N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2+x53IpySuQoTQKzIcPZAWvQz9RTvBcZlfdTsDuecfMrg1lRoshIbMjvzWe0MHLeHuWDL8moxTSc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB0903; 7:ImrcI6vZha7gjk6vXjT6/Ue/L2a6hXABx1cu8H4g1Sab4WaNaakN/nDSHO2lfcxmM3XoVXLJrNv5pzo+1XpnKRnPok2WeXOTCGDGh5y6iQghR8Dg6xpuSpATgdvUElHRXdkUKFFWI5nszmHzj+VunX1+wC2yjx0TP5yBo9nJUIOQ/X+cVo41zzl1mUr/vVf/CRlA+CyvuxcWuXAnj1I9Fc1TMUd6HbmAHps5ShssKK/rqmcL9+tH3XT3+nORwC1IiF5Ae2bhCe2pE6f7sTeifTwBUBC+wXSEi5ASdGpYE/JTst7LStKXj3JfpcH2doC1w/+ZeB9z6xqchSAadVjThg== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 12:11:06.3577 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR07MB0903 Subject: [lng-odp] [API-NEXT PATCH v3 01/11] api: time: remove odp_time_to_u64 from API X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Debug function that converts odp_time_t to u64 is unnecessary since odp_time_to_ns() returns time as a u64 (nsec) value. Application can always use that as the 64 bit representation of an odp_time_t value. Also validation tests for odp_time_to_u64() were erroneous since those compared returned u64 values and expected greater/lesser than relation. Signed-off-by: Petri Savolainen --- include/odp/api/spec/time.h | 13 ---------- platform/linux-generic/odp_time.c | 15 ------------ test/common_plat/validation/api/time/time.c | 37 ----------------------------- test/common_plat/validation/api/time/time.h | 2 -- 4 files changed, 67 deletions(-) -- 2.11.0 diff --git a/include/odp/api/spec/time.h b/include/odp/api/spec/time.h index fcc94c98..29175eb5 100644 --- a/include/odp/api/spec/time.h +++ b/include/odp/api/spec/time.h @@ -158,19 +158,6 @@ void odp_time_wait_until(odp_time_t time); void odp_time_wait_ns(uint64_t ns); /** - * Get printable value for an odp_time_t - * - * @param time time to be printed - * - * @return uint64_t value that can be used to print/display this time - * - * @note This routine is intended to be used for diagnostic purposes - * to enable applications to generate a printable value that represents - * an odp_time_t time. - */ -uint64_t odp_time_to_u64(odp_time_t time); - -/** * @} */ diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c index 81e05224..0e5966c0 100644 --- a/platform/linux-generic/odp_time.c +++ b/platform/linux-generic/odp_time.c @@ -176,21 +176,6 @@ void odp_time_wait_until(odp_time_t time) return time_wait_until(time); } -uint64_t odp_time_to_u64(odp_time_t time) -{ - int ret; - struct timespec tres; - uint64_t resolution; - - ret = clock_getres(CLOCK_MONOTONIC_RAW, &tres); - if (odp_unlikely(ret != 0)) - ODP_ABORT("clock_getres failed\n"); - - resolution = (uint64_t)tres.tv_nsec; - - return time_to_ns(time) / resolution; -} - int odp_time_init_global(void) { int ret; diff --git a/test/common_plat/validation/api/time/time.c b/test/common_plat/validation/api/time/time.c index 530d5c07..df65c719 100644 --- a/test/common_plat/validation/api/time/time.c +++ b/test/common_plat/validation/api/time/time.c @@ -398,41 +398,6 @@ void time_test_wait_ns(void) } } -static void time_test_to_u64(time_cb time) -{ - volatile int count = 0; - uint64_t val1, val2; - odp_time_t t1, t2; - - t1 = time(); - - val1 = odp_time_to_u64(t1); - CU_ASSERT(val1 > 0); - - while (count < BUSY_LOOP_CNT) { - count++; - }; - - t2 = time(); - val2 = odp_time_to_u64(t2); - CU_ASSERT(val2 > 0); - - CU_ASSERT(val2 > val1); - - val1 = odp_time_to_u64(ODP_TIME_NULL); - CU_ASSERT(val1 == 0); -} - -void time_test_local_to_u64(void) -{ - time_test_to_u64(odp_time_local); -} - -void time_test_global_to_u64(void) -{ - time_test_to_u64(odp_time_global); -} - odp_testinfo_t time_suite_time[] = { ODP_TEST_INFO(time_test_constants), ODP_TEST_INFO(time_test_local_res), @@ -443,14 +408,12 @@ odp_testinfo_t time_suite_time[] = { ODP_TEST_INFO(time_test_local_sum), ODP_TEST_INFO(time_test_local_wait_until), ODP_TEST_INFO(time_test_wait_ns), - ODP_TEST_INFO(time_test_local_to_u64), ODP_TEST_INFO(time_test_global_res), ODP_TEST_INFO(time_test_global_conversion), ODP_TEST_INFO(time_test_global_cmp), ODP_TEST_INFO(time_test_global_diff), ODP_TEST_INFO(time_test_global_sum), ODP_TEST_INFO(time_test_global_wait_until), - ODP_TEST_INFO(time_test_global_to_u64), ODP_TEST_INFO_NULL }; diff --git a/test/common_plat/validation/api/time/time.h b/test/common_plat/validation/api/time/time.h index e5132a49..10956294 100644 --- a/test/common_plat/validation/api/time/time.h +++ b/test/common_plat/validation/api/time/time.h @@ -24,8 +24,6 @@ void time_test_global_sum(void); void time_test_local_wait_until(void); void time_test_global_wait_until(void); void time_test_wait_ns(void); -void time_test_local_to_u64(void); -void time_test_global_to_u64(void); void time_test_monotony(void); /* test arrays: */ From patchwork Fri Apr 28 12:09:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 98351 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp231490qgf; Fri, 28 Apr 2017 05:11:06 -0700 (PDT) X-Received: by 10.107.55.68 with SMTP id e65mr9576691ioa.55.1493381466658; Fri, 28 Apr 2017 05:11:06 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f42si6064151ioj.37.2017.04.28.05.11.06; Fri, 28 Apr 2017 05:11:06 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 0229662BDC; Fri, 28 Apr 2017 12:11:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D24B5606B6; Fri, 28 Apr 2017 12:11:00 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A944A6068D; Fri, 28 Apr 2017 12:10:58 +0000 (UTC) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30101.outbound.protection.outlook.com [40.107.3.101]) by lists.linaro.org (Postfix) with ESMTPS id 6124260656 for ; Fri, 28 Apr 2017 12:10:57 +0000 (UTC) Received: from VI1PR07CA0046.eurprd07.prod.outlook.com (10.164.94.142) by HE1PR07MB0908.eurprd07.prod.outlook.com (10.162.26.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.6; Fri, 28 Apr 2017 12:10:55 +0000 Received: from VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::204) by VI1PR07CA0046.outlook.office365.com (2a01:111:e400:5967::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1 via Frontend Transport; Fri, 28 Apr 2017 12:10:54 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by VE1EUR03FT014.mail.protection.outlook.com (10.152.19.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Fri, 28 Apr 2017 12:10:54 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wdS001655 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wn0001645 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 28 Apr 2017 15:09:49 +0300 Message-ID: <20170428120958.17526-3-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170428120958.17526-1-petri.savolainen@linaro.org> References: <20170428120958.17526-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39400400002)(39410400002)(39850400002)(39840400002)(39450400003)(39860400002)(2980300002)(189002)(199003)(9170700003)(22756006)(356003)(110136004)(6916009)(2950100002)(305945005)(38730400002)(6666003)(50986999)(76176999)(86362001)(189998001)(47776003)(5660300001)(105596002)(106466001)(33646002)(2351001)(36756003)(5003940100001)(1076002)(50226002)(77096006)(50466002)(48376002)(53936002)(8676002)(81166006)(8936002)(2906002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB0908; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; VE1EUR03FT014; 1:sIdK/e8Pq8FlA8Oo46+l25Sl+pn/Az7c8iad9Dd72Chp9Mql50SlV7bcsuLa83X142Ojot1b+StRrvjC10UJzdwqeriQKeaqZfasPQvTy8qhir4JlmoTJ+ws67WPoNWYs5RXiQLAR6Yzvozojvf9jLPGQNU5YB9Q59rhxvcGc7bZVE9CoTfdGuXJCBOOUw467CpQmrgE/Q3/jEFf4wOQZBabYadAxeBuHGPciPJYcFGCIzTeFUfAsvO1tWNgLQ2bstia+6IKLgEwE7cX+Y2oyD9QvSrqfEIjppOSQQW1PT7p6qSxdRUZ/7dEk9WSGN6Iev+7nP2tvRYQg98os07kXQPKuMtS+RSaqpGpCNrUrOFS37sEVqrGSpFhEas7Rqq/ATSNMRnWU0r+gvXiGWWccy/kgbr5/JH5eQg+ZFWvkjHiEEBECQV9dMHLltLkiofH0JyPJLlS1LUn17Bs1tMw8soAhWtwMgabzLavstfFMpXVtT0Xc904hh4CgNM1bfAylQpUCNu2jQvUHcClf9WhFg== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 74005c13-0d39-42d7-0f15-08d48e2f9ee8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:HE1PR07MB0908; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0908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FVUMvxweTPc2KlznDFSgp8GbZvmUuwzoYeI+CwxhDbyiafm4pq6BroYASR1y+bgBFGOwxCkQuj/BkQ9zUDVDssB9QGCR41nCmx2634sVB+ZS8QEtvZG0IImUwIM+CItUFfUtNeyMdmOhbg9slN/ja1lHdnn5ygiVoG9Vs2IGkOxLuM7LKWTnFnJWYChpiBnoDOjXIIQ== X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0908; 20:6bIh4KATgQCjmL8PvYgZzN+SDbRdZFrWcrS3LThhZKA5QltGiZEKYYjXfQ4Evu/7Koeju9RdZ0Z6pJqkC8XVX6AOdnaPtA70ondngzNxqz6BbTMbIxPR9lZQSd1Cmtziirek11OnGETJO5tG7+vn3a2Gk8zQsfoKkRVUX01tgrQq/qPyEFibSMQm/n3NY9l+xns+mhcBhVZi8ArA2r/AzdEZyhVFbx7kUtrZfPc1REs0KjFSfRExFdovX9RXL5kHj8wfBVu9CnYLIo3MPXhR6CnbNgGxkr7C7uAN4AmBZQg+htcPBe8tNndgYT0mnWfKYz9P0++Ml8b7ZmRz4utG+e1Ets9eOMVTWCcO2qL7yyjjhAXY6cXtF8SyekJVOJJWaA2PInAlVWx4ltdENRZetDUQajhPozkCZAPYPjfxtMSHdTurEBTBo5ArqeG73UlnK89AUomf5dVL/z6kAVtVx2Y3tv2UH3ANZo2jOTnvPNXm9Ueg1sautkG1nn8RNMBYdPtqFiQw5rtV9nKpN3NMoHd4VyeafJmYQ/qfduEVoMDGXsPBwDZhRedEocpm3MsFBgclUBa5QUp2lMnDswtK5G9fsrhz35YfOqhp7CjVyxc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(13013025)(13021025)(13023025)(3002001)(10201501046)(93006095)(93003095)(6055026)(6041248)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123560025)(20161123564025)(20161123555025)(6072148); SRVR:HE1PR07MB0908; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB0908; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0908; 4:TBOv6gcCBJN3LkL4/iRq5KLWg7CSW9Du1gFwLW2qqaa02Apa/9zmJKTH4ZFoB8FN0UDneoTRMaJtUdPHM4gb0lJtshhnAVfXMdjn+VcYzlIqDIqEdgBhYk6xLENt4pSHcgI/bmWiR90qWMfk6h7KBgC6EpeE2j/pveHxYKIW0lqP76CuiC2bfIvJ1LwjS+92iZ32fBSWvtyM095qq5oMj8Jn+E2hHNj/A9Gw4tLeRWAeMDF6ycku5KZchrssOcAuj9TCfLveA5oujyvscdoPqy1s6stN4j6wjUvITH4TaH4twiHNWyiiSMHhnUyjj/jQwf/eg25c4OUYQWKEm2/n+gxUCr4sAZJfREK/eJbJsvwbFplBCfp8y3leGj040IwzrUWNZxtTIe0Rimv/V4B+4xFA1RqceukRk2xa4iLcJLjbq7Ht9oEJ42NEDPPTjsCMFHcfS0Y7b+cAtbyTaZWJYgJuFM30SbwCYsc/Z053mhvP3TMQbtFUs4GRpgMTRY1EuQcgE6H6LX0FpJcKnfnQWP/sCY2UA4UpqtFcDsMxciJJdPGdJuzE7LG7uHwCSSNGqtDp1l/Z9XMRkN2pF3nBkVLUhEYRi8bfId/P06yQ0gaJdNVQBwt+8TmIbG2dRTOORXQJQynsqWub1PcRRzJBXoJk1OcAcldWYqME7TXQzqF+ct3xHnh2mq8E4u3UMFg9Tn7hrxJgxjQzgEfqcLt+LDSJm7VGbx7TXd9M8AE1OBVc2iCzwC3jbKXP+f97v2l4tDFFbgEcxyCzSOAvxEX9cb3mWepU8hXWH0uGQpoNu51yynJXVZCRKDjtxbSefWRXHVMFECgoJT2MCqMA215DQ6gt0X8QtncueLehOVC92ps= X-Forefront-PRVS: 029174C036 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR07MB0908; 23:Le/+sg9NWAIPFZU/dVoUCr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96WUKI2RjuJrlk0xrCE0HMnT0BQCkveddEH6+bVRJy1Fmbf9SxQI3f6NsKZXT0C1LgA3/bGjbPTWgj+gnZD3S+3lDWZCThdGi/BXLaJE5UWBxCbHtQwxWQG8ownv3fc8CcIx+KNfHXPTmhcHn+09xpcW7w6sFzgVD9lQQkyDEy2+kVX3/2BgqMdIqBlDW1Le721beSSb0lSgA== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 12:10:54.4979 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB0908 Subject: [lng-odp] [API-NEXT PATCH v3 02/11] api: system: added system info print X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" This information specifies the system where ODP application is running for debugging purposes. Signed-off-by: Petri Savolainen --- include/odp/api/spec/system_info.h | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.11.0 diff --git a/include/odp/api/spec/system_info.h b/include/odp/api/spec/system_info.h index 0bb4f1f1..ca4dcdc7 100644 --- a/include/odp/api/spec/system_info.h +++ b/include/odp/api/spec/system_info.h @@ -45,6 +45,15 @@ uint64_t odp_sys_page_size(void); int odp_sys_cache_line_size(void); /** + * Print system info + * + * Print out implementation defined information about the system. This + * information is intended for debugging purposes and may contain e.g. + * information about CPUs, memory and other HW configuration. + */ +void odp_sys_info_print(void); + +/** * @} */ From patchwork Fri Apr 28 12:09:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 98360 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp234431qgf; Fri, 28 Apr 2017 05:17:48 -0700 (PDT) X-Received: by 10.200.50.143 with SMTP id z15mr9375307qta.114.1493381868029; Fri, 28 Apr 2017 05:17:48 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j185si5658686qkc.55.2017.04.28.05.17.47; Fri, 28 Apr 2017 05:17:48 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 94CA762B67; Fri, 28 Apr 2017 12:17:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D664062C2F; Fri, 28 Apr 2017 12:12:12 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id AA54B62BCA; Fri, 28 Apr 2017 12:11:38 +0000 (UTC) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10094.outbound.protection.outlook.com [40.107.1.94]) by lists.linaro.org (Postfix) with ESMTPS id 90F4462BDC for ; Fri, 28 Apr 2017 12:11:15 +0000 (UTC) Received: from HE1PR0701CA0077.eurprd07.prod.outlook.com (10.168.122.21) by VI1PR07MB0909.eurprd07.prod.outlook.com (10.161.108.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.6; Fri, 28 Apr 2017 12:11:12 +0000 Received: from AM5EUR03FT026.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::202) by HE1PR0701CA0077.outlook.office365.com (2603:10a6:3:64::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1 via Frontend Transport; Fri, 28 Apr 2017 12:11:12 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by AM5EUR03FT026.mail.protection.outlook.com (10.152.16.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Fri, 28 Apr 2017 12:11:12 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wmM001658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wn1001645 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 28 Apr 2017 15:09:50 +0300 Message-ID: <20170428120958.17526-4-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170428120958.17526-1-petri.savolainen@linaro.org> References: <20170428120958.17526-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39400400002)(39410400002)(39450400003)(39840400002)(39860400002)(2980300002)(199003)(189002)(9170700003)(2950100002)(6916009)(53936002)(38730400002)(110136004)(2906002)(22756006)(356003)(8936002)(81166006)(106466001)(50226002)(305945005)(86362001)(33646002)(77096006)(1076002)(5660300001)(6666003)(2351001)(48376002)(47776003)(189998001)(5003940100001)(76176999)(36756003)(50986999)(50466002)(105596002)(8676002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB0909; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM5EUR03FT026; 1:41x8Bt3A316iiHom97LtUKiTCAPGKSVlQtK7W4R2ZYJH8SvgdoI0BV8kIGu4vKcySpItQiZ/65CXVK9m1iYpMbKPgBgoT5RVVn/tz2wCUMzeUyRWV0CuoWzrXmXtKKfp1llLNI61Xly+wcLGXEG3Mx4CtcAanzba9xt6dNasqPkONlelO/OAF2MSeRxspZTtlB9b4ULUVZI1UDdChvdrUhBphJG8JxS7hFV75lon02rXj14v+u9mp136ZIyNo2Ym2TvL8b9VXVvM8JTipahkVR2lCNI6O0FH6ztG3lgHKRcQoX3eKjWZeT9qvl9veQo2v8MhHJE0bLsD1VAOwLZrCUI4TkRzDSka2B4R8IFdBRKAEj8A4BnN5sRrqQaxkATMvt0eb776jEVdSjOTuhnYU0Bci6wSYH0xgACcMFVvw9HaFwjCJr9r4eA/hLepdcXY67BgupJiOKgtIVrx2uaAsZ6NEgkBx9oioMf0RD71tCqBesidLgxEPHEApIpvHx+eK/ud5266VPEjvOhk7HwZgQ== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 5d3946c5-475c-44c9-33c3-08d48e2fa960 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:VI1PR07MB0909; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0909; 3:BVWCYuqOrGJ/j/YwuWywomGNO3L0YlhOb0e6UiurblJb5ATjdAf19Ttm0ygMipUoEg+2l95/0KcoC5WMxPREYrxuM3ND3o42mgMW797sAwBq3a9nFZn3TE2FQq4uvH1iaJk8tYKCeh1Xs7yhkxH4PsPs+FoILZpzYhQC4FZQLTbG7IsapthOdbsvfAeSOHFS3AQYedrwXueLcx2R2LGznvI7ZBlc/yVzXpUJZiRW5/Kk3iH+CswroH+QXQYdKYaHuAqieQs/ERI54ZveS7z3VwCzKMYwczsXAYJIq3jpP3dpG9cilwsyW1H8JHfA/FQ9+E7Vu9yTDiUCILomEa9DANYE0r+bMeTBbwb6lD4GcaCTqW0/1YK+ttUKRBgI43s2C7jJcSkTTeydi+glos6AUjnywPsVcEyfbWFAWgSTQedZ8Ny1LoSnqpJO+Kxzc0ed3XnjcylvK577Cs3kChRC2w== X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0909; 25:w3SKPMYLu0wJfD71sRX3S5bAYT/faJihLckr/jyMTW1p13PMFtyW8bgIyDL8sArnEgbzjubk8Gg5mQHe5L++lHjy6Hsi2VlNNAMtcKghAwcC37C7ld+f+EA7sTXXLliR2Z7u/KFT+cjFHE1YLS6W4BMPTWwrZ75sAOCBmW/YSG/WpiAfh6d9JBq2G8Eo+tP73fCUInLMKpkBu9YDwFpN9n/ewPAmjYtLVCf1ti7iZfOVvwRkBroVew4+AqupGaY9UWFMEWnGJQlXQq10gJIUaa2yOxrpMLBjLD1PzTF00NkakjPipDoTor3ougYv9iZ7JkNb85iFL95jo2qzvPL1vynS4k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RVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(13013025)(8121501046)(13023025)(13021025)(10201501046)(3002001)(93006095)(93003095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123555025)(20161123564025)(20161123558100)(20161123562025)(20161123560025)(6072148); SRVR:VI1PR07MB0909; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB0909; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0909; 4:MC6+pMhapQS7m1yZqLmlUeStR/mRRxA2qNzU2dP2aHozI/4MwbBCf6UC6CMpiI1bkMBf1YFNA8EyMUHu/4+1iEZvUVWcIQR4ozSfwv2UajXmI47qn1m51AemtcniFs+RD+uiBEb/v5KIkCZBMWfG1N1joUSiyj+D5dfC0v8Nk56KS79Rc4JvbpcA8kVezlyDOXGKBZ7Imp/vnD+ABYPckL2Cjs5uOwSCbcU5OshQVWSWFKFar4Kp1/gXfshNSfi7gWTx3NWf7ul4Zb6xSawDIy0MF0JVAZWTO0+QmHwZlUUztFJqLuRYj2WhCeTPZiSuHhiXWktEAJgeI9TVrgNJu7f8bQMpaDghnyvWn4/pemthcQyIGDJPCYVOvYJ8Tco5WrSoh2QLVEnbRFTIXL05yqQVJrX7R4MXyPlhtvRUJkE4YQ2Wzi1dckO3dcKW7lgwWSSMhODUTyVwjNBDfv0rFV9hfJq5ttgV8M50kgBLKXoiF+PNpduET6ylX/Z75258JoIopa5q/CcmcRlQk0SFig+OYsSXPdpu1ezrfG7HaJ66h6E51F9GlFjK4I8NJvHSxu1pvwBL4w62dtgQGGVVyFc5TI2kgw2C5aNt7g8/bBRTwUpoP1X8kwHZgbaXLB066SNxZg4n1n0KgG1eu7+hxvgVrFsJixEBvmmbh24X05gpSBlKVuH77YfaYFZ98z/ZdRSO7FZ0YKgfyvdj7vj1KwIbblNQjL2JFQhOOv8L+0FS7T3LoegfVU2GbB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OduOm6J/c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0909; 7:Ky3GLOwzXsY6wI6wNEqScEFNXqYGMRNFPpDuuVGWPU2NfFfMOAPUuyXWNHWT7vyEz1DNtPeKsgj7/xwOIFIllXCK3fidrzmYqcBdTHeB1CujQe1+y6JshMCZyxGUyNawskrDY+szpHF2+bvBXtDqGcDoQ+3pjnJrGvbpOxaIfpktWWBuyXhwyzn4Y4wNMxkK6ULKA/WO6lk19ujgRzOfl6jUMtHwxA5osml6ltCmDZw9z1zrHED/GtBVWgKseANknF76quO/Gd9KdvuW/n/T4RbZdPTFfjrtGXX+y1tSRH+NxT/+HdbggJ2OoSk02n4tFqRB2Ni77KGDbtIWreS75w== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 12:11:12.0625 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB0909 Subject: [lng-odp] [API-NEXT PATCH v3 03/11] linux-gen: cpu_flags: added x86 cpu flag read functions X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" When building on x86 CPU flags can be used to determine which CPU features are supported. CPU flag definitions and the code to read the flags is from DPDK. Signed-off-by: Petri Savolainen --- configure.ac | 1 + platform/Makefile.inc | 4 +- platform/linux-generic/Makefile.am | 4 + platform/linux-generic/arch/x86/cpu_flags.c | 359 ++++++++++++++++++++++++++++ platform/linux-generic/arch/x86/cpu_flags.h | 20 ++ 5 files changed, 387 insertions(+), 1 deletion(-) create mode 100644 platform/linux-generic/arch/x86/cpu_flags.c create mode 100644 platform/linux-generic/arch/x86/cpu_flags.h -- 2.11.0 diff --git a/configure.ac b/configure.ac index e86e2dca..38129030 100644 --- a/configure.ac +++ b/configure.ac @@ -224,6 +224,7 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "x${DOXYGEN}" = "xdoxygen"]) AM_CONDITIONAL([user_guide], [test "x${user_guides}" = "xyes" ]) AM_CONDITIONAL([HAVE_MSCGEN], [test "x${MSCGEN}" = "xmscgen"]) AM_CONDITIONAL([helper_linux], [test x$helper_linux = xyes ]) +AM_CONDITIONAL([ARCH_IS_X86], [test "x${ARCH_DIR}" = "xx86"]) ########################################################################## # Setup doxygen documentation diff --git a/platform/Makefile.inc b/platform/Makefile.inc index b4cc2433..c5b17b57 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -112,4 +112,6 @@ EXTRA_DIST = \ arch/powerpc/odp_sysinfo_parse.c \ arch/x86/odp/api/cpu_arch.h \ arch/x86/odp_cpu_arch.c \ - arch/x86/odp_sysinfo_parse.c + arch/x86/odp_sysinfo_parse.c \ + arch/x86/cpu_flags.c \ + arch/x86/cpu_flags.h diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 58c8ea1b..ab74c14c 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -253,6 +253,10 @@ __LIB__libodp_linux_la_SOURCES = \ arch/@ARCH_DIR@/odp_cpu_arch.c \ arch/@ARCH_DIR@/odp_sysinfo_parse.c +if ARCH_IS_X86 +__LIB__libodp_linux_la_SOURCES += arch/@ARCH_DIR@/cpu_flags.c +endif + if HAVE_PCAP __LIB__libodp_linux_la_SOURCES += pktio/pcap.c endif diff --git a/platform/linux-generic/arch/x86/cpu_flags.c b/platform/linux-generic/arch/x86/cpu_flags.c new file mode 100644 index 00000000..954dac27 --- /dev/null +++ b/platform/linux-generic/arch/x86/cpu_flags.c @@ -0,0 +1,359 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/*- + * BSD LICENSE + * + * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include + +enum rte_cpu_flag_t { + /* (EAX 01h) ECX features*/ + RTE_CPUFLAG_SSE3 = 0, /**< SSE3 */ + RTE_CPUFLAG_PCLMULQDQ, /**< PCLMULQDQ */ + RTE_CPUFLAG_DTES64, /**< DTES64 */ + RTE_CPUFLAG_MONITOR, /**< MONITOR */ + RTE_CPUFLAG_DS_CPL, /**< DS_CPL */ + RTE_CPUFLAG_VMX, /**< VMX */ + RTE_CPUFLAG_SMX, /**< SMX */ + RTE_CPUFLAG_EIST, /**< EIST */ + RTE_CPUFLAG_TM2, /**< TM2 */ + RTE_CPUFLAG_SSSE3, /**< SSSE3 */ + RTE_CPUFLAG_CNXT_ID, /**< CNXT_ID */ + RTE_CPUFLAG_FMA, /**< FMA */ + RTE_CPUFLAG_CMPXCHG16B, /**< CMPXCHG16B */ + RTE_CPUFLAG_XTPR, /**< XTPR */ + RTE_CPUFLAG_PDCM, /**< PDCM */ + RTE_CPUFLAG_PCID, /**< PCID */ + RTE_CPUFLAG_DCA, /**< DCA */ + RTE_CPUFLAG_SSE4_1, /**< SSE4_1 */ + RTE_CPUFLAG_SSE4_2, /**< SSE4_2 */ + RTE_CPUFLAG_X2APIC, /**< X2APIC */ + RTE_CPUFLAG_MOVBE, /**< MOVBE */ + RTE_CPUFLAG_POPCNT, /**< POPCNT */ + RTE_CPUFLAG_TSC_DEADLINE, /**< TSC_DEADLINE */ + RTE_CPUFLAG_AES, /**< AES */ + RTE_CPUFLAG_XSAVE, /**< XSAVE */ + RTE_CPUFLAG_OSXSAVE, /**< OSXSAVE */ + RTE_CPUFLAG_AVX, /**< AVX */ + RTE_CPUFLAG_F16C, /**< F16C */ + RTE_CPUFLAG_RDRAND, /**< RDRAND */ + + /* (EAX 01h) EDX features */ + RTE_CPUFLAG_FPU, /**< FPU */ + RTE_CPUFLAG_VME, /**< VME */ + RTE_CPUFLAG_DE, /**< DE */ + RTE_CPUFLAG_PSE, /**< PSE */ + RTE_CPUFLAG_TSC, /**< TSC */ + RTE_CPUFLAG_MSR, /**< MSR */ + RTE_CPUFLAG_PAE, /**< PAE */ + RTE_CPUFLAG_MCE, /**< MCE */ + RTE_CPUFLAG_CX8, /**< CX8 */ + RTE_CPUFLAG_APIC, /**< APIC */ + RTE_CPUFLAG_SEP, /**< SEP */ + RTE_CPUFLAG_MTRR, /**< MTRR */ + RTE_CPUFLAG_PGE, /**< PGE */ + RTE_CPUFLAG_MCA, /**< MCA */ + RTE_CPUFLAG_CMOV, /**< CMOV */ + RTE_CPUFLAG_PAT, /**< PAT */ + RTE_CPUFLAG_PSE36, /**< PSE36 */ + RTE_CPUFLAG_PSN, /**< PSN */ + RTE_CPUFLAG_CLFSH, /**< CLFSH */ + RTE_CPUFLAG_DS, /**< DS */ + RTE_CPUFLAG_ACPI, /**< ACPI */ + RTE_CPUFLAG_MMX, /**< MMX */ + RTE_CPUFLAG_FXSR, /**< FXSR */ + RTE_CPUFLAG_SSE, /**< SSE */ + RTE_CPUFLAG_SSE2, /**< SSE2 */ + RTE_CPUFLAG_SS, /**< SS */ + RTE_CPUFLAG_HTT, /**< HTT */ + RTE_CPUFLAG_TM, /**< TM */ + RTE_CPUFLAG_PBE, /**< PBE */ + + /* (EAX 06h) EAX features */ + RTE_CPUFLAG_DIGTEMP, /**< DIGTEMP */ + RTE_CPUFLAG_TRBOBST, /**< TRBOBST */ + RTE_CPUFLAG_ARAT, /**< ARAT */ + RTE_CPUFLAG_PLN, /**< PLN */ + RTE_CPUFLAG_ECMD, /**< ECMD */ + RTE_CPUFLAG_PTM, /**< PTM */ + + /* (EAX 06h) ECX features */ + RTE_CPUFLAG_MPERF_APERF_MSR, /**< MPERF_APERF_MSR */ + RTE_CPUFLAG_ACNT2, /**< ACNT2 */ + RTE_CPUFLAG_ENERGY_EFF, /**< ENERGY_EFF */ + + /* (EAX 07h, ECX 0h) EBX features */ + RTE_CPUFLAG_FSGSBASE, /**< FSGSBASE */ + RTE_CPUFLAG_BMI1, /**< BMI1 */ + RTE_CPUFLAG_HLE, /**< Hardware Lock elision */ + RTE_CPUFLAG_AVX2, /**< AVX2 */ + RTE_CPUFLAG_SMEP, /**< SMEP */ + RTE_CPUFLAG_BMI2, /**< BMI2 */ + RTE_CPUFLAG_ERMS, /**< ERMS */ + RTE_CPUFLAG_INVPCID, /**< INVPCID */ + RTE_CPUFLAG_RTM, /**< Transactional memory */ + RTE_CPUFLAG_AVX512F, /**< AVX512F */ + + /* (EAX 80000001h) ECX features */ + RTE_CPUFLAG_LAHF_SAHF, /**< LAHF_SAHF */ + RTE_CPUFLAG_LZCNT, /**< LZCNT */ + + /* (EAX 80000001h) EDX features */ + RTE_CPUFLAG_SYSCALL, /**< SYSCALL */ + RTE_CPUFLAG_XD, /**< XD */ + RTE_CPUFLAG_1GB_PG, /**< 1GB_PG */ + RTE_CPUFLAG_RDTSCP, /**< RDTSCP */ + RTE_CPUFLAG_EM64T, /**< EM64T */ + + /* (EAX 80000007h) EDX features */ + RTE_CPUFLAG_INVTSC, /**< INVTSC */ + + /* The last item */ + RTE_CPUFLAG_NUMFLAGS, /**< This should always be the last! */ +}; + +enum cpu_register_t { + RTE_REG_EAX = 0, + RTE_REG_EBX, + RTE_REG_ECX, + RTE_REG_EDX, +}; + +typedef uint32_t cpuid_registers_t[4]; + +/** + * Struct to hold a processor feature entry + */ +struct feature_entry { + uint32_t leaf; /**< cpuid leaf */ + uint32_t subleaf; /**< cpuid subleaf */ + uint32_t reg; /**< cpuid register */ + uint32_t bit; /**< cpuid register bit */ +#define CPU_FLAG_NAME_MAX_LEN 64 + char name[CPU_FLAG_NAME_MAX_LEN]; /**< String for printing */ +}; + +#define FEAT_DEF(name, leaf, subleaf, reg, bit) \ + [RTE_CPUFLAG_##name] = {leaf, subleaf, reg, bit, #name }, + +static const struct feature_entry cpu_feature_table[] = { + FEAT_DEF(SSE3, 0x00000001, 0, RTE_REG_ECX, 0) + FEAT_DEF(PCLMULQDQ, 0x00000001, 0, RTE_REG_ECX, 1) + FEAT_DEF(DTES64, 0x00000001, 0, RTE_REG_ECX, 2) + FEAT_DEF(MONITOR, 0x00000001, 0, RTE_REG_ECX, 3) + FEAT_DEF(DS_CPL, 0x00000001, 0, RTE_REG_ECX, 4) + FEAT_DEF(VMX, 0x00000001, 0, RTE_REG_ECX, 5) + FEAT_DEF(SMX, 0x00000001, 0, RTE_REG_ECX, 6) + FEAT_DEF(EIST, 0x00000001, 0, RTE_REG_ECX, 7) + FEAT_DEF(TM2, 0x00000001, 0, RTE_REG_ECX, 8) + FEAT_DEF(SSSE3, 0x00000001, 0, RTE_REG_ECX, 9) + FEAT_DEF(CNXT_ID, 0x00000001, 0, RTE_REG_ECX, 10) + FEAT_DEF(FMA, 0x00000001, 0, RTE_REG_ECX, 12) + FEAT_DEF(CMPXCHG16B, 0x00000001, 0, RTE_REG_ECX, 13) + FEAT_DEF(XTPR, 0x00000001, 0, RTE_REG_ECX, 14) + FEAT_DEF(PDCM, 0x00000001, 0, RTE_REG_ECX, 15) + FEAT_DEF(PCID, 0x00000001, 0, RTE_REG_ECX, 17) + FEAT_DEF(DCA, 0x00000001, 0, RTE_REG_ECX, 18) + FEAT_DEF(SSE4_1, 0x00000001, 0, RTE_REG_ECX, 19) + FEAT_DEF(SSE4_2, 0x00000001, 0, RTE_REG_ECX, 20) + FEAT_DEF(X2APIC, 0x00000001, 0, RTE_REG_ECX, 21) + FEAT_DEF(MOVBE, 0x00000001, 0, RTE_REG_ECX, 22) + FEAT_DEF(POPCNT, 0x00000001, 0, RTE_REG_ECX, 23) + FEAT_DEF(TSC_DEADLINE, 0x00000001, 0, RTE_REG_ECX, 24) + FEAT_DEF(AES, 0x00000001, 0, RTE_REG_ECX, 25) + FEAT_DEF(XSAVE, 0x00000001, 0, RTE_REG_ECX, 26) + FEAT_DEF(OSXSAVE, 0x00000001, 0, RTE_REG_ECX, 27) + FEAT_DEF(AVX, 0x00000001, 0, RTE_REG_ECX, 28) + FEAT_DEF(F16C, 0x00000001, 0, RTE_REG_ECX, 29) + FEAT_DEF(RDRAND, 0x00000001, 0, RTE_REG_ECX, 30) + + FEAT_DEF(FPU, 0x00000001, 0, RTE_REG_EDX, 0) + FEAT_DEF(VME, 0x00000001, 0, RTE_REG_EDX, 1) + FEAT_DEF(DE, 0x00000001, 0, RTE_REG_EDX, 2) + FEAT_DEF(PSE, 0x00000001, 0, RTE_REG_EDX, 3) + FEAT_DEF(TSC, 0x00000001, 0, RTE_REG_EDX, 4) + FEAT_DEF(MSR, 0x00000001, 0, RTE_REG_EDX, 5) + FEAT_DEF(PAE, 0x00000001, 0, RTE_REG_EDX, 6) + FEAT_DEF(MCE, 0x00000001, 0, RTE_REG_EDX, 7) + FEAT_DEF(CX8, 0x00000001, 0, RTE_REG_EDX, 8) + FEAT_DEF(APIC, 0x00000001, 0, RTE_REG_EDX, 9) + FEAT_DEF(SEP, 0x00000001, 0, RTE_REG_EDX, 11) + FEAT_DEF(MTRR, 0x00000001, 0, RTE_REG_EDX, 12) + FEAT_DEF(PGE, 0x00000001, 0, RTE_REG_EDX, 13) + FEAT_DEF(MCA, 0x00000001, 0, RTE_REG_EDX, 14) + FEAT_DEF(CMOV, 0x00000001, 0, RTE_REG_EDX, 15) + FEAT_DEF(PAT, 0x00000001, 0, RTE_REG_EDX, 16) + FEAT_DEF(PSE36, 0x00000001, 0, RTE_REG_EDX, 17) + FEAT_DEF(PSN, 0x00000001, 0, RTE_REG_EDX, 18) + FEAT_DEF(CLFSH, 0x00000001, 0, RTE_REG_EDX, 19) + FEAT_DEF(DS, 0x00000001, 0, RTE_REG_EDX, 21) + FEAT_DEF(ACPI, 0x00000001, 0, RTE_REG_EDX, 22) + FEAT_DEF(MMX, 0x00000001, 0, RTE_REG_EDX, 23) + FEAT_DEF(FXSR, 0x00000001, 0, RTE_REG_EDX, 24) + FEAT_DEF(SSE, 0x00000001, 0, RTE_REG_EDX, 25) + FEAT_DEF(SSE2, 0x00000001, 0, RTE_REG_EDX, 26) + FEAT_DEF(SS, 0x00000001, 0, RTE_REG_EDX, 27) + FEAT_DEF(HTT, 0x00000001, 0, RTE_REG_EDX, 28) + FEAT_DEF(TM, 0x00000001, 0, RTE_REG_EDX, 29) + FEAT_DEF(PBE, 0x00000001, 0, RTE_REG_EDX, 31) + + FEAT_DEF(DIGTEMP, 0x00000006, 0, RTE_REG_EAX, 0) + FEAT_DEF(TRBOBST, 0x00000006, 0, RTE_REG_EAX, 1) + FEAT_DEF(ARAT, 0x00000006, 0, RTE_REG_EAX, 2) + FEAT_DEF(PLN, 0x00000006, 0, RTE_REG_EAX, 4) + FEAT_DEF(ECMD, 0x00000006, 0, RTE_REG_EAX, 5) + FEAT_DEF(PTM, 0x00000006, 0, RTE_REG_EAX, 6) + + FEAT_DEF(MPERF_APERF_MSR, 0x00000006, 0, RTE_REG_ECX, 0) + FEAT_DEF(ACNT2, 0x00000006, 0, RTE_REG_ECX, 1) + FEAT_DEF(ENERGY_EFF, 0x00000006, 0, RTE_REG_ECX, 3) + + FEAT_DEF(FSGSBASE, 0x00000007, 0, RTE_REG_EBX, 0) + FEAT_DEF(BMI1, 0x00000007, 0, RTE_REG_EBX, 2) + FEAT_DEF(HLE, 0x00000007, 0, RTE_REG_EBX, 4) + FEAT_DEF(AVX2, 0x00000007, 0, RTE_REG_EBX, 5) + FEAT_DEF(SMEP, 0x00000007, 0, RTE_REG_EBX, 6) + FEAT_DEF(BMI2, 0x00000007, 0, RTE_REG_EBX, 7) + FEAT_DEF(ERMS, 0x00000007, 0, RTE_REG_EBX, 8) + FEAT_DEF(INVPCID, 0x00000007, 0, RTE_REG_EBX, 10) + FEAT_DEF(RTM, 0x00000007, 0, RTE_REG_EBX, 11) + FEAT_DEF(AVX512F, 0x00000007, 0, RTE_REG_EBX, 16) + + FEAT_DEF(LAHF_SAHF, 0x80000001, 0, RTE_REG_ECX, 0) + FEAT_DEF(LZCNT, 0x80000001, 0, RTE_REG_ECX, 4) + + FEAT_DEF(SYSCALL, 0x80000001, 0, RTE_REG_EDX, 11) + FEAT_DEF(XD, 0x80000001, 0, RTE_REG_EDX, 20) + FEAT_DEF(1GB_PG, 0x80000001, 0, RTE_REG_EDX, 26) + FEAT_DEF(RDTSCP, 0x80000001, 0, RTE_REG_EDX, 27) + FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29) + + FEAT_DEF(INVTSC, 0x80000007, 0, RTE_REG_EDX, 8) +}; + +/* + * Execute CPUID instruction and get contents of a specific register + * + * This function, when compiled with GCC, will generate architecture-neutral + * code, as per GCC manual. + */ +static void cpu_get_features(uint32_t leaf, uint32_t subleaf, + cpuid_registers_t out) +{ +#if defined(__i386__) && defined(__PIC__) + /* %ebx is a forbidden register if we compile with -fPIC or -fPIE */ + __asm__ __volatile__("movl %%ebx,%0 ; cpuid ; xchgl %%ebx,%0" + : "=r" (out[RTE_REG_EBX]), + "=a" (out[RTE_REG_EAX]), + "=c" (out[RTE_REG_ECX]), + "=d" (out[RTE_REG_EDX]) + : "a" (leaf), "c" (subleaf)); +#else + __asm__ __volatile__("cpuid" + : "=a" (out[RTE_REG_EAX]), + "=b" (out[RTE_REG_EBX]), + "=c" (out[RTE_REG_ECX]), + "=d" (out[RTE_REG_EDX]) + : "a" (leaf), "c" (subleaf)); +#endif +} + +static int cpu_get_flag_enabled(enum rte_cpu_flag_t feature) +{ + const struct feature_entry *feat; + cpuid_registers_t regs; + + if (feature >= RTE_CPUFLAG_NUMFLAGS) + /* Flag does not match anything in the feature tables */ + return -1; + + feat = &cpu_feature_table[feature]; + + if (!feat->leaf) + /* This entry in the table wasn't filled out! */ + return -1; + + cpu_get_features(feat->leaf & 0xffff0000, 0, regs); + if (((regs[RTE_REG_EAX] ^ feat->leaf) & 0xffff0000) || + regs[RTE_REG_EAX] < feat->leaf) + return 0; + + /* get the cpuid leaf containing the desired feature */ + cpu_get_features(feat->leaf, feat->subleaf, regs); + + /* check if the feature is enabled */ + return (regs[feat->reg] >> feat->bit) & 1; +} + +static const char *cpu_get_flag_name(enum rte_cpu_flag_t feature) +{ + if (feature >= RTE_CPUFLAG_NUMFLAGS) + return NULL; + return cpu_feature_table[feature].name; +} + +void cpu_flags_print_all(void) +{ + int len, i; + int max_str = 1024; + int max_len = max_str - 1; + char str[max_str]; + + len = snprintf(str, max_len, "\nCPU features supported:\n"); + + for (i = 0; i < RTE_CPUFLAG_NUMFLAGS; i++) { + if (cpu_get_flag_enabled(i) > 0) + len += snprintf(&str[len], max_len - len, "%s ", + cpu_get_flag_name(i)); + } + + len += snprintf(&str[len], max_len - len, + "\n\nCPU features NOT supported:\n"); + + for (i = 0; i < RTE_CPUFLAG_NUMFLAGS; i++) { + if (cpu_get_flag_enabled(i) <= 0) + len += snprintf(&str[len], max_len - len, "%s ", + cpu_get_flag_name(i)); + } + + len += snprintf(&str[len], max_len - len, "\n\n"); + + str[len] = '\0'; + ODP_PRINT("%s", str); +} diff --git a/platform/linux-generic/arch/x86/cpu_flags.h b/platform/linux-generic/arch/x86/cpu_flags.h new file mode 100644 index 00000000..f709ca08 --- /dev/null +++ b/platform/linux-generic/arch/x86/cpu_flags.h @@ -0,0 +1,20 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_PLAT_CPU_FLAGS_H_ +#define ODP_PLAT_CPU_FLAGS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +void cpu_flags_print_all(void); + +#ifdef __cplusplus +} +#endif + +#endif From patchwork Fri Apr 28 12:09:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 98357 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp233208qgf; Fri, 28 Apr 2017 05:15:00 -0700 (PDT) X-Received: by 10.107.38.132 with SMTP id m126mr10318646iom.176.1493381699967; Fri, 28 Apr 2017 05:14:59 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j5si6154487ioj.127.2017.04.28.05.14.58; Fri, 28 Apr 2017 05:14:59 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id AB24B62BE0; Fri, 28 Apr 2017 12:14:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D166262C26; Fri, 28 Apr 2017 12:11:55 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 83E9B606B6; Fri, 28 Apr 2017 12:11:32 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0138.outbound.protection.outlook.com [104.47.0.138]) by lists.linaro.org (Postfix) with ESMTPS id 5AA2362B8C for ; Fri, 28 Apr 2017 12:11:10 +0000 (UTC) Received: from HE1PR0701CA0081.eurprd07.prod.outlook.com (10.168.122.25) by HE1PR0701MB2121.eurprd07.prod.outlook.com (10.168.36.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1; Fri, 28 Apr 2017 12:11:08 +0000 Received: from AM5EUR03FT026.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::206) by HE1PR0701CA0081.outlook.office365.com (2603:10a6:3:64::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1 via Frontend Transport; Fri, 28 Apr 2017 12:11:08 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by AM5EUR03FT026.mail.protection.outlook.com (10.152.16.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Fri, 28 Apr 2017 12:11:07 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wZ3001661 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wn2001645 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 28 Apr 2017 15:09:51 +0300 Message-ID: <20170428120958.17526-5-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170428120958.17526-1-petri.savolainen@linaro.org> References: <20170428120958.17526-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39840400002)(39410400002)(39400400002)(39850400002)(39860400002)(39450400003)(2980300002)(189002)(199003)(9170700003)(86362001)(36756003)(2351001)(305945005)(53936002)(81166006)(6916009)(2950100002)(6666003)(8676002)(77096006)(110136004)(38730400002)(33646002)(356003)(5003940100001)(2906002)(106466001)(189998001)(5660300001)(105596002)(48376002)(8936002)(47776003)(50226002)(76176999)(50986999)(1076002)(22756006)(50466002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0701MB2121; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM5EUR03FT026; 1:sYLF7709oEBbcJg21hOy2RO3j70SxivxFT0LzdY7Af1sY6DdzSpSVxNJ838v1lzOjkNzN8uog4xM1pebUOTy75gpA+RulNcq1GUdkva2b9F6y1XkBd3aTFXFmRLPLHnVoNU6bF41IG5jk7Hy8cFYucTi46mewnWRtb7l5Tbx+FdpQXFnimeBLFs9XAj0nD1BcmmSHfSmkr6V19cSPwU0r6UExu9nw99u4xkFpD/D7PwW5a4Lr0oeZFPkRqFikLgKJP0zAO3Lzd7U33EscwV03xoG7hUA8pq9Oji7UHEk/pSthE9aKwCVa9tQTa2wMKs+0ghW5ccnTDDjCig4huHqgmPJHIeSnMK2OHs+sIuXvtqRdmgX+SJPQsqJ5YclJKNr+TPtivcpAmE5nF346G5cetCamDNyepdCzJ6BchJGosRIwUxaUVaRwFQKUDZw7aSk2NEMNXSEm10NprrNr18LUjpG4ZvBhPEwT0hMBxNKtAvfmTW0gtx02OUgSM2t3WVxSe6lHKMprDy2uXLWDIgLlg== MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2b9adb73-5338-4810-1164-08d48e2fa6f4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:HE1PR0701MB2121; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2121; 3:/Wo8Z5LCObtG5aV/cpyGxD+GLtBbCTbCss2qYcqrXWQbItNJDWJi1h8ywZ2rD2TukJa98S+udiN74N8GRQTbpRVxBkkL//gaGh6ivA2QMRHJGg+cGdbZjrjw43Vuxwslwe2/E3Xn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s6WXRllbvV/AQ0eOm4ygY0toCwshmqs0MONF8AJ3etNy46wnHtCSv5YICieTBwieF1/6852D7g== X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2121; 20:Q+9t1pmlW01zhteEk06kR3OW6KKTaYrALk1dPTYWdYXFzFDAAue25VvLQ01TImFzIgVtwL4UFJeB6K6grl/CmxtV/PViXl2bb1wVBjTFUfQt55OimcXtsbuyohgjWBx8VBYOrlzv4RBtQfBVBl2ztoQgfh11DSyS9mWgXS7XCfpDVjiVfMZTTB8+/C7MKMkrclx1+uvUr4UwDFOCXTXRDAMx+/kBxxJ+ChA7Fhf6Q1AS6X8mKChm7B51qE6rzbIV4NvBktx6ZOTfRvX802GAJPUpfyWvPeQ2vHWfjakRzK0GaSyIWfCy+43ZoMJc2VJkuPtPmobSvV/pvU0XQBBPCKBkyieR1gVYszircgVQauLNLbTN47G47VQWJBHffj3eZewCg+wgiBP5O5cKt7ExpfSfGRjTr+bARaJXklvqPwV+NA4RrIzF0oftr9Kr4hOOGTUlXWmHtzfXdkbpRcW0bcmhcfMyIyo8BESoLFWYVHz+YEKVTMo07vtw7USLjoYrO5r4dPUqtkBhr7v7V0azagYSVPQCTjHuuWlogFrUlCn8i3Q36tcQgNLXC4+7cl/zkW2yyUB79Q1d3wqszxclx7wTXzFcs2leEcoAA6jqkAA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13021025)(13023025)(5005006)(13013025)(8121501046)(93006095)(93003095)(10201501046)(3002001)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148); SRVR:HE1PR0701MB2121; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0701MB2121; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2121; 4:ED1b1HdbtDQRoghZ+r2IIyqL3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EsajJ7Jk1qvTyYSDNFlJZlqdzI0e66yzj8XS/m/Seg9cGeR2mJWadeGalTzqlXxDtQ3E9b9J6FJqMak+Qu5K4SocHZ7vT65B4ZEGysWJkfQPJp23Hj1V05bDqJooOlovGRU9rULEpsVNpNGwTNoL3TliL7sRZETndQRe5bVyO7/WBA6q01Iq17Z3HRyriR265tt88e+hvJJiRt33/bVdq6MY8KKQd6l336uoM6/uDOffx9tqlRkXbizI062YdiK7t5fFdyw/v0/Tefo7S5AyVaqT9dkv3wZhgC5ziSJ9nLIjDMtnAFAIMQf4EWzELw+5RQauN/gXbxy5ekSu+U9LHXeoOlL/uHYU07cQaJVQ865oeba5RZio6CCi/I6ai6hontqlvn3L66s3yYX/sr+h+6Nw4LxsD/UszJhefYdm+yW9q7ysd66HqDHGZW1um9c=; 5:CmCt2lzQOKJianLZqzSBuoCT7HPX6kPpgP+xGrxAN4qNmGPtoVa5CuzgFttbvZQcCPclafTOpkOlF/IqASfpIB1gUujewCC0XPTM6gRzg/XJdMGW5dwypPNDUaIaPy4ORT6k42ssNWqspTslxb0caA==; 24:fFZNwROyImxlrTW+QAq7K0ll0ww80iNQCV7AbIMyRuBmJCxmrLsBy8YMmpLTXbm8OWrBma9lC+Cn8+Q+9hWEhxNsnLvJlwZNuPoICU2/52A= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2121; 7:lnsBdw7c/RXx8ah9YLk4Up14jrtbe/VmPKwitfEDUwORZlkki2Hsn1BrpjP8bGWIzy31Xm6p4nNa6f7gVjjhhR1KrOWA4UYz2BNRzYhTU8FNeQSnmn4vU2/N6eY8BWlZ/D7sqCP+2CO3FT1sjYibALBTURn5ibs6N4MJy+c3Px6+wxdXBZDiR0hN21mG8a0ulzSfcsuwOxwN0RmmWSbQmBF9KzEEvED3xdBhvKy2qntf0MsaQn92Lp53YUEO7audghWjNbdgeSh0gipXczlTuvdWeWSHwCLh+Mln8yx0LVwiOLl8tpFxe7tF8Gkk5OAcaMZr3LIhBZUYyXf3l59TdA== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 12:11:07.9983 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0701MB2121 Subject: [lng-odp] [API-NEXT PATCH v3 04/11] linux-gen: system: implement system info print X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Print API, impl name, CPU model/freq, cache line size and CPU count by default. Print CPU flags in case of x86. Signed-off-by: Petri Savolainen --- .../linux-generic/arch/arm/odp_sysinfo_parse.c | 4 +++ .../linux-generic/arch/default/odp_sysinfo_parse.c | 4 +++ .../linux-generic/arch/mips64/odp_sysinfo_parse.c | 4 +++ .../linux-generic/arch/powerpc/odp_sysinfo_parse.c | 4 +++ .../linux-generic/arch/x86/odp_sysinfo_parse.c | 6 +++++ platform/linux-generic/include/odp_internal.h | 1 + platform/linux-generic/odp_system_info.c | 30 ++++++++++++++++++++++ 7 files changed, 53 insertions(+) -- 2.11.0 diff --git a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c index 53e2aaea..8ae2022a 100644 --- a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c @@ -25,3 +25,7 @@ uint64_t odp_cpu_hz_current(int id ODP_UNUSED) { return 0; } + +void sys_info_print_arch(void) +{ +} diff --git a/platform/linux-generic/arch/default/odp_sysinfo_parse.c b/platform/linux-generic/arch/default/odp_sysinfo_parse.c index 53e2aaea..8ae2022a 100644 --- a/platform/linux-generic/arch/default/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/default/odp_sysinfo_parse.c @@ -25,3 +25,7 @@ uint64_t odp_cpu_hz_current(int id ODP_UNUSED) { return 0; } + +void sys_info_print_arch(void) +{ +} diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c index 407264b7..d6f75f28 100644 --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c @@ -62,3 +62,7 @@ uint64_t odp_cpu_hz_current(int id ODP_UNUSED) { return 0; } + +void sys_info_print_arch(void) +{ +} diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c index 3b88d55b..bd4b9b42 100644 --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c @@ -61,3 +61,7 @@ uint64_t odp_cpu_hz_current(int id ODP_UNUSED) { return 0; } + +void sys_info_print_arch(void) +{ +} diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c index 96127ec6..d77165a4 100644 --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c @@ -5,6 +5,7 @@ */ #include +#include #include int cpuinfo_parser(FILE *file, system_info_t *sysinfo) @@ -73,3 +74,8 @@ uint64_t odp_cpu_hz_current(int id) return 0; } + +void sys_info_print_arch(void) +{ + cpu_flags_print_all(); +} diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index acfc3012..90e2a629 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -133,6 +133,7 @@ int _odp_modules_init_global(void); int cpuinfo_parser(FILE *file, system_info_t *sysinfo); uint64_t odp_cpu_hz_current(int id); +void sys_info_print_arch(void); #ifdef __cplusplus } diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index 18c61dbe..40ffca07 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -405,3 +406,32 @@ int odp_cpu_count(void) { return odp_global_data.system_info.cpu_count; } + +void odp_sys_info_print(void) +{ + int len; + int max_len = 512; + char str[max_len]; + + len = snprintf(str, max_len, "\n" + "ODP system info\n" + "---------------\n" + "ODP API version: %s\n" + "ODP impl name: %s\n" + "CPU model: %s\n" + "CPU freq (hz): %" PRIu64 "\n" + "Cache line size: %i\n" + "CPU count: %i\n" + "\n", + odp_version_api_str(), + odp_version_impl_name(), + odp_cpu_model_str(), + odp_cpu_hz_max(), + odp_sys_cache_line_size(), + odp_cpu_count()); + + str[len] = '\0'; + ODP_PRINT("%s", str); + + sys_info_print_arch(); +} From patchwork Fri Apr 28 12:09:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 98352 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp231757qgf; Fri, 28 Apr 2017 05:11:42 -0700 (PDT) X-Received: by 10.107.147.135 with SMTP id v129mr11281932iod.233.1493381502582; Fri, 28 Apr 2017 05:11:42 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y20si376161ita.1.2017.04.28.05.11.42; Fri, 28 Apr 2017 05:11:42 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 261CA62BE0; Fri, 28 Apr 2017 12:11:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 0C70D606B6; Fri, 28 Apr 2017 12:11:35 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 021B362BFF; Fri, 28 Apr 2017 12:11:29 +0000 (UTC) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0091.outbound.protection.outlook.com [104.47.1.91]) by lists.linaro.org (Postfix) with ESMTPS id 4DB9A6068D for ; Fri, 28 Apr 2017 12:11:04 +0000 (UTC) Received: from HE1PR0701CA0059.eurprd07.prod.outlook.com (10.168.191.27) by VI1PR0701MB2127.eurprd07.prod.outlook.com (10.169.137.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1; Fri, 28 Apr 2017 12:11:02 +0000 Received: from DB5EUR03FT054.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::203) by HE1PR0701CA0059.outlook.office365.com (2603:10a6:3:9e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.6 via Frontend Transport; Fri, 28 Apr 2017 12:11:02 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by DB5EUR03FT054.mail.protection.outlook.com (10.152.20.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Fri, 28 Apr 2017 12:11:01 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9w2u001664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wn3001645 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 28 Apr 2017 15:09:52 +0300 Message-ID: <20170428120958.17526-6-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170428120958.17526-1-petri.savolainen@linaro.org> References: <20170428120958.17526-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(39450400003)(39840400002)(39410400002)(39400400002)(39850400002)(2980300002)(199003)(189002)(9170700003)(6666003)(6916009)(2950100002)(50466002)(1076002)(189998001)(48376002)(22756006)(5660300001)(86362001)(2906002)(2351001)(36756003)(47776003)(106466001)(105596002)(33646002)(50226002)(305945005)(5003940100001)(110136004)(8936002)(38730400002)(77096006)(76176999)(356003)(50986999)(53936002)(81166006)(8676002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0701MB2127; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB5EUR03FT054; 1:F3JV0gyn3mnU2ND4Mfe4ARVaROJ25JsIi33QMpgAiqzIvKJ6tTdXxILd9AscwylXKlLcnYOZcHJeTuk7MPzwMiFiFivtVhb5H1N/XMaJD8Yt7f7cXeKkNZFc8D3+8Tw8FfxZD74SXZG0SSEpz0G8mhDHY86PZj7IkToeG3LGIwbHSLeoJWdws1X8O3NuBPcELKYT0dtfjMRo0I/rOt+SmmCfrDABXqrEprvaDGTYfgRCzPLgVMfBIa3SAQb10RlP/W+hknLFMtEU6+w/uzyJcicionIU+nUz+lRPWFYVm4RoP/iJ9OXnhvG8VeTqxCSu6ZO7ZQgccJXagJtr76oZ5wMk1KER2mpgwMeVQ8bPqoBiUt/o7rtkzaHKP3SYl06V1qLy2PvRJz4o1027+g5CBEmWJiSiQYBtM+PM2n+cHsQ12ZCCImtoUaJEmpyAdF+5cP55bwV72KD2fvO3GcOYIHnFswv73lgV2UJrWOp9lAJhqMPyj4MBTQx1WPtQrop5yzv8n3sJGIckOh+WQalZ5g== MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e23e145c-013b-4811-8f9d-08d48e2fa345 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:VI1PR0701MB2127; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0701MB2127; 3:nCSxpT8VbvhLC1qWH7BNbCA6MepcL/MZOQk+RNOvi7Xs29KSsLT5u7v9m7glA438fKG/anQyBGyDco24r2dSex2eSFZwrhgcdhI0CrjxtrAWFKOOPgp+M5vbmwextNBauBAHQFfb0u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heN/9JRkFRSLzyULKStczt/Gr0XWXv2kaLPw01VkQ8PvKvVeFa0zO58VItcYLObLTau1clF90oCUfIiViYw== X-Microsoft-Exchange-Diagnostics: 1; VI1PR0701MB2127; 20:EZJod/Ca6lNI4cMzAH6iSux38aU4deTi5Hq6D6Tf1nL5pcTVpZGKHXOOoX6BPJTzGnxpHoBQIqrZLrDKSZUNleHydG0iQQPAIvVaKGkQ1R1gMRenp3TNzhwQQJ1Qkknn7asv8bradpwYowmGYJV5lXwyI1nXeHdGuNPUBls8SOIM/QQDijZjzoXoQLp/g4h97UzdCUQdOkQC5bRjBFkrPZKcF1p003GlC7/XrEcxr40aahCJMT5UGB+LkDXqB5wI9Yn3QQMPAI0566MgF4nfTMkkEuinxmfj6g2+SrPt53YyNY79sTAfHEZlfYKMh5+5cFh0ik/SMcKFIOdt5N60u0pyY9ATou2p40cxSoDDcNzZ2d0gSRLCfnFtCm4M2Y8q51R3cziHivjx229rJTHFd9Ej45hEaIfhL/t+lFuvGZXMsLfA4m0Lo45P/2r3pMj8+XYsuGVraQmcop1iQp/MPaPqSGKPP3mY6g9j2FkH23Tf9Rc4bveECtIF2HDhAkh1rrkXriaAJi3yBIjPaR54AdYEdHeI1sw1ElViBt92Mo3WDlVntqRP63sZmrMkKLy5iWhH+KkwuLiLPEd7gHkXrO5UfgOBU53bi7GTiQL5zFY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(13023025)(13013025)(13021025)(3002001)(10201501046)(93006095)(93003095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123560025)(20161123558100)(20161123564025)(20161123562025)(20161123555025)(6072148); SRVR:VI1PR0701MB2127; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0701MB2127; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0701MB2127; 4:S6JzcRENYpvFbbn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ICGxGmO5ghGHOVxAB5RlQH+GDlBycMeg5IzUN22Zb0WlTfIIhB2aP9kpXxz/HJmjcA== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 12:11:01.8059 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0701MB2127 Subject: [lng-odp] [API-NEXT PATCH v3 05/11] test: validation: add odp_sys_info_print test X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Added validation test for the new system info print call. Signed-off-by: Petri Savolainen --- test/common_plat/validation/api/system/system.c | 8 ++++++++ test/common_plat/validation/api/system/system.h | 1 + 2 files changed, 9 insertions(+) -- 2.11.0 diff --git a/test/common_plat/validation/api/system/system.c b/test/common_plat/validation/api/system/system.c index 57ff34eb..5b7ca01a 100644 --- a/test/common_plat/validation/api/system/system.c +++ b/test/common_plat/validation/api/system/system.c @@ -301,6 +301,13 @@ void system_test_odp_cpu_hz_max_id(void) } } +void system_test_info_print(void) +{ + printf("\n\nCalling system info print...\n"); + odp_sys_info_print(); + printf("...done. "); +} + odp_testinfo_t system_suite[] = { ODP_TEST_INFO(system_test_odp_version_numbers), ODP_TEST_INFO(system_test_odp_cpu_count), @@ -319,6 +326,7 @@ odp_testinfo_t system_suite[] = { ODP_TEST_INFO(system_test_odp_cpu_cycles_max), ODP_TEST_INFO(system_test_odp_cpu_cycles_resolution), ODP_TEST_INFO(system_test_odp_cpu_cycles_diff), + ODP_TEST_INFO(system_test_info_print), ODP_TEST_INFO_NULL, }; diff --git a/test/common_plat/validation/api/system/system.h b/test/common_plat/validation/api/system/system.h index cbb994eb..c33729b9 100644 --- a/test/common_plat/validation/api/system/system.h +++ b/test/common_plat/validation/api/system/system.h @@ -30,6 +30,7 @@ void system_test_odp_cpu_cycles_max(void); void system_test_odp_cpu_cycles(void); void system_test_odp_cpu_cycles_diff(void); void system_test_odp_cpu_cycles_resolution(void); +void system_test_info_print(void); /* test arrays: */ extern odp_testinfo_t system_suite[]; From patchwork Fri Apr 28 12:09:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 98354 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp232298qgf; Fri, 28 Apr 2017 05:12:59 -0700 (PDT) X-Received: by 10.55.50.204 with SMTP id y195mr9091993qky.264.1493381579213; Fri, 28 Apr 2017 05:12:59 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d63si3305439qkf.11.2017.04.28.05.12.59; Fri, 28 Apr 2017 05:12:59 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D93E362B67; Fri, 28 Apr 2017 12:12:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id B48A762BCA; Fri, 28 Apr 2017 12:11:42 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id B21D060A54; Fri, 28 Apr 2017 12:11:30 +0000 (UTC) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20121.outbound.protection.outlook.com [40.107.2.121]) by lists.linaro.org (Postfix) with ESMTPS id 8027062B68 for ; Fri, 28 Apr 2017 12:11:04 +0000 (UTC) Received: from VI1PR07CA0080.eurprd07.prod.outlook.com (10.164.94.176) by VI1PR07MB0910.eurprd07.prod.outlook.com (10.161.108.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.6; Fri, 28 Apr 2017 12:11:02 +0000 Received: from VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::208) by VI1PR07CA0080.outlook.office365.com (2a01:111:e400:5967::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1 via Frontend Transport; Fri, 28 Apr 2017 12:11:02 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by VE1EUR03FT014.mail.protection.outlook.com (10.152.19.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Fri, 28 Apr 2017 12:11:02 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9w0R001667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wn4001645 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 28 Apr 2017 15:09:53 +0300 Message-ID: <20170428120958.17526-7-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170428120958.17526-1-petri.savolainen@linaro.org> References: <20170428120958.17526-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39840400002)(39410400002)(39400400002)(39450400003)(39850400002)(39860400002)(2980300002)(189002)(199003)(9170700003)(22756006)(305945005)(86362001)(1076002)(2351001)(6916009)(189998001)(33646002)(2906002)(2950100002)(6666003)(105596002)(106466001)(76176999)(50986999)(77096006)(5660300001)(38730400002)(8676002)(110136004)(8936002)(5003940100001)(50226002)(36756003)(53936002)(47776003)(81166006)(356003)(50466002)(48376002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB0910; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; VE1EUR03FT014; 1:x1QRLKmpBJu6Dj/AVJvcZyNIQCb/tJv4enjxtHv8Ut+KUdvexdotMl10/KztDqu8SnKvaJwEOWSNmzXmyDEuQKA2lwlXWEr6Wx79IfA+nAkh6mSVf30RlG0nzy2SJQ7xWJwvWzrAd+vptpjE3DmUt3SLI8yZ/AbhVlV5Ojpgcb7YpixUY6r1ifHiKcYaVICVorjwYeUND4MLc7S+5GQDPbMVy6NwArdzKi7ar6Qmj9CLh1vUgP2IH6Yb1J8sLPfggkUfXa8GFCHRy6s2FlupbFyqOdiGo4tiz2LvzLp88yiv27AhnK7P6hEkZhrBog3Y9HccpPNMK8yfQhOjqU82Xi9emeb+pi41nS1FS+BmZRS8oR9sPCUbiMK7dXZGPgqlnX+2SEo/3QsjqmP5F0ktnzZbhjfyM9RjWo40y28cP7OHxeFoyJDQEEkGZ16aIXJAySUWBLlXu1kY22UJo7dUBi8pz8o7txX0I4QiA7ASdd3xXWhPpHcdlaUCKxGj2z0h/UMD48wLwx7iDh3lzxO50Q== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 2e0f3fe2-cca7-4606-7d3b-08d48e2fa38e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:VI1PR07MB0910; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0910; 3:OCUCk5ql2TsQRNZYMDldS832DvubWdVox8mef+QeD5r36iDvr6HZUVoYwa5E2RYM82SUXRjP0kMYM9gHixJ/SYUN0/qjxgOWGwbDCJKD6RAwsGgisLr6WdiR94q0exlhUau6QlDc7T5wggml+147wJLdmEK0VQWyDSCS3M/q8YvpHhZx1U4WV5q/JYkM98BL5x5yg4BolgJXF2VY/NEIso+AV0ybWWo3L0bbEt3VBpz7zhhYjea3tF922BtU2iFLiTNQmIzitIiIefvdriH22IiPaIahp2eg2IO0eZ1VZhxgcRt50yGTzSFfevt6EZIw3j4E7zvx6PU+/kskFgZzdfcHxUMVNOgtlgwGMO7dL7HHfqzBpu242QdHbCkosGB16UmBaBH/ZiyByT2jhyGtYqnbxDup1Q53q0E8hH7s58z2PHoFVlH3TA6mfPzmJYs+STyEH1dSzc5Ihr6Di4TrbQ== X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0910; 25:CHlUt8RlDe5X2qK0Kg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bsSebVes4iqcYPj7n1HNSNQJQm8pkqPV94sHAtura9tC+cZOc7/swvJlY9wKpaYsUBPNKIWiLb2A16v5ajEj78HZw4SqLb2T2PR5/p7yMAYhTQv7jhw5afLN3lsltgT7Sa6cqV7QKRIDE7EBxAr6UUJI/s+RCz2ihVj8XNgWTYcuS8yH3CTA2M7aZPCDSnxqui6HuZdiHmkf7GtWsZdgUkYfSwAsF8y4NEpurXY6AjD+gHktFD04qb65qr3jiknOIC/gDAA5Ep/Q7dlUXoayBQh6Qzkt1Odc0cDO+dk+Onzj6zuu2O6EVhSvSFNmdHi44LmvzNWePF5IFn4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13023025)(13021025)(13013025)(8121501046)(5005006)(93006095)(93003095)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123560025)(20161123564025)(6072148); SRVR:VI1PR07MB0910; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB0910; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0910; 4:p3z1LjIe5yqHyy/BeM6FBbt6XaCfCE4j2V/5CT0Gy/Q4jDZIA2pxxCdkoS1ycY392uLsmAxc9QziwaWwiyCDX+EDmwjbEKwtSjnfmkBk/j3aWRGdIF2RuvLXWOhSlUUy8yNeHq4jp06aPii8R1Z2BdBJKpcHs4EezP109JlASnkxxew32SAs4f7Po2R4uicCi0/bCHrR47Mkj+xa1dARCWIWNSYZb3oKNiX/QIpLx1q/uLPdGpWZh6BTsQGb1EMhpzLlFQXeWv9xWmYwcGm9gO4F2iKr3STazrHyD4UayLL8cm4Xq0dot/xpRA//yLhivOW3xGVLtsAfYhZaYn2IXHLn/rZ71IRBRvPbWOOYXfjvM252a+gfqH7U/FGxy8lMhg27DQP3NSLuoXD7oUGQrgd45f/dc4ok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DB//3bsYfbt+w8qMv30bBDbUYrXEDcR/obEMoxB7ahSk6I=; 5:sTGFGCHVFUIlErg4PkS6TYlR2QZgAjym4QndOpYpUcDyIVeY/K+C90kwiu2RD5xSm7gp7c0rVxYRcmj7KtBx1qCpi6eZt0R0IEqUSRXzMHAQlD6DGrlVooyDcdDA8JZvjAPvO0//J+4F7QIAKsePQQ==; 24:e/AIkSHOC8RiVXalC1W7fnEFdtHAnPxfjTjBuDYXdsva7NP/kT4d1XU6ZcpMnl6Y4kYGeP26FdQgpgJKft5mvzo/XCImEPSYKyVXFusVr70= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0910; 7:rsA7+kG91Oe//hUUzkgg3pLSP27marCq7YhgF3VJT07ASnSNBcECeBk/Il2Zq0KPSYE8Ka7CQ4B+Lm9eBl+UMsH6GwpOsIzG/e5bM4VtPKePviOypJz6zJuYRbS5zE/eaQUf4/oDjyeZOUjDOlgNzunGO5eHy/U5stmF0Z0h5lEqxg3kl+nulRJ2S8c09W9tNKSR6OKgkK7b7ObCcUt58OcLATZcZ6hNJEKkuC8Umt+Lruhuol1dfwEyARORzoGfKgHv+jYayWW4d29UViFR11e48mKP39haguHZ+I8rB6EiDRfXk5TtXWKEy8yxnOmXmLT9M3/ifF37xAJ8NutQEQ== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 12:11:02.2995 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB0910 Subject: [lng-odp] [API-NEXT PATCH v3 06/11] test: sched_latency: use sys_info_print X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Use the new system info print function. Signed-off-by: Petri Savolainen --- test/common_plat/performance/odp_sched_latency.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) -- 2.11.0 diff --git a/test/common_plat/performance/odp_sched_latency.c b/test/common_plat/performance/odp_sched_latency.c index 2b28cd7b..f2aac06f 100644 --- a/test/common_plat/performance/odp_sched_latency.c +++ b/test/common_plat/performance/odp_sched_latency.c @@ -634,16 +634,7 @@ int main(int argc, char *argv[]) return -1; } - printf("\n"); - printf("ODP system info\n"); - printf("---------------\n"); - printf("ODP API version: %s\n", odp_version_api_str()); - printf("ODP impl name: %s\n", odp_version_impl_name()); - printf("ODP impl details: %s\n", odp_version_impl_str()); - printf("CPU model: %s\n", odp_cpu_model_str()); - printf("CPU freq (hz): %" PRIu64 "\n", odp_cpu_hz_max()); - printf("Cache line size: %i\n", odp_sys_cache_line_size()); - printf("Max CPU count: %i\n", odp_cpu_count()); + odp_sys_info_print(); /* Get default worker cpumask */ if (args.cpu_count) @@ -654,9 +645,10 @@ int main(int argc, char *argv[]) (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); - printf("Worker threads: %i\n", num_workers); - printf("First CPU: %i\n", odp_cpumask_first(&cpumask)); - printf("CPU mask: %s\n\n", cpumaskstr); + printf("CPU mask info:\n"); + printf(" Worker threads: %i\n", num_workers); + printf(" First CPU: %i\n", odp_cpumask_first(&cpumask)); + printf(" CPU mask: %s\n", cpumaskstr); thread_tbl = calloc(sizeof(odph_odpthread_t), num_workers); if (!thread_tbl) { From patchwork Fri Apr 28 12:09:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 98355 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp232533qgf; Fri, 28 Apr 2017 05:13:29 -0700 (PDT) X-Received: by 10.55.128.198 with SMTP id b189mr8942270qkd.301.1493381609044; Fri, 28 Apr 2017 05:13:29 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f8si5491583qkb.180.2017.04.28.05.13.28; Fri, 28 Apr 2017 05:13:29 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id B0B0462C22; Fri, 28 Apr 2017 12:13:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 0661362BC4; Fri, 28 Apr 2017 12:11:46 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E06EA62008; Fri, 28 Apr 2017 12:11:30 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0116.outbound.protection.outlook.com [104.47.0.116]) by lists.linaro.org (Postfix) with ESMTPS id 865676201B for ; Fri, 28 Apr 2017 12:11:05 +0000 (UTC) Received: from VI1PR0701CA0069.eurprd07.prod.outlook.com (2603:10a6:800:5f::31) by AM2PR07MB0900.eurprd07.prod.outlook.com (2a01:111:e400:8428::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1; Fri, 28 Apr 2017 12:11:03 +0000 Received: from DB5EUR03FT025.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::202) by VI1PR0701CA0069.outlook.office365.com (2603:10a6:800:5f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1 via Frontend Transport; Fri, 28 Apr 2017 12:11:03 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by DB5EUR03FT025.mail.protection.outlook.com (10.152.20.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Fri, 28 Apr 2017 12:11:02 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wqV001670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wn5001645 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 28 Apr 2017 15:09:54 +0300 Message-ID: <20170428120958.17526-8-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170428120958.17526-1-petri.savolainen@linaro.org> References: <20170428120958.17526-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39840400002)(39860400002)(39450400003)(39410400002)(39400400002)(39850400002)(2980300002)(199003)(189002)(9170700003)(50986999)(1076002)(76176999)(2906002)(81166006)(48376002)(50226002)(22756006)(8936002)(8676002)(38730400002)(356003)(47776003)(110136004)(50466002)(33646002)(106466001)(305945005)(2950100002)(189998001)(6666003)(6916009)(53936002)(5003940100001)(105596002)(36756003)(86362001)(2351001)(77096006)(5660300001)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:AM2PR07MB0900; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB5EUR03FT025; 1:so/dOWhrKpe0d9LOBlIWQ/4tGCyfQlz/b7Xlg3p16dCzcjF22bqMNjCDpE38EV0/iQUzkBDdFgtl1R2hOAS04Fhw+b/rKeucQZCv+lVynnmjnceFE01SgzwzFsY1id7fr4o0Z2jxJss1zPtqzLX4MCACnRUyVFFTgZOE8n0V/+JYlgIFT2uQmwst5QLmzH/yvjLrMbnVmg5IsidzCkVUihxJAUbStS1M8+2AcUQqWSR6/+yeJuQjg3SozuolIX8XLMkbLvO40luZND+hfcJuie8msDJyOSnI5Mm+cVugkZnolLfpTU2m/XGy7U3eYi/5yp7fxE27amgqQkWdzzT1bY4xpPvJafY86z/23rOvK/DzBhbgc7kY1hqg5iVUkXiCCGKOrl/KPH2hQ1sjVoxDXeBjVNiEp3IKthW3eRSpeV2FouaUakRnmqh6BozDnfo8C0zq90HiM2c0TigFXDPlbyiBNNlYzTtK8bDcVk3UmO9t7ybKWJhbBkT5WHugV7547VKWIaR3lCl7h4Ts7dYJQQ== MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1fbd8c6f-0c76-402c-bc03-08d48e2fa3f1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:AM2PR07MB0900; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0900; 3:t0/+KJJI5KHKl35RDRaZiCzYFwcLoqJBu1AyfAJdGsDzWF8L6S/2g4RYGIStNDGakrnL1W4QIiNoHsSNf7k736CytPcGytw5SWHUxS7Ekyqi1+WIEXF8iYQyBNbKSIwE/y+33mq8yJPB/lbtA00F3czgIs+gViPXqM2h/My1V+94xow9lC2w+Do/dD9/IYBKSWhIbvbe8rDB5cXKqWTLvDQzAg//0RC9rYxqB6pSVKvq9ibd2yHDEOuSPGD+xNwzu6dxRqFt0Fm/weq8BkqRxOxz35nnyBvhoUkehIJACOEdBayp7UOK3kW+W0i8X1lsG6nr8vk1h3US3qj2W7vARI1tj0jv3Sn+TCQeNYuYhCfcwxH3SuZUB3VQim+IUwI28J5P1ls1hQG0mpO1xuqYK+lnvNqvFX34UbJ4JL6wa3ryxxv8t6G4ZR5VuNpYSEtxw2GVPoeCv5GkYmCF6VpQmg== X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0900; 25:qsMi8ZAHJadYT7KXCN9zgFD6mmwSuBXj1tGfxhLaei892UicdOCvLEy2QbCY74wKy0Zu9Z+S8bVu01AUqzbIdHzm8ZHARerhJ8BHI96x89xhxY+xvfi1YHY8DDcLMtKFz/G6TA3PrHdnDanvBqkxWJHBRAGobtVL6TQKG5z0E4pUt++8MbAPGLuBuo6PEc6vujruEj1gscANJ5xeBDFvpJzhhYT8/+x3Fe7CPEgzV7YeY8oXz8g0wJv4U9eTYfXly31lQAS8LlJJgwWb1Jm2EHSslSs/bju93aCUH/z62mVCs5UBusifGJNb0ooOetjTQYP+AlOSeD5FYtn2eeZ0DHVRGDFuR9/R/i7opP6Jh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9xJamQnpYx0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13013025)(5005006)(8121501046)(13021025)(13023025)(3002001)(10201501046)(93006095)(93003095)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(6072148); SRVR:AM2PR07MB0900; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0900; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0900; 4:tD6EX1U/Z/lHoo10/kGL6ZCmqLeOpgxNRVRk/l6AVPxWjqcCCt+MepKW+2v/mZJ/IdukDWR6mbn7ypMuRrMQYCNNLrJOvMyXtUbMJ/+QZwYNz/9QRd04mU0RKIfT78zUsckRactIICvxVFzp5PCnk3T+5nPg6Srd+bQ6sUVqJXS7Sjbt4VLhk7rVL9wbcyy5mD7FhQNJYDnERIZw1KUeCvluY5NHUEbIcVqA9IFIswLxSb/rySml2CXdyjeK4znEGsgbWoq5wZpwNWimTPyOxYRQBj9nhytTF3HRE/FhRHKrBe2pO1/AdrhIQJdH9skSa3WaHrG/FhwXf+oTfCcqZ1iA1ddTvTbzj0756UskzkB0YX7r0luIwrjjl7Kuvdj+B9cbCa4jzBSjzOhwePsPgPDbzDNqAGsG+PhD2RdlZy+77OSYbv121hnMR35W0YDyKmqZ2ZNEAfa1Yc7iGQRcf+X5lpRekMpWLtCEqpMYpWrFu2zA3tjpxcyRcuSzr2NQr7MUTpa7kaC9XCNrLvPHbgQZIueHUIs9cd2VZQX6gK0ZiPDW2lnkpxtWoNEjcxlmLzE4MA/Xsjt/zVxr+72RNM22FQs+vxzQ1bloXJjMMYUMCdn98k6lT50HCe0519q8LBd8EayyaKdh2FoJAwBHX2XMuMCnpIM4fWxf9fpm2QRbXKNIo8spQPkABIqRi6o3WpX8PZGN4gBGW4vz4R4VwW0OncWM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IAzNIe6LG15sB/R5b0Vz9I/qgvLKdhCTYML2MF8HCz6Vfg0U8uaafCbjkZm0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0900; 7:P1IS2mnn1M7zJefSaZFFbaYyMzq829GxHvm9haGfO46kkXxT7adDLQhBvMDhpoRkrJR1KRCL+yRpFGfhsjKMnb2+qsm9AAXLJrTSvjcJ4mQBVwJ+oaHoNYPj2BJ6HEnPbhPC7G1C3x2l23OAEM3xPkF1FNXXZWmoX3TcYDQB2nhgnYgyrjkkWFC8YphuFDDJdlcQ0RC4rLeATwMjOgpq4X5jVf0xOM9ErUM2lVy+FNHkqrs22T9NY5Mk3Fbm5+JaT0HRewOtyjzUqMPRYUCQJn3SQcZpze1vEumtEYXitxHCPXK3FOpd/AViRTgsL3ErmVqgcqPkxBesuHdm2E8f4w== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 12:11:02.9343 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR07MB0900 Subject: [lng-odp] [API-NEXT PATCH v3 07/11] test: validation: rename time test header file X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Header file name time.h is ambiguos since C has a library header file with the same name. Signed-off-by: Petri Savolainen --- test/common_plat/validation/api/time/Makefile.am | 2 +- test/common_plat/validation/api/time/time.c | 2 +- test/common_plat/validation/api/time/time_main.c | 2 +- test/common_plat/validation/api/time/{time.h => time_test.h} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename test/common_plat/validation/api/time/{time.h => time_test.h} (100%) -- 2.11.0 diff --git a/test/common_plat/validation/api/time/Makefile.am b/test/common_plat/validation/api/time/Makefile.am index bf2d0268..999fcf15 100644 --- a/test/common_plat/validation/api/time/Makefile.am +++ b/test/common_plat/validation/api/time/Makefile.am @@ -7,4 +7,4 @@ test_PROGRAMS = time_main$(EXEEXT) dist_time_main_SOURCES = time_main.c time_main_LDADD = libtesttime.la $(LIBCUNIT_COMMON) $(LIBODP) -EXTRA_DIST = time.h +EXTRA_DIST = time_test.h diff --git a/test/common_plat/validation/api/time/time.c b/test/common_plat/validation/api/time/time.c index df65c719..36c419cb 100644 --- a/test/common_plat/validation/api/time/time.c +++ b/test/common_plat/validation/api/time/time.c @@ -6,7 +6,7 @@ #include #include "odp_cunit_common.h" -#include "time.h" +#include "time_test.h" #define BUSY_LOOP_CNT 30000000 /* used for t > min resolution */ #define BUSY_LOOP_CNT_LONG 6000000000 /* used for t > 4 sec */ diff --git a/test/common_plat/validation/api/time/time_main.c b/test/common_plat/validation/api/time/time_main.c index f86d638a..bf1cfe7b 100644 --- a/test/common_plat/validation/api/time/time_main.c +++ b/test/common_plat/validation/api/time/time_main.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include "time.h" +#include "time_test.h" int main(int argc, char *argv[]) { diff --git a/test/common_plat/validation/api/time/time.h b/test/common_plat/validation/api/time/time_test.h similarity index 100% rename from test/common_plat/validation/api/time/time.h rename to test/common_plat/validation/api/time/time_test.h From patchwork Fri Apr 28 12:09:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 98361 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp235120qgf; Fri, 28 Apr 2017 05:19:24 -0700 (PDT) X-Received: by 10.55.127.129 with SMTP id a123mr8957101qkd.127.1493381963968; Fri, 28 Apr 2017 05:19:23 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g6si5796980qtd.160.2017.04.28.05.19.23; Fri, 28 Apr 2017 05:19:23 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7374A62BCA; Fri, 28 Apr 2017 12:19:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 5A31862C3A; Fri, 28 Apr 2017 12:12:15 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1BC8862BCA; Fri, 28 Apr 2017 12:11:39 +0000 (UTC) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10092.outbound.protection.outlook.com [40.107.1.92]) by lists.linaro.org (Postfix) with ESMTPS id 3A7FD62BE0 for ; Fri, 28 Apr 2017 12:11:12 +0000 (UTC) Received: from HE1PR0701CA0078.eurprd07.prod.outlook.com (10.168.122.22) by HE1PR07MB0907.eurprd07.prod.outlook.com (10.162.26.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1; Fri, 28 Apr 2017 12:11:10 +0000 Received: from AM5EUR03FT026.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::201) by HE1PR0701CA0078.outlook.office365.com (2603:10a6:3:64::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1 via Frontend Transport; Fri, 28 Apr 2017 12:11:09 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by AM5EUR03FT026.mail.protection.outlook.com (10.152.16.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Fri, 28 Apr 2017 12:11:09 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wCT001673 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wn6001645 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 28 Apr 2017 15:09:55 +0300 Message-ID: <20170428120958.17526-9-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170428120958.17526-1-petri.savolainen@linaro.org> References: <20170428120958.17526-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39410400002)(39860400002)(39840400002)(39450400003)(39400400002)(2980300002)(199003)(189002)(9170700003)(86362001)(5003940100001)(2906002)(1076002)(50226002)(36756003)(22756006)(76176999)(47776003)(2950100002)(50986999)(6666003)(189998001)(6916009)(106466001)(8936002)(53936002)(5660300001)(77096006)(105596002)(81166006)(33646002)(8676002)(2351001)(50466002)(48376002)(110136004)(38730400002)(356003)(305945005)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB0907; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM5EUR03FT026; 1:yK7QSXfrVB+t5p7iGwOap8bGX8IGQHCS6yzerqtdpGB2oLJA2rzZNGmKWnnBsLN/DJpnzEzRI15NxkymLaYia7Ns8tiq/d/T6EaRUlAgaFapyBoiMte+FrlxIiULkenKjmdmFC83A60pk3Jmff+353efyCJpW/6yfmVgw/dkCbMQdNC/jdpWhf7JnI5xC0N70SY+Mz2awTTvIJKa4rtAVyfdz8DUiHYsASJp3IUkUl7teHEaWRhrs+1N20ig4SXvTtJHfK/QS24gqe4QnZg3WYe+Z2vF6JBejS9f8z0BxpV8PBUpMlozlQM+9M0QJP5m6fdxjzuWPzD2vex8OpQW514MgmApTR3GHDXl5AzNsT0eiHHpqsKvWGbnB6phbt479sgV4bOwuFaGx0C4hg2DFotKLe1n+qCdnhtQfPI1kph4MeEw/t9QB/wyOAf9DkbTWq2bRYY+VzJYJljORat526T3nD8Lcu5nyFN8FjhFVxrfdnZO85WPMI9qoeg4LcN2gpfHYOKPIr7Te49dPzaHmg== MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3fb38abc-4255-4998-32ba-08d48e2fa796 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:HE1PR07MB0907; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0907; 3:btIm+dnnqlfXIzxs9q0n3Zyp8yHv8TF9bQzX7YlWnkEpCxqdWdpel7lK9GITYMF8ErfHL7IaQVuV2PVuCtY/KQBhm7RX3fKDdH1x6ty9thTVCsOi8Mm3DjpVhkZ7xO0CzFe0O2LCNlAzVrR9c+m6HBxW8Vwtsn+qPdg4kUpq8TWVXWa5K189aZvb/GMVxOCVF86HCh8ge/AfrBMVmoQasbtfTn5hN9VSS8iovsyS3uTnpLFXCgLtjbpnlkQYFp+iZRMjfq5vmNJ1GV8QUU7HzDSgiPT/CAI9bcFMfa4RFEXqCYW31PtO6oBddznQiI9chCvrHI9eEL8eCPKfBor65QOB9C+q3Pgke0IsFzzThN9xx1g+RxnrBOY/4pe1U3IPQbdWbsyYYlAzQL/ydA1jQQEu8DiY0tRb/634ImUToyuwB0VoeK2nFF3OXpQig+SpT2xTBchdpoxEnK1MoYobVA== X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0907; 25:9ylFQyYNcsmJpWSJH4CX4eISvyMNe/UB28hZAh4dF9nB3dSE9dGR0cvv793X1zAAlPYTT7YB+7mMVYZOurUo0TDvT6MNsltuWMrenn4PAx6il2XBdEzV/Ta07SGDkuAIdiL/00sweC+HaaS7Q8p4YsQoVmrIkr7vnNExr1uEuAsunw/UN4RaIe7twRowq+x/7Ra0A7dtmaKXWbtEPyGOSM+Kg2C0oKCWeyYzXA6BRn0EvWDLeXVb/2yKszQjXNVPAxwANlDOB+IsDGpwJi8iHtqIL1CFMKAdxi8AOLc+icOd5SVFPsg2fv93P1jvgioKqubthL7WChcDastZnV5VZ0HJox8CdknCYsSVflL/ey7QBy8uRW+Uwi6KkDfOBtjCYl+ZacTuXGRQsrZoImXqT3a4PELFDLrWIWhFx5VstzU4jdpeIFrNplyYH0oH8BTnBXugLTEZ5oS1z9UsIOBu7UF2FoRWvLyPqCT7gy6oSyY=; 31:Enf+aoepw3V/HobvfGNlKo9f67YTdrh4+NS4B1pOdoXmmYoKp5YapyGOa8S598FqvYW/kfn6lRdzvVUP3eHhmL9ABvb7Z95+ErYLkfL5N+RYS6RuRAf4xBzM7U7MYURtrNAOsCnObiBhdoN6Y6jhD409GME5jt1waWAkzPTPiqn/meBwN44XLiOpo6f2p2raeW41JHAdt8s4UX4UgAPHfknY7Fbf2v8Wvx6iFpaw39f14+LcM/CUYJSGPKg58ThE X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0907; 20:5CWKrcF+wtD5/+io2wFXbuRzQvLHVNJsNr51ijqtuK4QvGpEX/mOL8kHckd6N92zvFjhU//2hzzS4dyH2f0oC9+7swcGgJrmxekNKztm7WoFCKVATMtSi5vP6hscncMH/QI9Lv3Um5OCwPQ2X9nHW6z5n61oZC9Dk95o3gfo4h8u6fIr2YlVvulM5d3vXA4zeD+V3xyL4yZVdt7EebGqDpZjeYHF4/YZfLp7bTopPto4b8X5pr/JHaRfyvulk9l2OCRSu9cU/k39LpCC76tARt+nHSdR/CjLFqFYB9wBQxKrQANBBpwNAJLgLxoufWg/aNiXEMOXOBesxImtfW6Z+H/olmu71P5MXXS04O+COhyRBgo8d93NS5dmDwLdLrPPaUVtOJINX/Dlp+ka3DxbOaslBVnKDtHsz6WvcPicjkUgE5KKlP7+9UQ/S4Wwy/Ry1l9TZ8bntkXUk5Uc9GKhwDcHNJaxT3p/mFTD1MjLkU+9nr77TFi/4CMTSb1iwCgBgahOq5XjaUMdh6pqBcU/Z1HOXwo4/Rq2DS4xluPD+sREwM2a33hgZyzdc5Yik1ku+cLO3IoUCaK7UPOvFTRkb14nMGSH7DDul0tx+lOKut4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13013025)(5005006)(8121501046)(13023025)(13021025)(93006095)(93003095)(3002001)(10201501046)(6055026)(6041248)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123555025)(6072148); SRVR:HE1PR07MB0907; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB0907; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0907; 4:qBlXEuxh7+evfB5AfTaJLE4syFErIa7UNaq2+Coe7psgo8ojijyGZNCIX514xTWOVMh4IYGIL8hnyOdU1Xw5uwjjTOXNWB/TYyuwJ/ykUt4knjmIwe2j/Kam+LQUL6gkvSFDTQJnrDzHq2F3b/FYxOf/MuAMky//1TlF8a89ClyvXFjUKUXCgt9BtPAfxup8zSnEL1i5YUShU5jpalW0uHe17I3CIn/du8rDpTnvPnOJliWxrz5kgoG5cu6pbhlZoyHFzC5F4s9S+uFlom/hketRX3ybe4wRDZOkgNRirBes8S1i9n2zaGZSNQgQJR9O4xcm/ZjbOE6EAD+uhlqvMbCZTyoEJbTkPSw2mUiZRgx48gOVBxQQe3ST2oCTmYpL78N+GZkCTIGOAdk5v971boG7cO4dE9D+I6sCcjrskeITvXJwWOslGO0ysLDz4ahz7DXQfFERC4EG1AVwsn4dLhP1PXI9lP5m/nP64JGix6aDtnx99znRORmCG2X0kZVyqgVEuoa21fR7XAz0EmCo7KACGXtbd/OheYs03Rqo5zT8DcCG4itu+iyfklPd8JGeUt6RLP5mzFHSKPjDHUqz48LV6VGLXcKIZi76ys/YxGVV0GV5q+w7IRja2yZHZFr2F6i/GOCK4/LPoIYUlCk/oHB8Cynt2HEuWxbGvJ3lOI3OSO2fXME91Rfgnxn23hxx+7RTLO1e2utla9/cziFRsrHB7IPNnZS0lsv3rNYebpYvyvMu6r//AINp/bhTlzXBYZRfSshQJOI78qzMc44QUIadr8iLxSOiz4uEOGpVFWWNbkV7Yc2lABmGVxsprCvv5EVXjDazSSjy4Xz76DYUMEllYBuNeZF/rjrgIvVKkUY= X-Forefront-PRVS: 029174C036 X-Microsoft-Exchange-Di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ejuG8g/TKtrXUkhtAYaCiRmU01uW1F5x/c1d2LCBQR8/U1ekuoJagcLS5UNeMnZa/P4NBH/eI1fGzDb+EGC7LeQHHC49IRNRLBv7G617U5/2u0jCBxcFqukfohJCnjWUl7sE9somLM4OasIPDLLkOmSQol5MYj5CMmaVSIh7AmQumHQ7Lsu/MzB84MGbQo6icJSEwhJ8qC3njMBDXVomNlYDJr6EHr7l68XsIptOWlBIRONONGLrX8zmI7V/dygfQvLi+URnh66LuR1aVnDQ== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 12:11:09.0765 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB0907 Subject: [lng-odp] [API-NEXT PATCH v3 08/11] test: validation: add time accuracy test X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Test ODP time keeping accuracy against system time. Signed-off-by: Petri Savolainen --- test/common_plat/validation/api/time/time.c | 66 +++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 12 deletions(-) -- 2.11.0 diff --git a/test/common_plat/validation/api/time/time.c b/test/common_plat/validation/api/time/time.c index 36c419cb..e2ca2e17 100644 --- a/test/common_plat/validation/api/time/time.c +++ b/test/common_plat/validation/api/time/time.c @@ -7,6 +7,7 @@ #include #include "odp_cunit_common.h" #include "time_test.h" +#include #define BUSY_LOOP_CNT 30000000 /* used for t > min resolution */ #define BUSY_LOOP_CNT_LONG 6000000000 /* used for t > 4 sec */ @@ -140,25 +141,25 @@ void time_test_monotony(void) CU_ASSERT(ns3 > ns2); } -static void time_test_cmp(time_cb time, time_from_ns_cb time_from_ns) +static void time_test_cmp(time_cb time_cur, time_from_ns_cb time_from_ns) { /* volatile to stop optimization of busy loop */ volatile int count = 0; odp_time_t t1, t2, t3; - t1 = time(); + t1 = time_cur(); while (count < BUSY_LOOP_CNT) { count++; }; - t2 = time(); + t2 = time_cur(); while (count < BUSY_LOOP_CNT * 2) { count++; }; - t3 = time(); + t3 = time_cur(); CU_ASSERT(odp_time_cmp(t2, t1) > 0); CU_ASSERT(odp_time_cmp(t3, t2) > 0); @@ -191,7 +192,7 @@ void time_test_global_cmp(void) } /* check that a time difference gives a reasonable result */ -static void time_test_diff(time_cb time, +static void time_test_diff(time_cb time_cur, time_from_ns_cb time_from_ns, uint64_t res) { @@ -202,13 +203,13 @@ static void time_test_diff(time_cb time, uint64_t upper_limit, lower_limit; /* test timestamp diff */ - t1 = time(); + t1 = time_cur(); while (count < BUSY_LOOP_CNT) { count++; }; - t2 = time(); + t2 = time_cur(); CU_ASSERT(odp_time_cmp(t2, t1) > 0); diff = odp_time_diff(t2, t1); @@ -268,7 +269,7 @@ void time_test_global_diff(void) } /* check that a time sum gives a reasonable result */ -static void time_test_sum(time_cb time, +static void time_test_sum(time_cb time_cur, time_from_ns_cb time_from_ns, uint64_t res) { @@ -277,7 +278,7 @@ static void time_test_sum(time_cb time, uint64_t upper_limit, lower_limit; /* sum timestamp and interval */ - t1 = time(); + t1 = time_cur(); ns2 = 103; t2 = time_from_ns(ns2); ns1 = odp_time_to_ns(t1); @@ -319,20 +320,20 @@ void time_test_global_sum(void) time_test_sum(odp_time_global, odp_time_global_from_ns, global_res); } -static void time_test_wait_until(time_cb time, time_from_ns_cb time_from_ns) +static void time_test_wait_until(time_cb time_cur, time_from_ns_cb time_from_ns) { int i; odp_time_t lower_limit, upper_limit; odp_time_t start_time, end_time, wait; odp_time_t second = time_from_ns(ODP_TIME_SEC_IN_NS); - start_time = time(); + start_time = time_cur(); wait = start_time; for (i = 0; i < WAIT_SECONDS; i++) { wait = odp_time_sum(wait, second); odp_time_wait_until(wait); } - end_time = time(); + end_time = time_cur(); wait = odp_time_diff(end_time, start_time); lower_limit = time_from_ns(WAIT_SECONDS * ODP_TIME_SEC_IN_NS - @@ -398,6 +399,45 @@ void time_test_wait_ns(void) } } +static void time_test_accuracy(time_cb time_cur, time_from_ns_cb time_from_ns) +{ + int i; + odp_time_t t1, t2, wait, diff; + clock_t c1, c2; + double sec_t, sec_c; + odp_time_t sec = time_from_ns(ODP_TIME_SEC_IN_NS); + + c1 = clock(); + t1 = time_cur(); + + wait = odp_time_sum(t1, sec); + for (i = 0; i < 5; i++) { + odp_time_wait_until(wait); + wait = odp_time_sum(wait, sec); + } + + t2 = time_cur(); + c2 = clock(); + + diff = odp_time_diff(t2, t1); + sec_t = ((double)odp_time_to_ns(diff)) / ODP_TIME_SEC_IN_NS; + sec_c = ((double)(c2 - c1)) / CLOCKS_PER_SEC; + + /* Check that ODP time is within +-5% of system time */ + CU_ASSERT(sec_t < sec_c * 1.05); + CU_ASSERT(sec_t > sec_c * 0.95); +} + +static void time_test_local_accuracy(void) +{ + time_test_accuracy(odp_time_local, odp_time_local_from_ns); +} + +static void time_test_global_accuracy(void) +{ + time_test_accuracy(odp_time_global, odp_time_global_from_ns); +} + odp_testinfo_t time_suite_time[] = { ODP_TEST_INFO(time_test_constants), ODP_TEST_INFO(time_test_local_res), @@ -408,12 +448,14 @@ odp_testinfo_t time_suite_time[] = { ODP_TEST_INFO(time_test_local_sum), ODP_TEST_INFO(time_test_local_wait_until), ODP_TEST_INFO(time_test_wait_ns), + ODP_TEST_INFO(time_test_local_accuracy), ODP_TEST_INFO(time_test_global_res), ODP_TEST_INFO(time_test_global_conversion), ODP_TEST_INFO(time_test_global_cmp), ODP_TEST_INFO(time_test_global_diff), ODP_TEST_INFO(time_test_global_sum), ODP_TEST_INFO(time_test_global_wait_until), + ODP_TEST_INFO(time_test_global_accuracy), ODP_TEST_INFO_NULL }; From patchwork Fri Apr 28 12:09:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 98362 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp235483qgf; Fri, 28 Apr 2017 05:20:12 -0700 (PDT) X-Received: by 10.200.50.48 with SMTP id x45mr10217612qta.246.1493382012824; Fri, 28 Apr 2017 05:20:12 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i49si6230005qte.40.2017.04.28.05.20.12; Fri, 28 Apr 2017 05:20:12 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 65D28607CB; Fri, 28 Apr 2017 12:20:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id ABE1B62B68; Fri, 28 Apr 2017 12:12:22 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E5E2E62BDC; Fri, 28 Apr 2017 12:11:39 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0134.outbound.protection.outlook.com [104.47.0.134]) by lists.linaro.org (Postfix) with ESMTPS id 4051D62BF0 for ; Fri, 28 Apr 2017 12:11:16 +0000 (UTC) Received: from DB6PR07CA0061.eurprd07.prod.outlook.com (10.175.237.151) by VI1PR07MB0912.eurprd07.prod.outlook.com (10.161.109.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.6; Fri, 28 Apr 2017 12:11:13 +0000 Received: from VE1EUR03FT037.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::205) by DB6PR07CA0061.outlook.office365.com (2603:10a6:6:2a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1 via Frontend Transport; Fri, 28 Apr 2017 12:11:13 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by VE1EUR03FT037.mail.protection.outlook.com (10.152.19.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Fri, 28 Apr 2017 12:11:12 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9w8V001676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wn7001645 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 28 Apr 2017 15:09:56 +0300 Message-ID: <20170428120958.17526-10-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170428120958.17526-1-petri.savolainen@linaro.org> References: <20170428120958.17526-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39410400002)(39450400003)(39840400002)(39400400002)(39860400002)(2980300002)(199003)(189002)(9170700003)(86362001)(6916009)(575784001)(53936002)(5003940100001)(1076002)(36756003)(77096006)(47776003)(189998001)(2950100002)(5660300001)(22756006)(305945005)(50466002)(2906002)(356003)(8936002)(50986999)(48376002)(8676002)(81166006)(2351001)(106466001)(33646002)(110136004)(38730400002)(105596002)(76176999)(50226002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB0912; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; VE1EUR03FT037; 1:IptFRI2lkpMnimC20YQHWV5rbQ1qga2DJLX5FLYj+C70CsBK7QSS6rINu83sLNxGrEzrX8HWnZUYAGEV+UbKupPhcyICT8QyYNW3oHYf1ZTzTBzC9jx5XAO9jugrVvDVo296YzEi72T8LGjn4hQgMH2jCRBgBm5w4e1wfpyZw5dI6B963GTYrZRqzOwRcqYD1jiXCCq0DjHW7gzqhMo5pDSVvyN2R5FM4H/mGB6UbqWmqaEIrRyWb9ONwNcZYeFyY7GNO1BHBlkMeHC+Yioq23f2MJaCHXto2ilkKNWUnhjNr6pF81rLT2p/TLJZKZ5HrAKYOO+B0RGwVeOhaNlLDQtA3ti6F74OPxRIInPfWRpeOrWdWPr384DJ+GoqqS09qTDKZWuQkSI+zQiJimwRF+rEwL9BybcU6ikUoPEKgvahqnv0FENylxXKhEYsN3kEk0gLTj4mI2Pg9/4+/3kHYCcHTAn2O1FJTtKR208bKyQ3XmGtB5Td6OTI7K+KW0a5fpfFyUOgDck4eHOv4lXv3Q== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 2dadc5bd-3f4f-4e84-0c8a-08d48e2fa9c2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:VI1PR07MB0912; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0912; 3:BTqk3G/d0z/UEbnJR++1P+xi/v4P3q+VSsBB++gJT81AGa88vTtvu5O8BF6p5O6Ekq7gE6CFnwW8Sa6Vz8NmyJFrwx8uKqGM4nk0ROMA4XGPfQfRbvZ8LZTZh/Oqc9Bn1AGcZ0YNzhJN1cV8YNq202Eid5VB4dCXxj/LDBtfT2jfG7tmw88SnmjwgeAEgJ7Wg6Hv/2NSbNV7TQxiBd+2GtM+fj+ajjJjrJoO8rA1s+vmb8KKrKbnAsGgAqIcwM4wZSZSQvLd7RZFu+dGtnDMhRgoOnW0HV99Q8TUPczNwTWZ9nOLspkhyTagi+Pq5WxI10i0IhDE7SW9xyzwe43SKEsbfCtmfc76CKlNzUFeor/MQIjYJGbAuMvpczMX3eg2sbcgyiMh5nio4pvjlvwIe9sueDfHUaCpTFgiojOB3/vqWbDXPBbs+CnPkCGlw6KB6mP1u1uG05+qNp0sHLefGA== X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0912; 25:Yge9CBaxMJMHgjwnH3U0w+XX/YpL+0BspwoU3Qdt+PmujrhEZO64VnQIiCm3M4t5eUhi6M/qLnT+B6gFCCUSxCtJWeSd82VYGANnRhw1qHusebdCc88cS3XkHlJWA5YfUzLZwbtrYUMWpEkUCVtsJ5/Z1S730yG61RSc+/vkZ+LcxScSuPnnvzQZKGIv6kWlpNW3eRdLLOElEUvcMw5FRg8E1r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J0K1HA3T7tmw4OZOAZ/hXLC1fPmi/xkehT544wvScb3RUoKGfnK0yqa7rux1v4N8/80aAYswE05/2r7FC07NgUiqJmKvS8fnKfmovdVpgaP+xwg4PEEeYSpKwnoGkxuzhukFVUxt+JVKAZXJaYz1nQhIaLuDol5cg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13023025)(13021025)(5005006)(13013025)(8121501046)(93006095)(93003095)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123558100)(20161123564025)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(6072148); SRVR:VI1PR07MB0912; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB0912; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0912; 4:3RN1wbtNwuaARCNqVXtwP0G4Kbt68e9wPhx1xS0XMWw7xlvAV1BwEM91O4hK0ovTYzDhj6iYNeLn1rpBZEyBZ4miSBVG/GJDB7GHjh/gTltKfrtFeCTEi8lANMZlOS4dTtdpiaZ1Gt5Z1TfDKLfwyKZII+WVeFeSBP6YtEGQqKz38bimBEma9vtE4yKAeDatLivifrydLZ9DPZ2OjMCo132jv1qnTMHub8Rupu6GRMNLR0gxQZU3+SwXL11Lz8wrBHY9oZRbfVISjhelgY7e6GRnEr8E+mFseaRlsJso04zbu4giLnV0TZ0J9PREmgNG2nDySgeOS4tmh39QVXERdHGgjGnrjyz+DsK87CR6Nu+Egphr6MS2CTwZGvAey4GSajD/9mZXvD/Q9klIlYGyg6duYnuM+HJNnEpbsyyMrfbb30wTZH7KINCD3ysDXtJ2KfKwmBTKX+/1S/N04zXnwW1m4BlbBOchqztiH3mvI4Dn7RXWb/FoiJFdHlVneov8sUpUu/hYYX1YYFlZhFytF6443XKR8JoPSZnlPMOjb9QCilK2BcXWwbiur6UMnugZKls4FFDZIYqWBvR5NbMSbhKC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DqoIGtO/DBFaJ/PiaeyaZKgenlbgVfBeYHLiiLOC8CbVGDHkVCpPvHllZyY2Kn7q05nk5Tb1Q==; 24:k0Km3yq9TDZ88pfB8mlNx8W2qV/o9jnyVW2kMdkJzEpktDZsGiYNP08HsH1LaAiQEZCG8Cr9e+61oUlX2ipEfcZWEdRi63t00THd3+bRrzs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0912; 7:NjP2TvM4ZKwJGeKjpK6Dp3Z1fIhATR6EEJEtYxOs7YhxOoTF2oF9HUBTCjT6JcxzsJ+7dn/SP+SOgVj2ZNamREtFwhVPxELzIOHYpcecSUztq/YrWzOZ5C19vt3aqaJbCnsyEOEtdnK1i0KZMPocIgDNKBA515s3deBSg5rUy/1liCyIyjqc/csDwUs5+NQVaLwTRB+ZuOpwMxR2u2zzBGERUSwuBiTrjfZFTqwHvPGplrP4woVYEVdAeN4YobZNKpf8Jg9kN/eJdhN7OPHH9PceCt85cJh4jisnNT4SF7lpkOEPCIl0INtUDyGpYfo+2ulQKIcKJ1POyqdh2ye+hg== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 12:11:12.7037 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB0912 Subject: [lng-odp] [API-NEXT PATCH v3 09/11] linux-gen: time: use hw time counter when available X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Use 64 bit HW time counter when available. It is used on x86 when invariant TSC CPU flag indicates that TSC frequency is constant. Otherwise, the system time is used as before. Direct HW time counter usage avoids system call, and related latency and performance issues. Signed-off-by: Petri Savolainen --- platform/linux-generic/Makefile.am | 1 + platform/linux-generic/arch/arm/odp_cpu_arch.c | 16 ++ platform/linux-generic/arch/default/odp_cpu_arch.c | 16 ++ platform/linux-generic/arch/mips64/odp_cpu_arch.c | 16 ++ platform/linux-generic/arch/powerpc/odp_cpu_arch.c | 16 ++ platform/linux-generic/arch/x86/cpu_flags.c | 9 + platform/linux-generic/arch/x86/odp_cpu_arch.c | 59 ++++ .../include/odp/api/plat/time_types.h | 23 +- platform/linux-generic/include/odp_time_internal.h | 24 ++ platform/linux-generic/odp_time.c | 300 ++++++++++++++++----- 10 files changed, 415 insertions(+), 65 deletions(-) create mode 100644 platform/linux-generic/include/odp_time_internal.h -- 2.11.0 diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index ab74c14c..cd7afba2 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -172,6 +172,7 @@ noinst_HEADERS = \ ${srcdir}/include/odp_schedule_if.h \ ${srcdir}/include/odp_sorted_list_internal.h \ ${srcdir}/include/odp_shm_internal.h \ + ${srcdir}/include/odp_time_internal.h \ ${srcdir}/include/odp_timer_internal.h \ ${srcdir}/include/odp_timer_wheel_internal.h \ ${srcdir}/include/odp_traffic_mngr_internal.h \ diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c index 2ac223e0..c31f9084 100644 --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c @@ -13,6 +13,7 @@ #include #include #include +#include #define GIGA 1000000000 @@ -46,3 +47,18 @@ uint64_t odp_cpu_cycles_resolution(void) { return 1; } + +int cpu_has_global_time(void) +{ + return 0; +} + +uint64_t cpu_global_time(void) +{ + return 0; +} + +uint64_t cpu_global_time_freq(void) +{ + return 0; +} diff --git a/platform/linux-generic/arch/default/odp_cpu_arch.c b/platform/linux-generic/arch/default/odp_cpu_arch.c index 2ac223e0..c31f9084 100644 --- a/platform/linux-generic/arch/default/odp_cpu_arch.c +++ b/platform/linux-generic/arch/default/odp_cpu_arch.c @@ -13,6 +13,7 @@ #include #include #include +#include #define GIGA 1000000000 @@ -46,3 +47,18 @@ uint64_t odp_cpu_cycles_resolution(void) { return 1; } + +int cpu_has_global_time(void) +{ + return 0; +} + +uint64_t cpu_global_time(void) +{ + return 0; +} + +uint64_t cpu_global_time_freq(void) +{ + return 0; +} diff --git a/platform/linux-generic/arch/mips64/odp_cpu_arch.c b/platform/linux-generic/arch/mips64/odp_cpu_arch.c index 646acf9c..f7eafa0f 100644 --- a/platform/linux-generic/arch/mips64/odp_cpu_arch.c +++ b/platform/linux-generic/arch/mips64/odp_cpu_arch.c @@ -7,6 +7,7 @@ #include #include #include +#include uint64_t odp_cpu_cycles(void) { @@ -29,3 +30,18 @@ uint64_t odp_cpu_cycles_resolution(void) { return 1; } + +int cpu_has_global_time(void) +{ + return 0; +} + +uint64_t cpu_global_time(void) +{ + return 0; +} + +uint64_t cpu_global_time_freq(void) +{ + return 0; +} diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c index 2ac223e0..c31f9084 100644 --- a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c +++ b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c @@ -13,6 +13,7 @@ #include #include #include +#include #define GIGA 1000000000 @@ -46,3 +47,18 @@ uint64_t odp_cpu_cycles_resolution(void) { return 1; } + +int cpu_has_global_time(void) +{ + return 0; +} + +uint64_t cpu_global_time(void) +{ + return 0; +} + +uint64_t cpu_global_time_freq(void) +{ + return 0; +} diff --git a/platform/linux-generic/arch/x86/cpu_flags.c b/platform/linux-generic/arch/x86/cpu_flags.c index 954dac27..a492a35b 100644 --- a/platform/linux-generic/arch/x86/cpu_flags.c +++ b/platform/linux-generic/arch/x86/cpu_flags.c @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -357,3 +358,11 @@ void cpu_flags_print_all(void) str[len] = '\0'; ODP_PRINT("%s", str); } + +int cpu_has_global_time(void) +{ + if (cpu_get_flag_enabled(RTE_CPUFLAG_INVTSC) > 0) + return 1; + + return 0; +} diff --git a/platform/linux-generic/arch/x86/odp_cpu_arch.c b/platform/linux-generic/arch/x86/odp_cpu_arch.c index c8cf27b6..9ba601a3 100644 --- a/platform/linux-generic/arch/x86/odp_cpu_arch.c +++ b/platform/linux-generic/arch/x86/odp_cpu_arch.c @@ -3,7 +3,14 @@ * * SPDX-License-Identifier: BSD-3-Clause */ + +#include + #include +#include +#include + +#include uint64_t odp_cpu_cycles(void) { @@ -31,3 +38,55 @@ uint64_t odp_cpu_cycles_resolution(void) { return 1; } + +uint64_t cpu_global_time(void) +{ + return odp_cpu_cycles(); +} + +#define SEC_IN_NS 1000000000ULL + +/* Measure TSC frequency. Frequency information registers are defined for x86, + * but those are often not enumerated. */ +uint64_t cpu_global_time_freq(void) +{ + struct timespec sleep, ts1, ts2; + uint64_t t1, t2, ts_nsec, cycles, hz; + int i; + uint64_t avg = 0; + int rounds = 4; + + for (i = 0; i < rounds; i++) { + sleep.tv_sec = 0; + sleep.tv_nsec = SEC_IN_NS / 10; + + if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts1)) { + ODP_DBG("clock_gettime failed\n"); + return 0; + } + + t1 = cpu_global_time(); + + if (nanosleep(&sleep, NULL) < 0) { + ODP_DBG("nanosleep failed\n"); + return 0; + } + + if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts2)) { + ODP_DBG("clock_gettime failed\n"); + return 0; + } + + t2 = cpu_global_time(); + + ts_nsec = (ts2.tv_sec - ts1.tv_sec) * SEC_IN_NS; + ts_nsec += ts2.tv_nsec - ts1.tv_nsec; + + cycles = t2 - t1; + + hz = (cycles * SEC_IN_NS) / ts_nsec; + avg += hz; + } + + return avg / rounds; +} diff --git a/platform/linux-generic/include/odp/api/plat/time_types.h b/platform/linux-generic/include/odp/api/plat/time_types.h index 4847f3b1..1cafb1f7 100644 --- a/platform/linux-generic/include/odp/api/plat/time_types.h +++ b/platform/linux-generic/include/odp/api/plat/time_types.h @@ -26,11 +26,28 @@ extern "C" { * the linux timespec structure, which is dependent on POSIX extension level. */ typedef struct odp_time_t { - int64_t tv_sec; /**< @internal Seconds */ - int64_t tv_nsec; /**< @internal Nanoseconds */ + union { + /** @internal Posix timespec */ + struct { + /** @internal Seconds */ + int64_t tv_sec; + + /** @internal Nanoseconds */ + int64_t tv_nsec; + } spec; + + /** @internal HW time counter */ + struct { + /** @internal Counter value */ + uint64_t count; + + /** @internal Reserved */ + uint64_t reserved; + } hw; + }; } odp_time_t; -#define ODP_TIME_NULL ((odp_time_t){0, 0}) +#define ODP_TIME_NULL ((odp_time_t){.spec = {0, 0} }) /** * @} diff --git a/platform/linux-generic/include/odp_time_internal.h b/platform/linux-generic/include/odp_time_internal.h new file mode 100644 index 00000000..99ac7977 --- /dev/null +++ b/platform/linux-generic/include/odp_time_internal.h @@ -0,0 +1,24 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_TIME_INTERNAL_H_ +#define ODP_TIME_INTERNAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +int cpu_has_global_time(void); +uint64_t cpu_global_time(void); +uint64_t cpu_global_time_freq(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c index 0e5966c0..ac82175d 100644 --- a/platform/linux-generic/odp_time.c +++ b/platform/linux-generic/odp_time.c @@ -10,36 +10,39 @@ #include #include #include +#include +#include +#include -static odp_time_t start_time; +typedef struct time_global_t { + odp_time_t start_time; + int use_hw; + uint64_t hw_start; + uint64_t hw_freq_hz; +} time_global_t; -static inline -uint64_t time_to_ns(odp_time_t time) -{ - uint64_t ns; - - ns = time.tv_sec * ODP_TIME_SEC_IN_NS; - ns += time.tv_nsec; +static time_global_t global; - return ns; -} +/* + * Posix timespec based functions + */ -static inline odp_time_t time_diff(odp_time_t t2, odp_time_t t1) +static inline odp_time_t time_spec_diff(odp_time_t t2, odp_time_t t1) { odp_time_t time; - time.tv_sec = t2.tv_sec - t1.tv_sec; - time.tv_nsec = t2.tv_nsec - t1.tv_nsec; + time.spec.tv_sec = t2.spec.tv_sec - t1.spec.tv_sec; + time.spec.tv_nsec = t2.spec.tv_nsec - t1.spec.tv_nsec; - if (time.tv_nsec < 0) { - time.tv_nsec += ODP_TIME_SEC_IN_NS; - --time.tv_sec; + if (time.spec.tv_nsec < 0) { + time.spec.tv_nsec += ODP_TIME_SEC_IN_NS; + --time.spec.tv_sec; } return time; } -static inline odp_time_t time_local(void) +static inline odp_time_t time_spec_cur(void) { int ret; odp_time_t time; @@ -49,77 +52,234 @@ static inline odp_time_t time_local(void) if (odp_unlikely(ret != 0)) ODP_ABORT("clock_gettime failed\n"); - time.tv_sec = sys_time.tv_sec; - time.tv_nsec = sys_time.tv_nsec; + time.spec.tv_sec = sys_time.tv_sec; + time.spec.tv_nsec = sys_time.tv_nsec; - return time_diff(time, start_time); + return time_spec_diff(time, global.start_time); } -static inline int time_cmp(odp_time_t t2, odp_time_t t1) +static inline uint64_t time_spec_res(void) { - if (t2.tv_sec < t1.tv_sec) + int ret; + struct timespec tres; + + ret = clock_getres(CLOCK_MONOTONIC_RAW, &tres); + if (odp_unlikely(ret != 0)) + ODP_ABORT("clock_getres failed\n"); + + return ODP_TIME_SEC_IN_NS / (uint64_t)tres.tv_nsec; +} + +static inline int time_spec_cmp(odp_time_t t2, odp_time_t t1) +{ + if (t2.spec.tv_sec < t1.spec.tv_sec) return -1; - if (t2.tv_sec > t1.tv_sec) + if (t2.spec.tv_sec > t1.spec.tv_sec) return 1; - return t2.tv_nsec - t1.tv_nsec; + return t2.spec.tv_nsec - t1.spec.tv_nsec; } -static inline odp_time_t time_sum(odp_time_t t1, odp_time_t t2) +static inline odp_time_t time_spec_sum(odp_time_t t1, odp_time_t t2) { odp_time_t time; - time.tv_sec = t2.tv_sec + t1.tv_sec; - time.tv_nsec = t2.tv_nsec + t1.tv_nsec; + time.spec.tv_sec = t2.spec.tv_sec + t1.spec.tv_sec; + time.spec.tv_nsec = t2.spec.tv_nsec + t1.spec.tv_nsec; - if (time.tv_nsec >= (long)ODP_TIME_SEC_IN_NS) { - time.tv_nsec -= ODP_TIME_SEC_IN_NS; - ++time.tv_sec; + if (time.spec.tv_nsec >= (long)ODP_TIME_SEC_IN_NS) { + time.spec.tv_nsec -= ODP_TIME_SEC_IN_NS; + ++time.spec.tv_sec; } return time; } -static inline odp_time_t time_local_from_ns(uint64_t ns) +static inline uint64_t time_spec_to_ns(odp_time_t time) +{ + uint64_t ns; + + ns = time.spec.tv_sec * ODP_TIME_SEC_IN_NS; + ns += time.spec.tv_nsec; + + return ns; +} + +static inline odp_time_t time_spec_from_ns(uint64_t ns) { odp_time_t time; - time.tv_sec = ns / ODP_TIME_SEC_IN_NS; - time.tv_nsec = ns - time.tv_sec * ODP_TIME_SEC_IN_NS; + time.spec.tv_sec = ns / ODP_TIME_SEC_IN_NS; + time.spec.tv_nsec = ns - time.spec.tv_sec * ODP_TIME_SEC_IN_NS; return time; } -static inline void time_wait_until(odp_time_t time) +/* + * HW time counter based functions + */ + +static inline odp_time_t time_hw_cur(void) { - odp_time_t cur; + odp_time_t time; - do { - cur = time_local(); - } while (time_cmp(time, cur) > 0); + time.hw.count = cpu_global_time() - global.hw_start; + + return time; } -static inline uint64_t time_local_res(void) +static inline uint64_t time_hw_res(void) { - int ret; - struct timespec tres; + /* Promise a bit lower resolution than average cycle counter + * frequency */ + return global.hw_freq_hz / 10; +} - ret = clock_getres(CLOCK_MONOTONIC_RAW, &tres); - if (odp_unlikely(ret != 0)) - ODP_ABORT("clock_getres failed\n"); +static inline int time_hw_cmp(odp_time_t t2, odp_time_t t1) +{ + if (odp_likely(t2.hw.count > t1.hw.count)) + return 1; - return ODP_TIME_SEC_IN_NS / (uint64_t)tres.tv_nsec; + if (t2.hw.count < t1.hw.count) + return -1; + + return 0; +} + +static inline odp_time_t time_hw_diff(odp_time_t t2, odp_time_t t1) +{ + odp_time_t time; + + time.hw.count = t2.hw.count - t1.hw.count; + + return time; +} + +static inline odp_time_t time_hw_sum(odp_time_t t1, odp_time_t t2) +{ + odp_time_t time; + + time.hw.count = t1.hw.count + t2.hw.count; + + return time; +} + +static inline uint64_t time_hw_to_ns(odp_time_t time) +{ + uint64_t nsec; + uint64_t freq_hz = global.hw_freq_hz; + uint64_t count = time.hw.count; + uint64_t sec = 0; + + if (count >= freq_hz) { + sec = count / freq_hz; + count = count - sec * freq_hz; + } + + nsec = (ODP_TIME_SEC_IN_NS * count) / freq_hz; + + return (sec * ODP_TIME_SEC_IN_NS) + nsec; +} + +static inline odp_time_t time_hw_from_ns(uint64_t ns) +{ + odp_time_t time; + uint64_t count; + uint64_t freq_hz = global.hw_freq_hz; + uint64_t sec = 0; + + if (ns >= ODP_TIME_SEC_IN_NS) { + sec = ns / ODP_TIME_SEC_IN_NS; + ns = ns - sec * ODP_TIME_SEC_IN_NS; + } + + count = sec * freq_hz; + count += (ns * freq_hz) / ODP_TIME_SEC_IN_NS; + + time.hw.reserved = 0; + time.hw.count = count; + + return time; +} + +/* + * Common functions + */ + +static inline odp_time_t time_cur(void) +{ + if (global.use_hw) + return time_hw_cur(); + + return time_spec_cur(); +} + +static inline uint64_t time_res(void) +{ + if (global.use_hw) + return time_hw_res(); + + return time_spec_res(); +} + +static inline int time_cmp(odp_time_t t2, odp_time_t t1) +{ + if (global.use_hw) + return time_hw_cmp(t2, t1); + + return time_spec_cmp(t2, t1); +} + +static inline odp_time_t time_diff(odp_time_t t2, odp_time_t t1) +{ + if (global.use_hw) + return time_hw_diff(t2, t1); + + return time_spec_diff(t2, t1); +} + +static inline odp_time_t time_sum(odp_time_t t1, odp_time_t t2) +{ + if (global.use_hw) + return time_hw_sum(t1, t2); + + return time_spec_sum(t1, t2); +} + +static inline uint64_t time_to_ns(odp_time_t time) +{ + if (global.use_hw) + return time_hw_to_ns(time); + + return time_spec_to_ns(time); +} + +static inline odp_time_t time_from_ns(uint64_t ns) +{ + if (global.use_hw) + return time_hw_from_ns(ns); + + return time_spec_from_ns(ns); +} + +static inline void time_wait_until(odp_time_t time) +{ + odp_time_t cur; + + do { + cur = time_cur(); + } while (time_cmp(time, cur) > 0); } odp_time_t odp_time_local(void) { - return time_local(); + return time_cur(); } odp_time_t odp_time_global(void) { - return time_local(); + return time_cur(); } odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1) @@ -134,12 +294,12 @@ uint64_t odp_time_to_ns(odp_time_t time) odp_time_t odp_time_local_from_ns(uint64_t ns) { - return time_local_from_ns(ns); + return time_from_ns(ns); } odp_time_t odp_time_global_from_ns(uint64_t ns) { - return time_local_from_ns(ns); + return time_from_ns(ns); } int odp_time_cmp(odp_time_t t2, odp_time_t t1) @@ -154,18 +314,18 @@ odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2) uint64_t odp_time_local_res(void) { - return time_local_res(); + return time_res(); } uint64_t odp_time_global_res(void) { - return time_local_res(); + return time_res(); } void odp_time_wait_ns(uint64_t ns) { - odp_time_t cur = time_local(); - odp_time_t wait = time_local_from_ns(ns); + odp_time_t cur = time_cur(); + odp_time_t wait = time_from_ns(ns); odp_time_t end_time = time_sum(cur, wait); time_wait_until(end_time); @@ -178,15 +338,31 @@ void odp_time_wait_until(odp_time_t time) int odp_time_init_global(void) { - int ret; - struct timespec time; - - ret = clock_gettime(CLOCK_MONOTONIC_RAW, &time); - if (ret) { - start_time = ODP_TIME_NULL; - } else { - start_time.tv_sec = time.tv_sec; - start_time.tv_nsec = time.tv_nsec; + struct timespec sys_time; + int ret = 0; + + memset(&global, 0, sizeof(time_global_t)); + + if (cpu_has_global_time()) { + global.use_hw = 1; + global.hw_freq_hz = cpu_global_time_freq(); + + if (global.hw_freq_hz == 0) + return -1; + + printf("HW time counter freq: %" PRIu64 " hz\n\n", + global.hw_freq_hz); + + global.hw_start = cpu_global_time(); + return 0; + } + + global.start_time = ODP_TIME_NULL; + + ret = clock_gettime(CLOCK_MONOTONIC_RAW, &sys_time); + if (ret == 0) { + global.start_time.spec.tv_sec = sys_time.tv_sec; + global.start_time.spec.tv_nsec = sys_time.tv_nsec; } return ret; From patchwork Fri Apr 28 12:09:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 98353 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp232035qgf; Fri, 28 Apr 2017 05:12:19 -0700 (PDT) X-Received: by 10.36.250.4 with SMTP id v4mr710716ith.13.1493381539614; Fri, 28 Apr 2017 05:12:19 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i15si5760899ioa.30.2017.04.28.05.12.19; Fri, 28 Apr 2017 05:12:19 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2E5DF62C36; Fri, 28 Apr 2017 12:12:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 6357B62B68; Fri, 28 Apr 2017 12:11:37 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 17AE760A79; Fri, 28 Apr 2017 12:11:29 +0000 (UTC) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10127.outbound.protection.outlook.com [40.107.1.127]) by lists.linaro.org (Postfix) with ESMTPS id 1C2A262008 for ; Fri, 28 Apr 2017 12:11:02 +0000 (UTC) Received: from HE1PR0701CA0055.eurprd07.prod.outlook.com (10.168.191.23) by HE1PR0701MB2124.eurprd07.prod.outlook.com (10.168.36.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1; Fri, 28 Apr 2017 12:10:59 +0000 Received: from DB5EUR03FT054.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::209) by HE1PR0701CA0055.outlook.office365.com (2603:10a6:3:9e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1 via Frontend Transport; Fri, 28 Apr 2017 12:10:59 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by DB5EUR03FT054.mail.protection.outlook.com (10.152.20.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Fri, 28 Apr 2017 12:10:58 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wl0001679 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wn8001645 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 28 Apr 2017 15:09:57 +0300 Message-ID: <20170428120958.17526-11-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170428120958.17526-1-petri.savolainen@linaro.org> References: <20170428120958.17526-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(39410400002)(39840400002)(39400400002)(39850400002)(39450400003)(2980300002)(199003)(189002)(9170700003)(305945005)(8676002)(8936002)(81166006)(5660300001)(47776003)(1076002)(53936002)(50226002)(5003940100001)(86362001)(48376002)(50466002)(36756003)(38730400002)(76176999)(105596002)(106466001)(356003)(2906002)(50986999)(22756006)(189998001)(2351001)(33646002)(110136004)(2950100002)(77096006)(6916009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0701MB2124; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB5EUR03FT054; 1:ccG62bLJw/8574td/04Qe+kg14u6a+5SUz5MEAHUWpTBDjmyyxLU/8Wl4bQsNpMVKqoEzZAYmJnNXwet05CZKa7XDVmH3s5We2gw/tD4tUMdwzIiF81XMUQH2I151Pkm32Y54tlEBQYWowy8yfiIDu9RUO3+0eY/7NpHqZ0UYTpR3CnTbmmPz8nbpYO/laWqftw9m8a1zGlkZJNJBHOGOvlMwPeidcAkePlz/8ENI6qDYukfaCK6EQla7DB/XFEHxp6BdGV4xzjC5sHJOIGlPpICEc1GI55SkdRxIwQQnJZ3O1dAZ5507354t6F4D5Q8xKrkXCMzRaud0rR13ZeNZxjfTa9nOlgbInHgqCV48Cebn9QypRUdvlfWTh1Orl50nHuNXzafBZ0pORaLKU6t7gpdw/BqS0OquoADKonV3QHTunozOohuQkOJC9SD5iCqXbHNm061IOMVBsluVuvfobJGgcgz5wY6AtpwA4crxvxoF0HQS+Uukpf+9drA0gljV/Xhm/pbfR1mx2VPHlDvNw== MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 270d8239-b9da-4848-3909-08d48e2fa16d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:HE1PR0701MB2124; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2124; 3:62bcI8JS2C/TG9AhIFzf30VpLsJeTTLV2hkJfFMeMnwTXxsiVzEKXVhycIGrO1Zn104um8UaBDV2TlNI6cmpCHA3O6/kbEOTwte2DhFOnC3tXSop6o0QIToyEFU0FewzyDQyBS06AxXIZ5pwftgDDsNsDxZkoqR4CbGP3/yx28GrEM++dBINkZMkONworCqp9mLffd2t6e+4gmNmOVmcosAeh8R9qhS0eTmyUZ05aX5nJDSaLdVKMyumxh3Co/0XhBOHa4+TTFafc0IMcqfS6zxd4Ve1WlEyNHEvPOgslbHD+x0yAw8e3gXdvVzDhTJqCEEy3HfOOv2nCNd/qApJHNeCQJFJ0LSiImGrxHeUj8R9LZyw5mKfaV67fK2SWu06rAkJoylUErQbPL6ufEDgK7VWAAe6vTqxqjhslgw+lkQt7up0O4r1VXAYz49fIkr+abbP7+vaEdRFa4nTWzQB3A== X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2124; 25:UUB1YfHvJF8Bvj2LzyA+slxQu15FFmSS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xmblGT0+bjkV5fAVPe+Fc7gBUcD13nPcEcSFRwl7VkCktn9L5qHJ2tsOe0cq2lcHkXdM9i+Gxcbm2OPQZVQyKwnYpD+6Apj02meQSJNlLEvlXPBJS2lVE3P777S0YOJ756imnxZAIwfCKqkoTo6+uaDhEEkw+N/Ti5WJ/dLFelb4Kc/H0c7GbkIr659CfvSSDE8nuhGlibqreSMxHIRUrOf/XMhjTm/HzUjxDtOwAl83bwC0oEhT8WmLMDpZTaiCcBBoSDCbycDCZwuQoEMOy02RFFzlXYKDDyG6Ogl4A73m8EVnLxsy4m2Kl37Ik3w1QTO+wP/q1KeEKgw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13021025)(13023025)(5005006)(13013025)(8121501046)(93006095)(93003095)(10201501046)(3002001)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148); SRVR:HE1PR0701MB2124; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0701MB2124; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2124; 4:jwpx/zh8vMTi/P6Cp+h+EBoMAWzKzwlvrhOEC8vjLyEqItV10VxOQNIJp1ePuLfbTin6rNFWOTA2dBFl8ldkeRONnClHe/8Z61Gl5oqEqUhWHJ/zHzYotm4gfRn+7QziD8+voU3Pk0dv/JdcrFrEs6x7hUMlZsy7a6msfS1uf1MfaHkVh+LcVn1cm7wWc/yVhHfSfLdyxOg0mhEHU1LJX7keSGg36fdhHHhaIfzXBmyev9seJwm6XJKeZx9vxkcXXIdYZWYt1VrsEFU8zRY1ryItnJhtIIalgHgZNYkNZkm7jO5ONmp7VsxvPyMNCtnUxtpZZHXYIqlAycQlLSbg2w1vsunAHBRbTtmJlJ2i67V4Jx4xpEK40tTP4U1ZryJ+LvJbbDjoek70ZpbLY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7yFQsjeuAExz0JQ85+QOyn5Hoys8g3CoTJGdZx60eRl6poVKi49Q=; 5:pyWKLY8fYI18G44gEQJXMfgVpKgJ4GeqX4/j97l+uAa8R8bh78oMjkLukssCOi0eWUMGhsQt8bAD8c8mPs+IsWQ+I42mDa+y2cRtKZrES8VKCh7ANT5Gz7WJN5NzZPUSdt5XQ2P6YYQsithrxvOHEA==; 24:IpPDTawvLJ3d/HtskT5k0ki3m3bmC0J2FbEez4VAx9Sg0AOW00xgfzvK3WbQDIheH+dYiTvqZcVq/aQpY7g+XdH/UWQJmkc6XJ42fYnDjnk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2124; 7:bngMz0IYC0HkUOQ38/x8gPbVeR3BEcXf9opT5qpTnqK7bOIcNIt7D6kRCWW3j/thzErOA2GTq9f71o2gRmEXX69AV47NBB+fh0urLKGX/PiQAQ6k5TGmlS/+oF65HndzOSNwz7fgwMCdr1PISkBzqVKgyWVmClCXSsLoYcOG0m7HyqdSz7A+4Qz9A4EANS2OtC+ibWrI2qBPPC8RisPJS7VwInIVVn9MnbaVAmhqctXqfAm6nn/gXH3UqEIf+ca7mBM+lh3kNJp47i/DiiiB+M2aGdOZn9yu5N2yYBahRRjb0GqGCxd8ns2kcILr5f+LjEe44efMD00YGP56nGrT5A== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 12:10:58.6948 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0701MB2124 Subject: [lng-odp] [API-NEXT PATCH v3 10/11] linux-gen: time: improve x86 TSC freq measurement accuracy X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Add short warm up round and measure over a longer period of time (250ms vs 100ms). Signed-off-by: Petri Savolainen --- platform/linux-generic/arch/x86/odp_cpu_arch.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) -- 2.11.0 diff --git a/platform/linux-generic/arch/x86/odp_cpu_arch.c b/platform/linux-generic/arch/x86/odp_cpu_arch.c index 9ba601a3..b1da428b 100644 --- a/platform/linux-generic/arch/x86/odp_cpu_arch.c +++ b/platform/linux-generic/arch/x86/odp_cpu_arch.c @@ -54,11 +54,16 @@ uint64_t cpu_global_time_freq(void) uint64_t t1, t2, ts_nsec, cycles, hz; int i; uint64_t avg = 0; - int rounds = 4; + int rounds = 3; + int warm_up = 1; for (i = 0; i < rounds; i++) { - sleep.tv_sec = 0; - sleep.tv_nsec = SEC_IN_NS / 10; + sleep.tv_sec = 0; + + if (warm_up) + sleep.tv_nsec = SEC_IN_NS / 1000; + else + sleep.tv_nsec = SEC_IN_NS / 4; if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts1)) { ODP_DBG("clock_gettime failed\n"); @@ -85,8 +90,12 @@ uint64_t cpu_global_time_freq(void) cycles = t2 - t1; hz = (cycles * SEC_IN_NS) / ts_nsec; - avg += hz; + + if (warm_up) + warm_up = 0; + else + avg += hz; } - return avg / rounds; + return avg / (rounds - 1); } From patchwork Fri Apr 28 12:09:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 98359 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp233902qgf; Fri, 28 Apr 2017 05:16:35 -0700 (PDT) X-Received: by 10.36.79.6 with SMTP id c6mr9302123itb.45.1493381795634; Fri, 28 Apr 2017 05:16:35 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e200si6841349ite.89.2017.04.28.05.16.35; Fri, 28 Apr 2017 05:16:35 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1F1CA62B67; Fri, 28 Apr 2017 12:16:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 8073062C2B; Fri, 28 Apr 2017 12:12:06 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7FB0962B68; Fri, 28 Apr 2017 12:11:36 +0000 (UTC) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30105.outbound.protection.outlook.com [40.107.3.105]) by lists.linaro.org (Postfix) with ESMTPS id D1A2362BC4 for ; Fri, 28 Apr 2017 12:11:11 +0000 (UTC) Received: from AM4PR07CA0019.eurprd07.prod.outlook.com (2603:10a6:205:1::32) by AM2PR07MB0899.eurprd07.prod.outlook.com (2a01:111:e400:8428::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1; Fri, 28 Apr 2017 12:11:10 +0000 Received: from VE1EUR03FT033.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::200) by AM4PR07CA0019.outlook.office365.com (2603:10a6:205:1::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.1 via Frontend Transport; Fri, 28 Apr 2017 12:11:10 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by VE1EUR03FT033.mail.protection.outlook.com (10.152.18.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Fri, 28 Apr 2017 12:11:09 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wdG001682 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v3SC9wn9001645 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 28 Apr 2017 15:09:58 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 28 Apr 2017 15:09:58 +0300 Message-ID: <20170428120958.17526-12-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170428120958.17526-1-petri.savolainen@linaro.org> References: <20170428120958.17526-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39840400002)(39860400002)(39400400002)(39410400002)(39850400002)(2980300002)(189002)(199003)(9170700003)(81166006)(76176999)(2906002)(50986999)(47776003)(22756006)(110136004)(36756003)(86362001)(48376002)(5660300001)(356003)(6916009)(2950100002)(305945005)(8676002)(2351001)(77096006)(189998001)(5003940100001)(1076002)(106466001)(50226002)(105596002)(50466002)(38730400002)(53936002)(33646002)(8936002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:AM2PR07MB0899; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; VE1EUR03FT033; 1:EbXIeZOkx/KxG6wjDnyx7uK0nQnaR4pLMGVKlmlUdv2FeU3asTT6w3cqZ7ss9StmarLbGbOtDaM00o0yQ+YpqrOITF8Vv7OL57vRTlhQ00Ve4+z1xND+39vI7bh1n2cvCeIzcP+7LsTGU0WLdjOQW9d9Gbt+JRWQx4DQmzOilSUE3MU+iFsJHweJRKfi77xSJwXYSQukv7lefwpHRnyBIeQ7h0uD8EtLywW3GzIi1HAQBh/Xku+HBtqeY8cZEgEzR3hxIlRboJR07K2TsGtuzuHIJgUS/sUDdFtWPQ8KX9RpkfZzNxjkPp98A1U0VQvsNdfPIfDQBR1FRcD2sRT12zLUqJYV436sB0M2L95HjwOGvT3fQfO42I7YZGtZlYm/UypIzyhFVRBkRDGdCL3x/e9y3MfmXCAKN1U+qTRz6MjalfsmcWlHw930MQ9rRwT1GO2lBblVOYzwsppetbmD05Gny/fRGLGRiR/OpnTPGF5KBRqyWwRGGvmKMFd552SSn469snr9m/EBbNhjVAMEbw== MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: acf92fac-3a73-4a33-6b4b-08d48e2fa806 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:AM2PR07MB0899; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0899; 3:B+JrdO4AQ9iyEjTh9W9DTdP/lux06DSCXgo6pGCcfNdAvClP32hwdc5A+JgBgVSC1Ki4ShaHrRZ+IKNTwGZdUNPabm/0hlMoCL0eWlVr3PjVO2yuPZYJRk6mheTDzLjIcJFR4I79XGuZtHcx0wuJHNNKJWs7Yr3XR8yg2Y2E+4zUe14dG4UkYOQ3emTeDfCtFRfHdPXx406pJOe5AAPB2e68IeKMieE9Km8H6kEcBZNGs/YBLWAneKiPtGkIMe4WTOVN++xhFsLFLHvEuiSD5Oxd3TPwraJPpvD1wMKezMu66x7CBsuGslf85IXSMKK8lFI27vEeHlEFEpG7n2jJMQtzvk58iem48wc2dcml98ZZIUBiA5juV83wZ4NZiOYz1S+ila7i9khyF0nREuaFTwM2euGVaxQxPEjv9O+qY9Bvx1LZqP4wNquDixeDnPkhH5FjGpFEHwbUX/EuOsIKwg== X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0899; 25:kkJWVaxeEpBmySe5oS0meu3fWktZCBA+0SN2OUp789ME6xlQvk016bmAt78flTvhrrtpacC8BHuVGzL3hKtlLfHvEQQ51rfH+1Zz1r1OvTK8G9RzGdU9zJx8eEW7QIZALXMQMQE50U1tlOKLPIfMvG1Dq1IvMJGdsgzrRN6aK+XyxOHrlTBi0BkUzD2E2vWR4hUMr65w8+br2j1r1RzCt674J2cyVz2+mM6nNSZEStdAZPgnKGPht8R06culF/rCmhFZyOhUvh3dH4wlPtzFN/Q2H+py+/P+v7aqkLAkMRPuVKVNgSla4NJbjyRprgFX1/DHqHxoraw4m+XzqpMG7pMrdxNDV/oxiUDXIlkajeE5utuv8tQXgNDgBy8MZQbmq0U+zFEoNhb3VQhykUDRoO7BB8vhFnXGwU10x9lIK03sEB7DaVTMrNVtbyv7mMdPtquxZ2gUk5y+BYfOnUDLDNZ99jQ3hXOIB9N/7QI1PuI=; 31:Zb61vrZ6LUoCtNw/MXqcBUnCR9M7efzUUz702/QulzhR4R+zI6tjrkai17pkufGEadvMJCP9F9aclr43zksJoJ/Ngst8Uh4n6up7s9IpCx/E32VySsaucZvkrSou1aP2iLOnPb9KC4JWvFNG44AtAzb+4qxbklX27ic8JkIEwPfNJ8SgajCyL7luRzXClkaNMuwkfm2U0iifVgz0oqt4qveJJL17RccNaes6lpWEkqG3LQS3kd6rOeTLtziHH/o2nIWTef7AkDsB65FHOq/122+sdk9rAL+BxZsHXNDqSRw= X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0899; 20:W1BzjeIxoZ2OyEodMY+3M62I4pBP2MEt0MEzeqvqiYa0ob5hl7c1D9tbIthEfkSLmNCb/oQmg1x8rkegB4NNH+4gafEO86hCgEOQDTcMsGQw2I4rKOK0wwqxSOma7zMm/E3FNc12++RzsySl6GlYvb9/jm7LUcD0I1j4zJqqUbX1l6KALfID6NmEcDS/aZ2z0xzw5ahFUBaL9nCwbgs99F3MYrPkyyg4/OglUD3i5Uxw5HecipBspn31bBG0Vtjg2sAnvuCdEY5LWcjHQu+qaqlfqiUZv311ACagHXKGT3C2Zpedpy6e4LoLY7LyI28IwdbAMf3HKaPz0lkVOrKvtFDprVZpWJo/S+hB+AKOkazIFgdTDKY2LxqBT7P93KYkAlIH2RpdY1ssD1Y0VaLKHHwSAPGFVqjHpzVP28UvVmksYv2W56QhlsFSn2jpXL6y54utvmIB/knVsmuLRtEGN4VOGekLOZ96CI3sOi3V+mCXL3BBaviopBGI85pL9LRuPdEdkFKdvIOa/g3isjqOyRJNwIRtYpsNxv9TL311rZq33hmUZYEZC5G8vELzPdmBBj+uAIgpo90EqJnlw22c2N9RtLO322K/oIC8Cr9I8iM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(13013025)(13021025)(13023025)(3002001)(10201501046)(93006095)(93003095)(6055026)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123560025)(6072148); SRVR:AM2PR07MB0899; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0899; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0899; 4:Ch0Ba1yisnmVgakM7Jw6S2usEuj03OegxvsKHQ1XBvdtQlQXV0jY0/RL1ZEE39luvyqRuT+s+g8Xri9mfPf+2yHKEo+uBwz5jQhBxzMPXKfXvNm9RzPajGzcF3DPkHEAs5qF0zt8tMQZ6+d3oRazvYLdeYk50q6DKvp263B27kjCO0EI+u4ND4I7+kSro8eK4bHseX7tzNBoOtx5zAoXNPk9M271oag7FmWuVzsCtHEjaNevtQnam5tlB8t/w+uofvoaztUv5kBh94oemb/rooz0qyY2oFlbKqRb6SD7Gv45+aiVsmWeOJTkr4CQgRIyVXgmWhlIu6AugjZuGJ1cMobA9vGxeKDEvOmg7yzp5mLM3NB9T1ITmuYUOyFIk6OXyVnWKhpgMA4Ej5ZFNFu+vz47XMoF9bp0oKK4W0yErEPF5jYi4fUtnZMNTP5NsGiNiD8zqwlzAJdN4RGhGO3ZSK8LzXubArHzJSd0+y03Y00cDhqHHKdKfz+9i0m9JPlzY8eoeMnioWB7XMY4o1DoaxtJ+2M7NR7qzEtSTKZrfldwGyodDtp9P7Lvczv8R1sCjBOva5j1lxx/ZAwRY4MDZbSwf4iWDbp5kqqmCeJwCyDFpeh99KLLWurFLtc2b7TIAnrAtTzykqLDvLDzrrLXzwBsl82UiSECRDnuvI4f1ER9FXyFIxpzX29Z0l5xUt9TS6VbA5ZsCp+v/sZPpmPPGxDP+vfuL3E6H0NfgelkFfVH8R0m+a7PTIHDk1zuA5hj6DCm4Bo34IoFyNQQMRbNiK7CKwEb/jGvtEDLdduAzempKZRsP5c5FnlNwVQMaT3w1tWu48kSFyhrMe0nuNvTZu7qJCV8B4aCQd3l/n1pyNs= X-Forefront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Dyq3p+bEroehndsvGvA++FIuBaGBvE+zwZONgawcHbOw/waA= X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0899; 6:HhG5VFJbMxZstWR49knY5Rxunni/ciaNZSpmRfESBYcrBn1/YgXu41ivm1tiM6Zbm7jd0dqqh8tQ5e2EdV+HGdhgMJVlsKyjGKJcRsq8DCW55ikKHl1NevDF3tEaaUioTlgUBlrcsAaqIbA5J9yP/766KVQqvR3BdU0CfDSMhLLZcHnSvIdD2LWoqJZQTEE2MpZsNx/TaaJeKvghB3KZ2RryducLbAHNCGwzTOHKxU2WXwffxLsaIEMCmf0Vo28Hmx4/u7UV0V+NNWIb6vmqzQrnxHqq8FaPW2Yo9c2GgDiuQmpRO4rV1/Frs47QVbE6G+1+WH9GdIYP5pfoZHRYBwuCH3amEMcxxSz+KFsaDwJuBFoRURZ4skmCVW56UZWy5Q9Bt/hvA0yWu7hGJ98Uy+GXHoNej9mic37FJtsem8KFohZakMICKE2OtjyYR2wSCVp/l+ICIlfKVUrOj5EAKKqdUka038X6nIx8RETyUbtjhf6QLpBLQyGvJIopdF7z+YB0cfur6DXOrNH5FX6N9/WJ1R461/j63r7xq0YNyvHnUCphrmPXgZxuaAdjXDuofFBdreAW/CAjWYu0SltVmw==; 5:K3r8H0rP5RfP88e0Fmih1pA+5DXsXLwc9yQHRC54bS/IeTGS84Tog6YJzT0wVNwXlvlCQdsg0IriqRJrFXGQ4h0f3xPzSPUbtH122KfesaXpNYtBu9LgN2OKyg+f9Ql8HH9l/zOy/GPQoOsA6L9x2A==; 24:jd92lIFKD9k4O/0RNykr4ALwFaGGueS+xie8ZAh2Yu6SCXXM8Yt5fdB2i9vp40BRhA9Lu9dO69uHnSy/Ge1tHlkk/C+xdv22JzaXuNzxW38= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0899; 7:r5kXtnf673HbD3zpzz6vjzaIt4maDrRgFyynaAoXc4Hp6LZ1WsxdbF0cmMxYpLYcpynmlv++ccdEC1wQ42RkUZTAdTC8nf4htU1M9deEI+qrzgNILNBgF6plZNPwLWz6neU3Mf6cXsropu5562GyBATBvmHs98m8P+PBeu3Y+XqHNES0Vc8pMkkuSf29O8mwO/jNpxaM0gvoRfLMRPncWxhYfsvj9Ckl+UT4l5L3UwhjzJkFB7QXSzir2WDcki4jBIQV2d4RYUTnrM2axMC4MtKS9LPwRbMHI7JfDKLm4NGy9NBYnp30+iIWJZD08xUdmVoPoN2tlATc5LXyN29FSw== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 12:11:09.7963 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR07MB0899 Subject: [lng-odp] [API-NEXT PATCH v3 11/11] linux-gen: time: store timespec as nsec X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Use single 64 bit nanosecond value to store time when using posix time. Posix time stamp is converted directly from timespec (sec + nsec) to nsec time. Storage space for odp_time_t is halved as both posix and HW time use single u64. Some functions (sum, diff, cmp) are generic for both time sources. Signed-off-by: Petri Savolainen --- .../include/odp/api/plat/time_types.h | 32 ++--- platform/linux-generic/odp_time.c | 143 ++++++--------------- 2 files changed, 52 insertions(+), 123 deletions(-) -- 2.11.0 diff --git a/platform/linux-generic/include/odp/api/plat/time_types.h b/platform/linux-generic/include/odp/api/plat/time_types.h index 1cafb1f7..71e354e6 100644 --- a/platform/linux-generic/include/odp/api/plat/time_types.h +++ b/platform/linux-generic/include/odp/api/plat/time_types.h @@ -22,32 +22,24 @@ extern "C" { **/ /** - * @internal Time structure used to isolate odp-linux implementation from - * the linux timespec structure, which is dependent on POSIX extension level. + * @internal Time structure used for both POSIX timespec and HW counter + * implementations. */ typedef struct odp_time_t { union { - /** @internal Posix timespec */ - struct { - /** @internal Seconds */ - int64_t tv_sec; - - /** @internal Nanoseconds */ - int64_t tv_nsec; - } spec; - - /** @internal HW time counter */ - struct { - /** @internal Counter value */ - uint64_t count; - - /** @internal Reserved */ - uint64_t reserved; - } hw; + /** @internal Used with generic 64 bit operations */ + uint64_t u64; + + /** @internal Nanoseconds */ + uint64_t nsec; + + /** @internal HW timer counter value */ + uint64_t count; + }; } odp_time_t; -#define ODP_TIME_NULL ((odp_time_t){.spec = {0, 0} }) +#define ODP_TIME_NULL ((odp_time_t){.u64 = 0}) /** * @} diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c index ac82175d..2bbe5666 100644 --- a/platform/linux-generic/odp_time.c +++ b/platform/linux-generic/odp_time.c @@ -15,10 +15,10 @@ #include typedef struct time_global_t { - odp_time_t start_time; - int use_hw; - uint64_t hw_start; - uint64_t hw_freq_hz; + struct timespec spec_start; + int use_hw; + uint64_t hw_start; + uint64_t hw_freq_hz; } time_global_t; static time_global_t global; @@ -27,19 +27,23 @@ static time_global_t global; * Posix timespec based functions */ -static inline odp_time_t time_spec_diff(odp_time_t t2, odp_time_t t1) +static inline uint64_t time_spec_diff_nsec(struct timespec *t2, + struct timespec *t1) { - odp_time_t time; + struct timespec diff; + uint64_t nsec; - time.spec.tv_sec = t2.spec.tv_sec - t1.spec.tv_sec; - time.spec.tv_nsec = t2.spec.tv_nsec - t1.spec.tv_nsec; + diff.tv_sec = t2->tv_sec - t1->tv_sec; + diff.tv_nsec = t2->tv_nsec - t1->tv_nsec; - if (time.spec.tv_nsec < 0) { - time.spec.tv_nsec += ODP_TIME_SEC_IN_NS; - --time.spec.tv_sec; + if (diff.tv_nsec < 0) { + diff.tv_nsec += ODP_TIME_SEC_IN_NS; + diff.tv_sec -= 1; } - return time; + nsec = (diff.tv_sec * ODP_TIME_SEC_IN_NS) + diff.tv_nsec; + + return nsec; } static inline odp_time_t time_spec_cur(void) @@ -52,10 +56,9 @@ static inline odp_time_t time_spec_cur(void) if (odp_unlikely(ret != 0)) ODP_ABORT("clock_gettime failed\n"); - time.spec.tv_sec = sys_time.tv_sec; - time.spec.tv_nsec = sys_time.tv_nsec; + time.nsec = time_spec_diff_nsec(&sys_time, &global.spec_start); - return time_spec_diff(time, global.start_time); + return time; } static inline uint64_t time_spec_res(void) @@ -70,48 +73,16 @@ static inline uint64_t time_spec_res(void) return ODP_TIME_SEC_IN_NS / (uint64_t)tres.tv_nsec; } -static inline int time_spec_cmp(odp_time_t t2, odp_time_t t1) -{ - if (t2.spec.tv_sec < t1.spec.tv_sec) - return -1; - - if (t2.spec.tv_sec > t1.spec.tv_sec) - return 1; - - return t2.spec.tv_nsec - t1.spec.tv_nsec; -} - -static inline odp_time_t time_spec_sum(odp_time_t t1, odp_time_t t2) -{ - odp_time_t time; - - time.spec.tv_sec = t2.spec.tv_sec + t1.spec.tv_sec; - time.spec.tv_nsec = t2.spec.tv_nsec + t1.spec.tv_nsec; - - if (time.spec.tv_nsec >= (long)ODP_TIME_SEC_IN_NS) { - time.spec.tv_nsec -= ODP_TIME_SEC_IN_NS; - ++time.spec.tv_sec; - } - - return time; -} - static inline uint64_t time_spec_to_ns(odp_time_t time) { - uint64_t ns; - - ns = time.spec.tv_sec * ODP_TIME_SEC_IN_NS; - ns += time.spec.tv_nsec; - - return ns; + return time.nsec; } static inline odp_time_t time_spec_from_ns(uint64_t ns) { odp_time_t time; - time.spec.tv_sec = ns / ODP_TIME_SEC_IN_NS; - time.spec.tv_nsec = ns - time.spec.tv_sec * ODP_TIME_SEC_IN_NS; + time.nsec = ns; return time; } @@ -124,7 +95,7 @@ static inline odp_time_t time_hw_cur(void) { odp_time_t time; - time.hw.count = cpu_global_time() - global.hw_start; + time.count = cpu_global_time() - global.hw_start; return time; } @@ -136,40 +107,11 @@ static inline uint64_t time_hw_res(void) return global.hw_freq_hz / 10; } -static inline int time_hw_cmp(odp_time_t t2, odp_time_t t1) -{ - if (odp_likely(t2.hw.count > t1.hw.count)) - return 1; - - if (t2.hw.count < t1.hw.count) - return -1; - - return 0; -} - -static inline odp_time_t time_hw_diff(odp_time_t t2, odp_time_t t1) -{ - odp_time_t time; - - time.hw.count = t2.hw.count - t1.hw.count; - - return time; -} - -static inline odp_time_t time_hw_sum(odp_time_t t1, odp_time_t t2) -{ - odp_time_t time; - - time.hw.count = t1.hw.count + t2.hw.count; - - return time; -} - static inline uint64_t time_hw_to_ns(odp_time_t time) { uint64_t nsec; uint64_t freq_hz = global.hw_freq_hz; - uint64_t count = time.hw.count; + uint64_t count = time.count; uint64_t sec = 0; if (count >= freq_hz) { @@ -197,8 +139,7 @@ static inline odp_time_t time_hw_from_ns(uint64_t ns) count = sec * freq_hz; count += (ns * freq_hz) / ODP_TIME_SEC_IN_NS; - time.hw.reserved = 0; - time.hw.count = count; + time.count = count; return time; } @@ -225,26 +166,22 @@ static inline uint64_t time_res(void) static inline int time_cmp(odp_time_t t2, odp_time_t t1) { - if (global.use_hw) - return time_hw_cmp(t2, t1); - - return time_spec_cmp(t2, t1); -} + if (odp_likely(t2.u64 > t1.u64)) + return 1; -static inline odp_time_t time_diff(odp_time_t t2, odp_time_t t1) -{ - if (global.use_hw) - return time_hw_diff(t2, t1); + if (t2.u64 < t1.u64) + return -1; - return time_spec_diff(t2, t1); + return 0; } static inline odp_time_t time_sum(odp_time_t t1, odp_time_t t2) { - if (global.use_hw) - return time_hw_sum(t1, t2); + odp_time_t time; + + time.u64 = t1.u64 + t2.u64; - return time_spec_sum(t1, t2); + return time; } static inline uint64_t time_to_ns(odp_time_t time) @@ -284,7 +221,11 @@ odp_time_t odp_time_global(void) odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1) { - return time_diff(t2, t1); + odp_time_t time; + + time.u64 = t2.u64 - t1.u64; + + return time; } uint64_t odp_time_to_ns(odp_time_t time) @@ -338,7 +279,6 @@ void odp_time_wait_until(odp_time_t time) int odp_time_init_global(void) { - struct timespec sys_time; int ret = 0; memset(&global, 0, sizeof(time_global_t)); @@ -357,13 +297,10 @@ int odp_time_init_global(void) return 0; } - global.start_time = ODP_TIME_NULL; + global.spec_start.tv_sec = 0; + global.spec_start.tv_nsec = 0; - ret = clock_gettime(CLOCK_MONOTONIC_RAW, &sys_time); - if (ret == 0) { - global.start_time.spec.tv_sec = sys_time.tv_sec; - global.start_time.spec.tv_nsec = sys_time.tv_nsec; - } + ret = clock_gettime(CLOCK_MONOTONIC_RAW, &global.spec_start); return ret; }