From patchwork Thu Jul 9 10:46:03 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: 50937 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6BD07228E5 for ; Thu, 9 Jul 2015 10:49:50 +0000 (UTC) Received: by lagx9 with SMTP id x9sf73817604lag.2 for ; Thu, 09 Jul 2015 03:49:49 -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=xu2KyO4o2YTF3xOtJ9iv8wB59xudTcoMOt1g5zv8HzU=; b=Xb/ywvBeNK8YpzWDuRgROMYx6hopWXzGRlXrADf3wwlvhRP2BF1R1OsXBRokfHjMwX o8T5AkTdg3ckLYU0Uvs7j2GmO2dX5MEUIr5ERgMXxsG/x/YXRbq1MyLK+BZOYIeg79WE naTvyZcmkFe0qrNXkAuko/JdWd3CQBmaBibhojtI8wnLc9ejTJXCrtlN7tWDRIedbB60 3c11iRzJThtScN3A+Z6Pk8POkD6DJtRrkM+jdHzu6Rc/IvMyC5I0HteFm5c4UlPXWzyt YTqXmzflUzwYuaNLOPO/DBu8JVE+Cx4d15sTB192DGOGLnGCyddx82xL2dA4bRM0CIrC P8YQ== X-Gm-Message-State: ALoCoQmZYw97q/PHf4UmONCToBdm954fKEK9BVk4KKxgplJSFwjeTPss6XyFy6czdFFMfoX78uQR X-Received: by 10.152.26.226 with SMTP id o2mr7621734lag.0.1436438989424; Thu, 09 Jul 2015 03:49:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.73 with SMTP id 9ls909666lak.17.gmail; Thu, 09 Jul 2015 03:49:49 -0700 (PDT) X-Received: by 10.113.10.135 with SMTP id ea7mr4919508lbd.65.1436438989282; Thu, 09 Jul 2015 03:49:49 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id xi9si4488197lbb.4.2015.07.09.03.49.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 03:49:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by labgy5 with SMTP id gy5so91386045lab.2 for ; Thu, 09 Jul 2015 03:49:49 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr13788788lbc.41.1436438988934; Thu, 09 Jul 2015 03:49:48 -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 hn6csp577870lbb; Thu, 9 Jul 2015 03:49:47 -0700 (PDT) X-Received: by 10.140.237.208 with SMTP id i199mr24415138qhc.103.1436438987081; Thu, 09 Jul 2015 03:49:47 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c72si5624352qkh.34.2015.07.09.03.49.46; Thu, 09 Jul 2015 03:49:47 -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 1B4A261FBD; Thu, 9 Jul 2015 10:49:46 +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=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 ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id F1C0161FCE; Thu, 9 Jul 2015 10:47:10 +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 BBC4761B6C; Thu, 9 Jul 2015 10:46:54 +0000 (UTC) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0132.outbound.protection.outlook.com [207.46.100.132]) by lists.linaro.org (Postfix) with ESMTPS id E511661B6C for ; Thu, 9 Jul 2015 10:46:19 +0000 (UTC) Received: from BLUPR0301CA0024.namprd03.prod.outlook.com (10.162.113.162) 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:18 +0000 Received: from BN1BFFO11FD051.protection.gbl (2a01:111:f400:7c10::1:178) by BLUPR0301CA0024.outlook.office365.com (2a01:111:e400:5259::34) with Microsoft SMTP Server (TLS) id 15.1.213.14 via Frontend Transport; Thu, 9 Jul 2015 10:46:18 +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 BN1BFFO11FD051.mail.protection.outlook.com (10.58.145.6) with Microsoft SMTP Server (TLS) id 15.1.190.9 via Frontend Transport; Thu, 9 Jul 2015 10:46:17 +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 t69AkBfe022771; Thu, 9 Jul 2015 03:46:16 -0700 From: To: Date: Thu, 9 Jul 2015 18:46:03 +0800 Message-ID: <1436438768-4258-4-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; BN1BFFO11FD051; 1:+XA7ArjK/0+gss2oWrwbWmwo32QTd044qwwOOeGRFiv8GOrqL6WaE/2sv7woNlsbmgi3CFYfrh2p7o8RnvohOCLBZt5C4TMv8B2dMG/ma8F8IYeZucccjmf+g7vLkfcGZwuqZ4ePOKOSVQRYv1mlAHQwyejxV0MNwe3Ht50O81kGIsAz6a5myzD0o5wzkffZy8NUUaziGg2O4agEz1gRCGEo/V6d3nMGKJrePjfKzMuIRfIuRZnb9Wj1AD23CffKc35oUESpP6r+77YxSW5xvY3FPB2qSFGGMM5HEFXFbQl6WKz1Y4cD6D+FB9cEDHMs 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)(575784001)(47776003)(77156002)(19580405001)(106466001)(86152002)(105606002)(6806004)(62966003)(189998001)(19580395003)(2351001)(229853001)(50226001)(87936001)(48376002)(41533002)(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:+c2H5czID562OD/yhBBz40Pa29tXq+BIrvYcsSNQh+W2UNrpHmHqeSHZtatDtdwr; 3:/B1u2VvVn7iqfSJ8pvAHc0SG0DIdh678QIjBwAgagnbNHW2UQJTxzvQPF6PGGr/lQK1xD2GOeg3tblLgUttHfOSIG1IvkSGa4HOB+aXsdQXK8u1SLuuYEiAhxAKDZqTwRNdjJPC9FpyeeMeM8HBiD2l2PlNQti7sbSEPYAYLk1mgsvZhczIeGsqfyb7T/44WI/7CkZaaBcYBA2kqTvevDKhzd81JUU+F3J3YsDStE1Y=; 25:Z1fWoCYpg3t4ypIf+iz4LZmdZiCWMPzj69fmh/co0CQh7/J65urc5s5lqe49Nwxmt/bqI/DYvxPHe3G4x1WdCLF227vlCNXuHCp21N7D/nhkSPHF8Uzft+A7AyiSaQ2kvXJi2T0GgCP6xXZX0zeH9vGD++EJW1R4xZ6R9Pw1Npabb00ymbO//qVKH5t+MwBsVz4P0pIn04vwJbFK0Lw81MlbFFNrwsiOnXQH0Bk5S0R16qQtCHRyDeS2mbSnZisJm9eAXXnS8P0cllHVIbw7kQ==; 20:Utn/k94RpI3YktaFZBzjr+yGYveXjuvUA05BCEysQUQwgkR7lAeomb+DQ+RnOqy2S+iIDiTJwMXQjDkLZIARADPxyW6fvgMDFNIO/MIZuJrhQQXRemRwP9Hi7sXVijAeFbPCkLPU8hf2SNv3wEcavFR2zEkUYUqN2EEMNDFq0771eUe8Hcjm6/FoVPVsvPodQbx6Hs5rpbFchE8FhWP4neYA21B6j+t1tzMBBbvVAG//V8ItMcg++JsVkDz49yMMYaZ9uby9w6SQu97Et7kKX+0/U2/jNUsxGLCdGwe0n0NoLoXfdFHVAyJaXEZ7men3vkw8+Qe/Cvhb6Re8LPD7NMvfp4ZXpkxWOHJS6O8QJoM= 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:wFwfw69MF4bOPqLYd6vkNEyvxMVUDap3Lrkb7tWGJBz4RfIBIyLvL+zZotcOy0U+WPZCnQjafKIy/Ri+MHFQTwuqsjcR+6RBWVDAPHZBB40J0LYccUphq7IZ977miZcOCMIiu3CD0FrteGHxbitppOqyKvyFi/4+Rmk3AYHdx7hyhK4BcVbUg4gnSOaA2uAVSebkH6a0/PiSwZUv5x5v3gYJn8A1qosQ32R27Qkod5vFB1bRKvJzVGQuvMZHjUViq1Lz3F1MmlNj31ZjQRx3ZcUEHky5c7R48i2if5dIj+k= X-Forefront-PRVS: 0632519F33 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR03MB608; 23:pPE6AEdjKTHk7VeFxzAO8jMNlSQ21majBkcA7yyeyi?= =?us-ascii?Q?CNd+IS8sIyOAHvDXnTfN65MAIlbnp2BkGPTQj7hMwrYOaza5oM0ijWVDz0Y3?= =?us-ascii?Q?xjSLclLIKWcGCAjJ9HkByNlvZ0eBdXHPQBdA9uXmykX931E6OfCxGNAxSq90?= =?us-ascii?Q?wbY7ficezpkGJBCWp2PrpK1qghpMm2jku+mjEYnWKzCdZ4bXxbfp1M5fioSt?= =?us-ascii?Q?UlBIlflL3swr6wVTtIwpAq5j4fM48pKOU1wzrPuGKv6hviQoWk+V9bSUGX1N?= =?us-ascii?Q?iILRlbLCMQhPUEnOOMQ1sMIC/MSOU9dOAxfFCQEmTLhTdeBx6tv07nOIoA5A?= =?us-ascii?Q?ikeE34bysTTGl9AbXErvPF7jE1DINwi7VFk4Hx7ttJNi6LpGvuWgWa9A4EMI?= =?us-ascii?Q?ZJBTWmgOe5vn8OPNAwdQZaVQNXkMEgW1wCBlUHcz0+mUUZuWj6RwxucQfQd/?= =?us-ascii?Q?We3EvD3qJThCPMDRqsxvC3Vs/GHOcqo/9YP4bLRkLRfVW0upVl/RQ8dyIoSu?= =?us-ascii?Q?ao1NGzB7fgJYVX7V3Hfu9H8UTq28P0N6kbr8BRaU4z2bdA02kNKkrIG+RvQE?= =?us-ascii?Q?cv8mYJ8z4T5+6z9HEESACZMDUO0efdhp1ucSfqrSBoxglG+XyUe0PNWe79oD?= =?us-ascii?Q?9RRelt/4kxgmOP9UiuSI15KAuB7OwnFcOKxf5ph4WHvUZrnPOh04+V2fZEK9?= =?us-ascii?Q?PGzYF8EjwNuoEei+eiUyNgp6kNf3nB56njrFtQ1mLp4lMR0PA0+locraDjNt?= =?us-ascii?Q?JWL9RnhaFmD+qj5krh4xr8QgCW3mMID5Ivrg5GzvLEfMkM+Fex3IFFxg6M8Y?= =?us-ascii?Q?4fPU3ZxvQveSnCf1uU5Rr4P/Dlp1BdJYurjppPYa8NVHVyhXK46YHBjv4L9a?= =?us-ascii?Q?OQNoHKnjwy49qFOBLPgxVAXRyL/k2P/xV72prc11r6M44mA3cYK5AIjbWepw?= =?us-ascii?Q?TU62s/q62UZaHPdLdI3e7pKZocz3OVrSMvSZ8Vj7iJsoTfKzzlGSoINPf29D?= =?us-ascii?Q?o=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB608; 5:mAXu6DR7X+gTnlfbQqyoGSzJZreKnpVYVLslMbqJvQB4zuJCx85C9aBr01GEqvxzwb4UQUZje2RUumQJJKKUZHGdPbvfZ5tvBsJR7Iz51mp6AM6vH6Z+hHnkM6okPJtaSUINk4zFITt3gOjmNCkc/g==; 24:r/6ktEH/YdQ/vMI5UbS26tH+Gs05Zy4ekZPuLegeRvlBpupil1Hqa32rEj1A8pJuP5zQIdMrdW69AT+9UB43x50gjelq4XfOJwzoJDmZwqU=; 20:Qwi3NnPzO5EF8oWZ958BxlKypsTiGeaF74mE9H5GWUiZkOTADKs2ZRSxwKT4vxR0CtNt4dAWYcEywcrP48cBAQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2015 10:46:17.6758 (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 3/8] linux-generic: sysinfo: move all CPU APIs 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.215.48 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 moves all CPU realted APIs to the cpu.h, they are: odp_sys_cpu_hz() and odp_sys_cpu_model_str(), and accordingly rename them to odp_cpu_hz() and odp_cpu_model_str(), All the calling functions are updated too. New APIs for AMP system will be added into this cpu.h too. Signed-off-by: Hongbo Zhang --- example/classifier/odp_classifier.c | 4 ++-- example/generator/odp_generator.c | 2 +- example/ipsec/odp_ipsec.c | 2 +- example/packet/odp_pktio.c | 2 +- example/timer/odp_timer_test.c | 6 +++--- include/odp/api/cpu.h | 14 ++++++++++++++ include/odp/api/system_info.h | 14 -------------- platform/linux-generic/arch/linux/odp_time.c | 3 ++- platform/linux-generic/odp_system_info.c | 4 ++-- platform/linux-generic/odp_time.c | 5 +++-- test/api_test/odp_common.c | 4 ++-- test/performance/odp_atomic.c | 4 ++-- test/performance/odp_l2fwd.c | 2 +- test/performance/odp_scheduling.c | 4 ++-- test/validation/ver_abt_log_dbg/odp_system.c | 12 ++++++------ 15 files changed, 42 insertions(+), 40 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 643e16c..c695741 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -727,8 +727,8 @@ 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_sys_cpu_model_str(), - odp_sys_cpu_hz(), odp_sys_cache_line_size(), + 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/generator/odp_generator.c b/example/generator/odp_generator.c index 0ff264c..8920146 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -978,7 +978,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_sys_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 4928985..5fcc9dd 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_sys_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 0b4a8f1..d0b6e7c 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -626,7 +626,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_sys_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 f4af0e2..01abe04 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -364,8 +364,8 @@ int main(int argc, char *argv[]) printf("ODP system info\n"); printf("---------------\n"); printf("ODP API version: %s\n", odp_version_api_str()); - printf("CPU model: %s\n", odp_sys_cpu_model_str()); - printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz()); + printf("CPU model: %s\n", odp_cpu_model_str()); + 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()); @@ -463,7 +463,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("Cycles vs nanoseconds:\n"); ns = 0; cycles = odp_time_ns_to_cycles(ns); diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h index c389093..7b548ce 100644 --- a/include/odp/api/cpu.h +++ b/include/odp/api/cpu.h @@ -44,6 +44,20 @@ int odp_cpu_id(void); int odp_cpu_count(void); /** + * CPU frequency in Hz + * + * @return CPU frequency in Hz + */ +uint64_t odp_cpu_hz(void); + +/** + * CPU model name + * + * @return Pointer to CPU model name string + */ +const char *odp_cpu_model_str(void); + +/** * @} */ diff --git a/include/odp/api/system_info.h b/include/odp/api/system_info.h index 1f3294b..7c1d4a7 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 @@ -45,13 +38,6 @@ uint64_t odp_sys_huge_page_size(void); uint64_t odp_sys_page_size(void); /** - * CPU model name - * - * @return Pointer to CPU model name string - */ -const char *odp_sys_cpu_model_str(void); - -/** * Cache line size in bytes * * @return CPU cache line size in bytes diff --git a/platform/linux-generic/arch/linux/odp_time.c b/platform/linux-generic/arch/linux/odp_time.c index 4dc0764..3309da0 100644 --- a/platform/linux-generic/arch/linux/odp_time.c +++ b/platform/linux-generic/arch/linux/odp_time.c @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -27,7 +28,7 @@ uint64_t odp_time_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 ab741eb..26fe2c8 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -373,7 +373,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]; } @@ -388,7 +388,7 @@ uint64_t odp_sys_page_size(void) return odp_global_data.system_info.page_size; } -const char *odp_sys_cpu_model_str(void) +const char *odp_cpu_model_str(void) { return odp_global_data.system_info.model_str[0]; } diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c index a08833d..a137a36 100644 --- a/platform/linux-generic/odp_time.c +++ b/platform/linux-generic/odp_time.c @@ -8,6 +8,7 @@ #include #include +#include #include #define GIGA 1000000000 @@ -22,7 +23,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; @@ -33,7 +34,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 0677f9b..0a2b184 100644 --- a/test/api_test/odp_common.c +++ b/test/api_test/odp_common.c @@ -41,8 +41,8 @@ void odp_print_system_info(void) printf("ODP system info\n"); printf("---------------\n"); printf("ODP API version: %s\n", odp_version_api_str()); - printf("CPU model: %s\n", odp_sys_cpu_model_str()); - printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz()); + printf("CPU model: %s\n", odp_cpu_model_str()); + 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 861ab83..7fcd0b0 100644 --- a/test/performance/odp_atomic.c +++ b/test/performance/odp_atomic.c @@ -337,8 +337,8 @@ void odp_print_system_info(void) printf("ODP system info\n"); printf("---------------\n"); printf("ODP API version: %s\n", odp_version_api_str()); - printf("CPU model: %s\n", odp_sys_cpu_model_str()); - printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz()); + printf("CPU model: %s\n", odp_cpu_model_str()); + 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 dd0b4b1..877be14 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -639,7 +639,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_sys_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 99f0f9b..69e74f4 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -869,8 +869,8 @@ int main(int argc, char *argv[]) printf("ODP system info\n"); printf("---------------\n"); printf("ODP API version: %s\n", odp_version_api_str()); - printf("CPU model: %s\n", odp_sys_cpu_model_str()); - printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz()); + printf("CPU model: %s\n", odp_cpu_model_str()); + 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/ver_abt_log_dbg/odp_system.c b/test/validation/ver_abt_log_dbg/odp_system.c index 5185a71..22e8db3 100644 --- a/test/validation/ver_abt_log_dbg/odp_system.c +++ b/test/validation/ver_abt_log_dbg/odp_system.c @@ -48,11 +48,11 @@ static void test_odp_sys_cache_line_size(void) CU_ASSERT(ODP_CACHE_LINE_SIZE == cache_size); } -static void test_odp_sys_cpu_model_str(void) +static void test_odp_cpu_model_str(void) { char model[128]; - snprintf(model, 128, "%s", odp_sys_cpu_model_str()); + snprintf(model, 128, "%s", odp_cpu_model_str()); CU_ASSERT(strlen(model) > 0); CU_ASSERT(strlen(model) < 127); } @@ -74,21 +74,21 @@ static void test_odp_sys_huge_page_size(void) CU_ASSERT(0 < page); } -static void test_odp_sys_cpu_hz(void) +static void test_odp_cpu_hz(void) { uint64_t hz; - hz = odp_sys_cpu_hz(); + hz = odp_cpu_hz(); 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", test_odp_cpu_hz}, + {"odp_cpu_model_str", test_odp_cpu_model_str}, {"odp_sys_cache_line_size", test_odp_sys_cache_line_size}, - {"odp_sys_cpu_model_str", test_odp_sys_cpu_model_str}, {"odp_sys_page_size", test_odp_sys_page_size}, {"odp_sys_huge_page_size", test_odp_sys_huge_page_size}, - {"odp_sys_cpu_hz", test_odp_sys_cpu_hz}, CU_TEST_INFO_NULL, };