From patchwork Thu Jul 9 10:46:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hongbo.zhang@freescale.com X-Patchwork-Id: 50940 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6CFF122A14 for ; Thu, 9 Jul 2015 10:51:59 +0000 (UTC) Received: by wgwk7 with SMTP id k7sf22970555wgw.0 for ; Thu, 09 Jul 2015 03:51:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:mime-version:by2pr03mb608:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:content-type:content-transfer-encoding :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=Qxjp6FQIxecc0ylkbZl2uQjPO3/DSNd9pvDRjhUmMxA=; b=TbO+CSNRii7Z3FeLW2vWnIC8838EwVFXDV8iaz7lkW6a13aXhacVaP9+lueMacyt/3 6fklp57xRdjh+hnbHWf9fqpkqi/oSIT9eyxQoGx7LEehpx1Tay68oLt0kKa05t/V8rJS DdSN2E/Kt6LCkpqHEP9f2m27/hPZEGHmauMtuwErXSDNVU0/0pguJIzd8ATf4Rf7eHAF 6hd4E93+iHXI4vme80ljiyyKoGv4GmYilwY5Z77lEOqCb3NNSI757s9mZERonbQoiVwv K3eR3j7y1rPBpBcm/lIvFhGA+ixuaIbP1gCk7ESPQKDsbw9E8RTmWZekVbSTIgXuGrgc F+SQ== X-Gm-Message-State: ALoCoQmQ2a3dYitOQW57Z1SoDieYTMXJUHmNDgVGjX7Xjm8m5pT4wPFa6yd6RAO/eF0RTcHpH3sd X-Received: by 10.112.138.2 with SMTP id qm2mr7673665lbb.19.1436439118739; Thu, 09 Jul 2015 03:51:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.136 with SMTP id q8ls1160132laj.91.gmail; Thu, 09 Jul 2015 03:51:58 -0700 (PDT) X-Received: by 10.112.164.66 with SMTP id yo2mr14114894lbb.33.1436439118614; Thu, 09 Jul 2015 03:51:58 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id ay7si4473880lbc.60.2015.07.09.03.51.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 03:51:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by lagx9 with SMTP id x9so243575517lag.1 for ; Thu, 09 Jul 2015 03:51:58 -0700 (PDT) X-Received: by 10.113.4.105 with SMTP id cd9mr8286443lbd.106.1436439118184; Thu, 09 Jul 2015 03:51:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp579080lbb; Thu, 9 Jul 2015 03:51:57 -0700 (PDT) X-Received: by 10.140.152.130 with SMTP id 124mr24573162qhy.65.1436439116449; Thu, 09 Jul 2015 03:51:56 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 12si6137153qhx.61.2015.07.09.03.51.55; Thu, 09 Jul 2015 03:51:56 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 771A661FBD; Thu, 9 Jul 2015 10:51:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 6BEBD61FBE; Thu, 9 Jul 2015 10:48:07 +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 E3D9861FBE; Thu, 9 Jul 2015 10:48:02 +0000 (UTC) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0131.outbound.protection.outlook.com [207.46.100.131]) by lists.linaro.org (Postfix) with ESMTPS id D8D1961FBE for ; Thu, 9 Jul 2015 10:46:26 +0000 (UTC) Received: from BN3PR0301CA0018.namprd03.prod.outlook.com (10.160.180.156) by BY2PR03MB608.namprd03.prod.outlook.com (10.255.93.39) with Microsoft SMTP Server (TLS) id 15.1.213.14; Thu, 9 Jul 2015 10:46:25 +0000 Received: from BY2FFO11OLC011.protection.gbl (2a01:111:f400:7c0c::128) by BN3PR0301CA0018.outlook.office365.com (2a01:111:e400:4000::28) with Microsoft SMTP Server (TLS) id 15.1.213.14 via Frontend Transport; Thu, 9 Jul 2015 10:46:24 +0000 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11OLC011.mail.protection.outlook.com (10.1.15.22) with Microsoft SMTP Server (TLS) id 15.1.213.8 via Frontend Transport; Thu, 9 Jul 2015 10:46:24 +0000 Received: from hongbo.ap.freescale.net (hongbo.ap.freescale.net [10.193.20.67]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t69AkBfj022771; Thu, 9 Jul 2015 03:46:22 -0700 From: To: Date: Thu, 9 Jul 2015 18:46:08 +0800 Message-ID: <1436438768-4258-9-git-send-email-hongbo.zhang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436438768-4258-1-git-send-email-hongbo.zhang@freescale.com> References: <1436438768-4258-1-git-send-email-hongbo.zhang@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC011; 1:00RajPUOGxDOJjVkllKG/QTF7DVutHQltmoT9UrQNnvojD67V9bhVbjmZ0r9LkkIrZPAvbzJ+6poyz3Fk/7ISUZONDCdeTHKDdWS9e1Zgl22PXAZMKY6/mxCjTKS1Zt0ZqI5vaH9Gpkd+kox+1+1D/jqt7uWXBof7rnNOHQ80jZjx1R4dJKw3bhMMC6MT2nd3ET+Rxb5//ASM0Hcj7rbRXLqK2Xf2qmUD8HjD0hwrdsyftVTVvCUTeZW36VD2EbQ0mo2NsQm7VAH+kmlmwhzN00sd1t2Vt/kgfMrrgm0BV31HgZEkLZ9Z9aNeq+1mactntt3/7Otd12PQByG3Zv890ZrBDbG8jsuBSwUam6mJFXpGw7KPZV2qczN4fWe1kscBGaT27bO7Nqrq/c8A5sAL7m+QeyZ+ykLzBCftQxbeUY= X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(92566002)(50986999)(76176999)(85426001)(104016003)(33646002)(46102003)(77096005)(110136002)(5001960100002)(50466002)(5003940100001)(36756003)(86362001)(2950100001)(47776003)(77156002)(19580405001)(106466001)(86152002)(105606002)(6806004)(62966003)(189998001)(19580395003)(2351001)(229853001)(50226001)(87936001)(48376002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR03MB608; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB608; 2:eEob/ayBmk7w2I+zsz1B26agqK7IDbazv/zK/NBrLH+QGfZKQe+mmPvA66m4O4ky; 3:PJjntdVROIH6fVrcl7fv5Jl9mOvbZC71dH3dBJlvp2K5jisC5O+9AO8HEL+8gRZ4lVxyh0+0LKMgM2W0NXfUXFhwqLuyWuPqePDVDIuvGHcoCQaF2Ok2DHc67cv3+xQYIC835O5L78c3bC+fcL2KyzpyjFxs8L17czwVLHtv6QqOO/xA5R06PBKpXQgt+Nk2HABKv9JuB4G4Aom6BV+wFmaRmiQ9dEJFdsVxc/kg9QA=; 25:PblF1ziYKvhBgvQfF2drWSs7FOoJn/A7bDpHDyFYq/xAPW6Jt/7zXW1h+QN60Kj2Sc+XPV+KSXaGKikC8EbJ8Tj+0R1DH9kBM0jiKYZVFWXFhr8KPYTPVAsZJA5u3ZW0vI6NHMmbC9QrocVxyGb3eTxyCBURporJJlY1wovKC1HVkgDpXpevWgVH9CmpO8FbEn8DZo7d6whVkA8cAPIO3HJOcCS8j31CT+p6p3vpcGWZAwXKmL0N8F65tFMyBMnatO4Ud1HwlEoPIvwTeWe4SA==; 20:uhXa/4rwWFjVwhLUH6wro0c65gvSmh7BP40qr0Ns/pSBK1hV5+ThlcdNCFq5OcAt/rGJgwQD4XLCPK1QtaqdvMyvjPeXU6/vPo6Q48nFoL+LIBueOV62ZFlI799n95A8as0syQX6bPMrXJMUTRMtrxg9JZAPm3c7oeGdxZoRbOLyDPklDqp330OsnYbP3Yzpr6Tkh2f30VPtdUOp/i6QyNUXfdwU42emuUqPQdAZ4P7k/Udbx5+CI5tYbf/lEPmgP8qnt7HQrN9CTJ2PkDVW13OebB0mdbU6DhRXjPT5RgCqSBm5bRBQe9E0k7NUzRM8cFxIgH5f8yr3RVzGoonijHlinh1S7P0BqADyQmUkNPw= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB608; BY2PR03MB608: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BY2PR03MB608; BCL:0; PCL:0; RULEID:; SRVR:BY2PR03MB608; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB608; 4:7g7dKqI81Afact7Mquef/VIsgSyu6zkTAUMyqR4X17OT+k5KSmRVnmGkjWb5Jc4YL4PZzmQwqO0xWZg/C+9ZKrNZuCmU3BQ5Ast//sZZKLiWMCSO4Fyeshr8qJ00BisP22QuC8hZ3fP4LHx98ZmPXPIuYIQw/JjM5bai/PnwWapI1YNEDbVus6PX7MLe4Z7OfCIAy7FnsDRHHqh6sD7yld6DuvnirYXTA9OWt4HhuRgOUEsc65x+YSldcgPK8MrXvNUROthUrVkE3A1l6466nLddXBA7VgzVrCmsLMgDUjc= X-Forefront-PRVS: 0632519F33 X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB608; 23:6cXFrvFv8UmgjJGEjiImjcajePAvTUutIThCP+d+Vc0aRfb5VswQF3RvhjuLfXFEsH92Yygiijqdo+W24ZotbkafAFCMOpZIXT3yRvScF2imgFwwvqEIc12oCznFNs3KkOtAEoLBw2AByutbMLTBM7EA0wb2v493dexQeUqDH0lf00SwyL/6oM17LYl6BL8tsSJsnEYmCzbsqA3HNlaQvxoKGVF77gkGOwH9Q+qReebcTnMWFSx6/6HEHxOv2h28b05LJZhcumNCSnHg0LW06QXSJOBZ8P29ljYIpa00PNEapMTgxApx7S3QxQJjTAJDepCtK7PoV8JhmwWGWBGgxHEwzGCCix0h/lc0C0YcDJh7hbp3CZzVSJvL0secMurqlqhrWAPhMnAVys74qZ2drM0ohp5qf1Z+2+rUuDwBl6UPa4FlkReuwrroTjT1E0Src4QLacEvqZYmn0/I2CJftamWLs0JZupxbnH9jBsRdbOGfbsqKgu5tk129QvdIuBeRhkuKXXWD4OfthXvmVSUA7vrUbv+zor0RRNWhrJ98TrJUfg2xf7ssa+xL8M1mGeZQe2VA7ZDtmgvesuq7x0+vnOUeuO52ks+Q3oZK/vwJ5WGyyflXgh/T0OjYyNlm0fnCNbteUTIDXZlHlDJGWMhRk2U3nUpbs9FhR4AtOhuFqh7SihAgC2bNH88UWD6um6B7tUlhxugPJ6XKQ/5WB6qmlIsi1IVRvIjD7aTIkgID4WI2Sq70uGY9EcSiPxfrUgsqUeV6UYWv5frRUdcWJ7DXHjCX9157mAfot3uEpI51x9djQFMFSNxia5QQpiybGxXvoCSI1oEoudJudXRk4jZOzUA07TBfg3weiPLEwEbkZg1imCvRVAO+mxp9fjZRyDjlkG8+AVWTCT3hTvcSNI0o0PEWjcanZvw2h/GZL4xj8BvYXeyVmbfI+OCXTKd5Oeg X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB608; 5:kAaVVSxJDL9GjrUYEo1/LVF1190hrN4s4yiXGe3hReejBjaHnM7b3CFqVaTIDQA30GlKKGBEfDOCnmOs3rmecxK3nxEvgHttBbMK6ORNf+O+MnVDFW8YuSa3wivTkpC10QR8uigEyAJajwOg8s2c2A==; 24:am2L9sbX9KoJzqJDqR2K/q+CVtFo2p6TcjklYn4LLIob7XqEsSkaCaIKp9oTqfJKqHJYGzsPN0QokyZwUHsf6Iht3oSRXAh8w+0IpmSc8X8=; 20:sxhqpIJGiGu7cH7mp1vy+sRPgPX3+VQToEDzUVvx+3GQWOXzlfZUB8t+F+RA+6K4pPoid4z0pe/UlA8bkV5uqw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2015 10:46:24.2450 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB608 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v3 8/8] validation: add test for new per_CPU system APIs X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Hongbo Zhang This patch adds test for the newly introduced per-CPU system APIs: new per-CPU APIs: odp_cpu_id_hz_max(), odp_cpu_id_model_str() abd new crurrent frequency APIs: odp_cpu_hz(), odp_cpu_id_hz() Signed-off-by: Hongbo Zhang add --- test/validation/ver_abt_log_dbg/odp_system.c | 49 ++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/test/validation/ver_abt_log_dbg/odp_system.c b/test/validation/ver_abt_log_dbg/odp_system.c index 9058c6c..ab6d07d 100644 --- a/test/validation/ver_abt_log_dbg/odp_system.c +++ b/test/validation/ver_abt_log_dbg/odp_system.c @@ -57,6 +57,19 @@ static void test_odp_cpu_model_str(void) CU_ASSERT(strlen(model) < 127); } +static void test_odp_cpu_id_model_str(void) +{ + char model[128]; + int i, cpus; + + cpus = odp_cpu_count(); + for (i = 0; i < cpus; i++) { + snprintf(model, 128, "%s", odp_cpu_id_model_str(i)); + CU_ASSERT(strlen(model) > 0); + CU_ASSERT(strlen(model) < 127); + } +} + static void test_odp_sys_page_size(void) { uint64_t page; @@ -82,11 +95,47 @@ static void test_odp_cpu_hz_max(void) CU_ASSERT(0 < hz); } +static void test_odp_cpu_id_hz_max(void) +{ + uint64_t hz; + int i, cpus; + + cpus = odp_cpu_count(); + for (i = 0; i < cpus; i++) { + hz = odp_cpu_id_hz_max(0); + CU_ASSERT(0 < hz); + } +} + +static void test_odp_cpu_hz(void) +{ + uint64_t hz; + + hz = odp_cpu_hz(); + CU_ASSERT(0 < hz); +} + +static void test_odp_cpu_id_hz(void) +{ + uint64_t hz; + int i, cpus; + + cpus = odp_cpu_count(); + for (i = 0; i < cpus; i++) { + hz = odp_cpu_id_hz(i); + CU_ASSERT(0 < hz); + } +} + CU_TestInfo test_odp_system[] = { {"odp version", test_odp_version_numbers}, {"odp_cpu_count", test_odp_cpu_count}, {"odp_cpu_hz_max", test_odp_cpu_hz_max}, + {"odp_cpu_id_hz_max", test_odp_cpu_id_hz_max}, + {"odp_cpu_hz", test_odp_cpu_hz}, + {"odp_cpu_id_hz", test_odp_cpu_id_hz}, {"odp_cpu_model_str", test_odp_cpu_model_str}, + {"odp_cpu_id_model_str", test_odp_cpu_id_model_str}, {"odp_sys_cache_line_size", test_odp_sys_cache_line_size}, {"odp_sys_page_size", test_odp_sys_page_size}, {"odp_sys_huge_page_size", test_odp_sys_huge_page_size},