From patchwork Tue Oct 13 11:13: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: 54836 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id EACEB20490 for ; Tue, 13 Oct 2015 11:35:54 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf7825486lbc.1 for ; Tue, 13 Oct 2015 04:35:53 -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:spamdiagnosticoutput :spamdiagnosticmetadata:cc: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=t4qLdtgQcx0x27N1qyM8bAbrJg1yew8KtdSYg6a6LTI=; b=NDYAUbDJ0s+7NujJz/u3ZtZW9tP5wTep5fTeVxD83MpaqGG9kqGEEq/UatGfpOWiXT yOW5UTEX5Dshtv/y4+8mc1YdBlwaxsj8A4BLApgkcooLhmBXb7zr+la9wWlsKHo0go0C 6lJyCwJLFQuwoyNdSeUN/Nn2XBNcOD5NuXzjhKHjEwHTK7mN00qUjAVPqmqPOzU/AMIs /zMTKz/rWHR5Rz2lR/b5o6yHjA8SE/pW8VPMkXEzwh0G/vYBsc8Kqm7c3dRyqK5Nh71K j7aThMRCdDWMz48BLvSoqEbwiETEHooAygxBhA9F44zKyXdYwuKZZXFqHoa7QAK3X7bC rO8A== X-Gm-Message-State: ALoCoQmiiY58zgDD2bimspL6PZ9y2jCAO4ehv0NHd+n0AFw7l7UJpmBxU3ZXVfvBGIqBorcUT7U/ X-Received: by 10.180.81.165 with SMTP id b5mr4118549wiy.1.1444736153911; Tue, 13 Oct 2015 04:35:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.30.18 with SMTP id e18ls586307lfe.35.gmail; Tue, 13 Oct 2015 04:35:53 -0700 (PDT) X-Received: by 10.25.146.193 with SMTP id u184mr9609725lfd.50.1444736153633; Tue, 13 Oct 2015 04:35:53 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id x128si1874910lfd.127.2015.10.13.04.35.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2015 04:35:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbwr8 with SMTP id r8so16178988lbw.2 for ; Tue, 13 Oct 2015 04:35:53 -0700 (PDT) X-Received: by 10.25.19.97 with SMTP id j94mr214498lfi.106.1444736153329; Tue, 13 Oct 2015 04:35:53 -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.59.35 with SMTP id w3csp2075116lbq; Tue, 13 Oct 2015 04:35:52 -0700 (PDT) X-Received: by 10.50.134.73 with SMTP id pi9mr19732934igb.20.1444736152134; Tue, 13 Oct 2015 04:35:52 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u9si2227479igh.3.2015.10.13.04.35.51; Tue, 13 Oct 2015 04:35:52 -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 98C0F61A1E; Tue, 13 Oct 2015 11:35:51 +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_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 94C8E61A47; Tue, 13 Oct 2015 11:32:51 +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 A286161A23; Tue, 13 Oct 2015 11:32:44 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0133.outbound.protection.outlook.com [157.56.110.133]) by lists.linaro.org (Postfix) with ESMTPS id 284DB61A27 for ; Tue, 13 Oct 2015 11:31:42 +0000 (UTC) Received: from BN3PR0301CA0076.namprd03.prod.outlook.com (10.160.152.172) by BN3PR0301MB1267.namprd03.prod.outlook.com (10.161.209.147) with Microsoft SMTP Server (TLS) id 15.1.293.16; Tue, 13 Oct 2015 11:31:39 +0000 Received: from BY2FFO11FD052.protection.gbl (2a01:111:f400:7c0c::117) by BN3PR0301CA0076.outlook.office365.com (2a01:111:e400:401e::44) with Microsoft SMTP Server (TLS) id 15.1.293.16 via Frontend Transport; Tue, 13 Oct 2015 11:31:39 +0000 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD052.mail.protection.outlook.com (10.1.15.189) with Microsoft SMTP Server (TLS) id 15.1.286.14 via Frontend Transport; Tue, 13 Oct 2015 11:31:39 +0000 Received: from hongbo.ap.freescale.net (hongbo.ap.freescale.net [10.193.20.96]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t9DBVOFm009638; Tue, 13 Oct 2015 04:31:36 -0700 From: To: Date: Tue, 13 Oct 2015 19:13:08 +0800 Message-ID: <1444734798-29063-5-git-send-email-hongbo.zhang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444734798-29063-1-git-send-email-hongbo.zhang@freescale.com> References: <1444734798-29063-1-git-send-email-hongbo.zhang@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD052; 1:2VvSclCiHA0TRHiuqWN+Q1RQQaT8FwTUldjjJLqMLh+vyTJeh2kbd82EiAlQDi2jkci8NBjJ0+cnAK0iioyFxydSOhu2CPtxqLltosUheuEAnOAeysW+QXdoWzINIrA9cB/I9V+Lggvv00GDomsNbPrDEpXoBmojty3UFJwJ2N/VUH2rYHqEpqLtfDR8ELfp9jKtFAuRFX5U0SiGEXoxxA+hWHknn5x+ho708dEf9ob3jWRxNXCmLH6Q0HYJXOgN7jVVCUCFChJN7ccIerXlCR6g2VdejMW8O4e8A14xZiowloDkcokLMWVwXedu3tzsrTn6nV0H63ckcJe9/Oxa3k9PFQnRjrRvqQWgE3lIOwDf3V+JI7xiLrT0JtEx7BSvAJ9M+LnELiZifw4v4sZ+2A== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(50986999)(50226001)(36756003)(575784001)(86152002)(64706001)(5003940100001)(5008740100001)(81156007)(47776003)(97736004)(85426001)(110136002)(5001960100002)(2950100001)(189998001)(87936001)(104016004)(6806005)(5007970100001)(48376002)(76176999)(11100500001)(2351001)(86362001)(105606002)(77096005)(46102003)(19580405001)(33646002)(50466002)(229853001)(19580395003)(92566002)(106466001)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR0301MB1267; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1267; 2:jNpGoJEPm+v+dyOle9a0hjHdV3ZTGbJc99LlaDiqPJWeKybK3MxlxvIKjKMePPSu8mEjEQie3LpZF0LHFhaYcMacLdVqdmfVPiZ9XvcoTjIiYAVjqabqUCaJ9T4s0mZwVP20IHVLw7Al1uDWO3zi52mBd+mVUHeprd6SXkMtVc8=; 3:ZPAXHb75nFdNsQEYU/0O8kRavIJDRz0DjyFr/cdOnDdqL0bHA0eZH41u5+zBI00IFaqFkTIfaccsVolIsdISkWXTsmvvR7BHHO/jZxXEGXELVMa5ZJJpU7h/CY5IRDssO77e1cpojlzfjcffYq+Gp8pCKksVFj+v1/XAc49MVH2YZ666z+hvjXIntC+lOJHuW8vW377efeYvX3bH6YAZUI8njXdRFTItllGtUK8VGFQ=; 25:7vxt42n1wnPuEGXu1CU/Xiv8HcCgfVvAxwE26firv5M7BtWpvGPZ+siY/jzi/wIcpfEAlyydNYbcZztDVsZdUkPbko4ZEBSr7DRFHCC0PhtKROJdOTrjmPxvfTE3xMsnKwQkOBb9j06twzh5UA3PQi0RxbnOSuV5TIilMLWyOTDjO7Nj88Rg1aXbepaz9MWAORzwY6t/FIRp8lMSqlfU9RHCSuFcTlPx8ZQpHinAfMB/TF66qEtbjqP07VLrVD1l5skRA+grwdmbJUVdrSGN0w== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0301MB1267; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1267; 20:7burqf5TjuhCCsxO+sM1Im8o/ltfBM9qnc/FEuiWlQkdk92nSlUcVNEOYPFHceSvkZ+90eFyByzMHSVCagJWqBd1SN0UN9V+7AQB7GYuMmhj74WysKDPb0IaSlv7ymL1KHVxRMHoxwczDMegvhH2rOrQPtXuISSSLsTk77Skq2oY3KxYSjDyd7orqYsq5bu4EAKkDkgcBfQKa74WhVx6nZybmy1mdOtWW/EsRInrbd6VB9Z3FI4PFIYCny0/pXLpT5qx/SZvG0kxaZSZIqW//KNcHHUmaI88SEBsegC7buSv0t/XiHommmOiZHgHoMBZjmFDuCQ1Rep/Kx3dytmcM11I8xXsvZZ37HmjeDjRKz8=; 4:GKlTrrDpYE1dheb5l0+RfQWju1gXI21ecGnWRJWWBStSib4NOHTlUA1eKhmI4ycd6QZU8MB4FtfMDsSjPt+c1dZKb+HGTXtUskuA9fLG7QLTL2DGtAFL8rkK3Qjzhc9dcmAntrXGWss7fYUGgSFnE+v4gpJYJDpfxsZoczqQx+CeUj9Js8IOYq1YwnKM9FNNYCOzU+mHNakDLW32aMNS9Yovlt/UwfehxMyiOCM05l8goalddbgcgAZWnHgPRiiNXlTNKmYpd8TVeN3wlwEK5xgvWfH+2kcEokER/iIwbUDW1nRET+BAX7Hdm8LM9ToHSpL+3glnu1ad2mxpIY6zb/uW+O0j/rDVJKu3Q8COXWc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001); SRVR:BN3PR0301MB1267; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0301MB1267; X-Forefront-PRVS: 07283408BE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0301MB1267; 23:miZrs3e6ZPxPA/foAVLAj+5e8+FeWHxVpDm7RGL?= =?us-ascii?Q?cj6dBSl38UeP01tql/KZ2D/AeAmUsYpBjY/5IU4gKYO7ZPu3uGB3/7jgnK1F?= =?us-ascii?Q?66jAqDqZJu/aLt4Pkv1IXCj/y2AWYWhOwcNltPhqlSoj4b5j18FsV/2vJDXV?= =?us-ascii?Q?zI8mF44OzBEF6Sgvsj2Ab84fHsqfqceT7H+c2AD0WVa9GIzmNjdbFH7uRNV4?= =?us-ascii?Q?SqFTBLN47t5JujbFWvKe+e4qz2qdlyOXUhcpeg1FnO+LBjBRr3oGDmx4Nf8b?= =?us-ascii?Q?1O4J9iGgAA9NHyX2WfA45rUPMkCvcX2ZrRJXc7BLMUPOpKtOLZkuiCJ+kBMg?= =?us-ascii?Q?HCiz/NDB6C6sdSuY0Ayhv6i7dmpQ7z27rg4vqBlPFT+fNYa9VISNHu3wGAhU?= =?us-ascii?Q?PInn9vkKhDOCTsJt9q9sSgHYWKYdVnmpwTHdncxA0OfybzkQfoxfOUg4zs0M?= =?us-ascii?Q?i4ABBMJmnodbmrGqB10e68kzsatK994WNyCNTDtxVoiRUySFxL9h5d02PQrO?= =?us-ascii?Q?G/PRExbVnEu4cpfjR5LpG5z9iCF70XS061Vjn2baGCHHCGAMSDdgcIHtYi45?= =?us-ascii?Q?0VvucxbrBtlHsRvigWuQon1/8pB2M7UbNOk3+FF+GgPSghHO4ry/Rtbg1sC5?= =?us-ascii?Q?toqWofyLkDM8ZLWdqdEhnPtSQki9TCZTVF8o/FHDGdyg1WkyKduu4Svp2uVc?= =?us-ascii?Q?1DzEeH6g1NJvmlCv3kxymhCTpZ3704Zhap3NNwCv2L/tH9E9iuS1TDthNIon?= =?us-ascii?Q?gTMHJrYB27C45ROFuZv/tA8X4eYsS5yWLGCtf1Or5PMOJ5DhkUumYFImv3Mt?= =?us-ascii?Q?OhGUwpfhzxUIWOY00TDqXHxSSwNBLysOxiHT2QC1fNcQs4VkDOhJKTGhH1oB?= =?us-ascii?Q?42/iWmI8iqSa7q/bOFwlJD7SrXE2iWr+E5y8X6nCUDs0tJ8simeuxjKXmEWS?= =?us-ascii?Q?Itu/Ax+ZimO6rbGIYHF68koXmlpnA6Qjn53xvF+B60E3/GlfUCXWcaJYjptQ?= =?us-ascii?Q?/IXAlhY0XtaeboYO6qj8AFm8OzC1FEMtE0EU8lzAWIF8bwBE+ndbI5JVtaK0?= =?us-ascii?Q?qBfdpQwROAOSr2Y1ggW5kS+pMN8+iUCh1T3xnrV36hicxQUbQniqmGrsZLGa?= =?us-ascii?Q?mYTBLvvt0PhUFrb/RCivFRrtSBsa7A2FT?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1267; 5:DXLSv+btf2QuXhosxAs652XAk+Bn8Fves3bOSPOerFiKj+5d+A0zFlBUwdvNjNWSyrrVsoQ6av3J0wehZL/i12t+VAaxpCS0p/MFclwmtAJtxMiANkQyYwS4EXOkP5KQF04jY30wMOwzkIaFNr55VA==; 24:hmRr2N8ld6JjnBbHaIZnASpJarLkx+Sog3u1S6xQydvKrFEaVVW5zhP0P0HyfOYDdxaDNcoR9KM1kLHo19AsrAkTDdKfZDuUsvvbpbeF5Mw=; 20:YeNJ2mIJKlTn6alLdVenwvIXZAWy9Ub3GORGijSx0gOwCbj6l1NsxAByWrEU9PHXBygNww165tbqVdI71xGrrQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2015 11:31:39.3112 (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.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0301MB1267 X-Topics: patch Cc: petri.savolainen@nokia.com, stuart.haslam@arm.com Subject: [lng-odp] [API NEXT PATCH v7 04/14] api: sysinfo: move CPU Hz API to cpu.h 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.217.175 as permitted sender) smtp.mailfrom=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 The legacy odp_sys_cpu_hz() is moved to cpu.h then accordingly renamed to odp_cpu_hz(), and all the calling functions are also updated. Signed-off-by: Hongbo Zhang --- example/classifier/odp_classifier.c | 2 +- example/generator/odp_generator.c | 2 +- example/ipsec/odp_ipsec.c | 2 +- example/packet/odp_pktio.c | 2 +- example/timer/odp_timer_test.c | 4 ++-- include/odp/api/cpu.h | 9 +++++++++ include/odp/api/system_info.h | 7 ------- platform/linux-generic/arch/linux/odp_cpu_cycles.c | 2 +- platform/linux-generic/odp_system_info.c | 2 +- platform/linux-generic/odp_time.c | 4 ++-- test/api_test/odp_common.c | 2 +- test/performance/odp_atomic.c | 2 +- test/performance/odp_l2fwd.c | 2 +- test/performance/odp_scheduling.c | 6 +++--- test/validation/system/system.c | 6 +++--- test/validation/system/system.h | 2 +- 16 files changed, 29 insertions(+), 27 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index b98bd46..4296be4 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -760,7 +760,7 @@ static void print_info(char *progname, appl_args_t *appl_args) "CPU count: %i\n" "\n", odp_version_api_str(), odp_cpu_model_str(), - odp_sys_cpu_hz(), odp_sys_cache_line_size(), + odp_cpu_hz(), odp_sys_cache_line_size(), odp_cpu_count()); printf("Running ODP appl: \"%s\"\n" diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 6dd43d6..3156774 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -1063,7 +1063,7 @@ static void print_info(char *progname, appl_args_t *appl_args) "Cache line size: %i\n" "CPU count: %i\n" "\n", - odp_version_api_str(), odp_cpu_model_str(), odp_sys_cpu_hz(), + odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(), odp_sys_cache_line_size(), odp_cpu_count()); printf("Running ODP appl: \"%s\"\n" diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 5a191ee..3d68b4a 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1517,7 +1517,7 @@ static void print_info(char *progname, appl_args_t *appl_args) "Cache line size: %i\n" "CPU count: %i\n" "\n", - odp_version_api_str(), odp_cpu_model_str(), odp_sys_cpu_hz(), + odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(), odp_sys_cache_line_size(), odp_cpu_count()); printf("Running ODP appl: \"%s\"\n" diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index 824b755..895d173 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -650,7 +650,7 @@ static void print_info(char *progname, appl_args_t *appl_args) "Cache line size: %i\n" "CPU count: %i\n" "\n", - odp_version_api_str(), odp_cpu_model_str(), odp_sys_cpu_hz(), + odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(), odp_sys_cache_line_size(), odp_cpu_count()); printf("Running ODP appl: \"%s\"\n" diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 2a44862..bcf3582 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -350,7 +350,7 @@ int main(int argc, char *argv[]) printf("---------------\n"); printf("ODP API version: %s\n", odp_version_api_str()); printf("CPU model: %s\n", odp_cpu_model_str()); - printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz()); + printf("CPU freq (hz): %"PRIu64"\n", odp_cpu_hz()); printf("Cache line size: %i\n", odp_sys_cache_line_size()); printf("Max CPU count: %i\n", odp_cpu_count()); @@ -446,7 +446,7 @@ int main(int argc, char *argv[]) return -1; } - printf("CPU freq %"PRIu64" Hz\n", odp_sys_cpu_hz()); + printf("CPU freq %"PRIu64" Hz\n", odp_cpu_hz()); printf("Timer ticks vs nanoseconds:\n"); ns = 0; tick = odp_timer_ns_to_tick(gbls->tp, ns); diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h index 554e503..16ce36e 100644 --- a/include/odp/api/cpu.h +++ b/include/odp/api/cpu.h @@ -55,6 +55,15 @@ int odp_cpu_count(void); const char *odp_cpu_model_str(void); /** + * Current CPU frequency in Hz + * + * Returns current frequency of this CPU + * + * @return CPU frequency in Hz + */ +uint64_t odp_cpu_hz(void); + +/** * Current CPU cycle count * * Return current CPU cycle count. Cycle count may not be reset at ODP init diff --git a/include/odp/api/system_info.h b/include/odp/api/system_info.h index 1cd883f..bde3a60 100644 --- a/include/odp/api/system_info.h +++ b/include/odp/api/system_info.h @@ -24,13 +24,6 @@ extern "C" { */ /** - * CPU frequency in Hz - * - * @return CPU frequency in Hz - */ -uint64_t odp_sys_cpu_hz(void); - -/** * Huge page size in bytes * * @return Huge page size in bytes diff --git a/platform/linux-generic/arch/linux/odp_cpu_cycles.c b/platform/linux-generic/arch/linux/odp_cpu_cycles.c index 37a4d94..b07bfda 100644 --- a/platform/linux-generic/arch/linux/odp_cpu_cycles.c +++ b/platform/linux-generic/arch/linux/odp_cpu_cycles.c @@ -27,7 +27,7 @@ uint64_t odp_cpu_cycles(void) if (ret != 0) ODP_ABORT("clock_gettime failed\n"); - hz = odp_sys_cpu_hz(); + hz = odp_cpu_hz(); sec = (uint64_t)time.tv_sec; ns = (uint64_t)time.tv_nsec; diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index ed6b515..8e903b0 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -374,7 +374,7 @@ int odp_system_info_init(void) * Public access functions ************************* */ -uint64_t odp_sys_cpu_hz(void) +uint64_t odp_cpu_hz(void) { return odp_global_data.system_info.cpu_hz[0]; } diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c index b378c35..fde231a 100644 --- a/platform/linux-generic/odp_time.c +++ b/platform/linux-generic/odp_time.c @@ -28,7 +28,7 @@ uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2) uint64_t odp_time_cycles_to_ns(uint64_t cycles) { - uint64_t hz = odp_sys_cpu_hz(); + uint64_t hz = odp_cpu_hz(); if (cycles > (UINT64_MAX / GIGA)) return (cycles/hz)*GIGA; @@ -39,7 +39,7 @@ uint64_t odp_time_cycles_to_ns(uint64_t cycles) uint64_t odp_time_ns_to_cycles(uint64_t ns) { - uint64_t hz = odp_sys_cpu_hz(); + uint64_t hz = odp_cpu_hz(); if (ns > (UINT64_MAX / hz)) return (ns/GIGA)*hz; diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c index 2f1f96f..8540108 100644 --- a/test/api_test/odp_common.c +++ b/test/api_test/odp_common.c @@ -42,7 +42,7 @@ void odp_print_system_info(void) printf("---------------\n"); printf("ODP API version: %s\n", odp_version_api_str()); printf("CPU model: %s\n", odp_cpu_model_str()); - printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz()); + printf("CPU freq (hz): %"PRIu64"\n", odp_cpu_hz()); printf("Cache line size: %i\n", odp_sys_cache_line_size()); printf("CPU count: %i\n", odp_cpu_count()); printf("CPU mask: %s\n", str); diff --git a/test/performance/odp_atomic.c b/test/performance/odp_atomic.c index 8ba795e..101c54c 100644 --- a/test/performance/odp_atomic.c +++ b/test/performance/odp_atomic.c @@ -338,7 +338,7 @@ void odp_print_system_info(void) printf("---------------\n"); printf("ODP API version: %s\n", odp_version_api_str()); printf("CPU model: %s\n", odp_cpu_model_str()); - printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz()); + printf("CPU freq (hz): %"PRIu64"\n", odp_cpu_hz()); printf("Cache line size: %i\n", odp_sys_cache_line_size()); printf("CPU count: %i\n", odp_cpu_count()); printf("CPU mask: %s\n", str); diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index b7da6e8..5533daa 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -713,7 +713,7 @@ static void print_info(char *progname, appl_args_t *appl_args) "Cache line size: %i\n" "CPU count: %i\n" "\n", - odp_version_api_str(), odp_cpu_model_str(), odp_sys_cpu_hz(), + odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(), odp_sys_cache_line_size(), odp_cpu_count()); printf("Running ODP appl: \"%s\"\n" diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 8a45f3b..0f288e2 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -746,14 +746,14 @@ static void test_cpu_freq(void) nsec -= tp1.tv_nsec - tp2.tv_nsec; cycles = odp_cpu_cycles_diff(c1, c2); - max_cycles = (nsec * odp_sys_cpu_hz()) / 1000000000.0; + max_cycles = (nsec * odp_cpu_hz()) / 1000000000.0; /* Compare measured CPU cycles to maximum theoretical CPU cycle count */ diff_max_hz = ((double)(cycles) - max_cycles) / max_cycles; printf("clock_gettime %" PRIu64 " ns\n", nsec); printf("odp_cpu_cycles %" PRIu64 " CPU cycles\n", cycles); - printf("odp_sys_cpu_hz %" PRIu64 " hz\n", odp_sys_cpu_hz()); + printf("odp_sys_cpu_hz %" PRIu64 " hz\n", odp_cpu_hz()); printf("Diff from max CPU freq %f%%\n", diff_max_hz * 100.0); printf("\n"); @@ -868,7 +868,7 @@ int main(int argc, char *argv[]) printf("---------------\n"); printf("ODP API version: %s\n", odp_version_api_str()); printf("CPU model: %s\n", odp_cpu_model_str()); - printf("CPU freq (hz): %" PRIu64 "\n", odp_sys_cpu_hz()); + printf("CPU freq (hz): %" PRIu64 "\n", odp_cpu_hz()); printf("Cache line size: %i\n", odp_sys_cache_line_size()); printf("Max CPU count: %i\n", odp_cpu_count()); diff --git a/test/validation/system/system.c b/test/validation/system/system.c index 0a0aa00..7f751a3 100644 --- a/test/validation/system/system.c +++ b/test/validation/system/system.c @@ -75,11 +75,11 @@ void system_test_odp_sys_huge_page_size(void) CU_ASSERT(0 < page); } -void system_test_odp_sys_cpu_hz(void) +void system_test_odp_cpu_hz(void) { uint64_t hz; - hz = odp_sys_cpu_hz(); + hz = odp_cpu_hz(); CU_ASSERT(0 < hz); } @@ -90,7 +90,7 @@ CU_TestInfo system_suite[] = { _CU_TEST_INFO(system_test_odp_cpu_model_str), _CU_TEST_INFO(system_test_odp_sys_page_size), _CU_TEST_INFO(system_test_odp_sys_huge_page_size), - _CU_TEST_INFO(system_test_odp_sys_cpu_hz), + _CU_TEST_INFO(system_test_odp_cpu_hz), CU_TEST_INFO_NULL, }; diff --git a/test/validation/system/system.h b/test/validation/system/system.h index 2043a54..d05f104 100644 --- a/test/validation/system/system.h +++ b/test/validation/system/system.h @@ -16,7 +16,7 @@ void system_test_odp_sys_cache_line_size(void); void system_test_odp_cpu_model_str(void); void system_test_odp_sys_page_size(void); void system_test_odp_sys_huge_page_size(void); -void system_test_odp_sys_cpu_hz(void); +void system_test_odp_cpu_hz(void); /* test arrays: */ extern CU_TestInfo system_suite[];