From patchwork Tue Sep 15 13:55:26 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: 53655 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 2FADE22A0D for ; Tue, 15 Sep 2015 13:56:51 +0000 (UTC) Received: by wisv5 with SMTP id v5sf8549757wis.0 for ; Tue, 15 Sep 2015 06:56:50 -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=XYrkyLJGY8UoIupXQOkvBVkPZnoc1DenJ2opuRpENJ4=; b=A4A8b8V2fr44JB+Wwvm9hIY+tVQa+jFptoy428m1R7x0+uB5oT+IvtNT6PRqNRxUSx Nw9V5hKhtC25IYfwmm4fCY950xKTWyn7sRGXo/gyRr77ZvDw/Oa6SL1ytLBZjcKQTnTK ToNL4DG5zepehdnGmNU5+Tlp3/eFFC4H5npXvbXUN/hDUgCVMq1hzjP8C98ywGjnKXNy 4C0XhZeW1hpuxdrriRE+BGS6hIIY03HD6V9RBhJW/rECAgVmIIxzeARrHDyJdutwEu2T sxb7RTyOVf1oADeeUkn0ErBdbNNSXs6pxd4JMRN1KFQL3xhDtMl6shikgpAj+gaggnr9 6agg== X-Gm-Message-State: ALoCoQkxPl2jwaVug4CeXsPlS6xwAoVNIeSHYs3YQVkrssiIDi3fuAK9k/sZnFSd4QpQOf+v2WZZ X-Received: by 10.112.149.39 with SMTP id tx7mr4324708lbb.11.1442325410427; Tue, 15 Sep 2015 06:56:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.168 with SMTP id o8ls647143lae.47.gmail; Tue, 15 Sep 2015 06:56:50 -0700 (PDT) X-Received: by 10.152.1.104 with SMTP id 8mr21339982lal.24.1442325410261; Tue, 15 Sep 2015 06:56:50 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id aw10si13790048lbc.112.2015.09.15.06.56.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 06:56:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbvu2 with SMTP id vu2so13381472lbb.0 for ; Tue, 15 Sep 2015 06:56:50 -0700 (PDT) X-Received: by 10.112.135.9 with SMTP id po9mr16370079lbb.56.1442325410120; Tue, 15 Sep 2015 06:56:50 -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 w3csp1820559lbq; Tue, 15 Sep 2015 06:56:49 -0700 (PDT) X-Received: by 10.140.91.112 with SMTP id y103mr31954521qgd.68.1442325408911; Tue, 15 Sep 2015 06:56:48 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f39si17028841qkf.41.2015.09.15.06.56.46; Tue, 15 Sep 2015 06:56: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; Received: by lists.linaro.org (Postfix, from userid 109) id BB18D62CC3; Tue, 15 Sep 2015 13:56:46 +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 F349161FBC; Tue, 15 Sep 2015 13:56:28 +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 235A8619EB; Tue, 15 Sep 2015 13:56:25 +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 2DDDE619EB for ; Tue, 15 Sep 2015 13:55:54 +0000 (UTC) Received: from BN3PR0301CA0027.namprd03.prod.outlook.com (10.160.180.165) by BLUPR03MB487.namprd03.prod.outlook.com (10.141.79.27) with Microsoft SMTP Server (TLS) id 15.1.268.17; Tue, 15 Sep 2015 13:55:51 +0000 Received: from BN1BFFO11FD035.protection.gbl (2a01:111:f400:7c10::1:185) by BN3PR0301CA0027.outlook.office365.com (2a01:111:e400:4000::37) with Microsoft SMTP Server (TLS) id 15.1.268.17 via Frontend Transport; Tue, 15 Sep 2015 13:55:51 +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 BN1BFFO11FD035.mail.protection.outlook.com (10.58.144.98) with Microsoft SMTP Server (TLS) id 15.1.262.18 via Frontend Transport; Tue, 15 Sep 2015 13:55:51 +0000 Received: from hongbo.ap.freescale.net (hongbo.ap.freescale.net [10.193.20.3]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t8FDtiXQ031670; Tue, 15 Sep 2015 06:55:48 -0700 From: To: Date: Tue, 15 Sep 2015 21:55:26 +0800 Message-ID: <1442325342-13806-2-git-send-email-hongbo.zhang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442325342-13806-1-git-send-email-hongbo.zhang@freescale.com> References: <1442325342-13806-1-git-send-email-hongbo.zhang@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD035; 1:F2EQNTXKR+Zlt25dACxP/t0eRaY0oQUqUuCi78q/2Vv4yUdiC4zD11c9/QYtu2cvUJZEXQFDnNDaavhPn5KwvF4NauG5u+FNw1ov6QEmgQGRFsXAP54KVCw78nrmIWAnqD19kMzsaBqvEqIcNgtCOne20T+dYH8jOz750EIMruevkZhYKd/U+7Ck3ruUO952SBKplaMImg0KrqqdelMUJGTOoLujD5S7BuhO7vriD545QAsYEIKgf5BGCbFWZm9Pok9IQ1HU6zcJJb4ko6Met1RmIwIr+oQXixFNHGVNbWUF0EH8liFVKZDuGsf20tgqUi0SLobe+pXez5NvDdZVEQ3NCEc9UuE8LFKSMmW6YRqq1625EiCjy8Ak4M6hItgofDayhMaXSd7rVXL4KTvUaQ== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(2351001)(229853001)(76176999)(85426001)(106466001)(105606002)(33646002)(86152002)(50226001)(69596002)(86362001)(50986999)(46102003)(104016003)(87936001)(77096005)(64706001)(77156002)(19580395003)(5003940100001)(92566002)(6806004)(68736005)(5001860100001)(48376002)(2950100001)(50466002)(62966003)(5007970100001)(110136002)(5001830100001)(11100500001)(5001960100002)(189998001)(5001920100001)(36756003)(81156007)(97736004)(4001540100001)(19580405001)(47776003)(41533002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB487; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB487; 2:O3ntpQeGXNeWPg6TAJHbvpvY4jQJoyWojD8dMbJQprySAXAHKXe917KZjHXRN0uvXVXcVemV0j6Vot+c3PI71MkPnw8pU32mcZeGMVV6Eh92lUX7SPgOx9JqULMOCFpLAoLo2iWML2WLcsyw7PwWYh1vs8eIKzmNvY/GqddqoqY=; 3:4fmRdd5AEefV6ZwEm7ZilWanm5bc+rhgp2OHO8jltLokewif9NDieg3dv+d8JFPmuPVAQb2U3nlphYm9+KEn4Xmwvm2NjhURO4zAmTnj1iIyBLURzTtl+X1weBCipzXTOHYoH1N+mZINDYcFSj6EC42/r6KNe+Qgt1D0NVUq0sPuw8ITaIPfgM4h+LDJN+nmfFup98izwinhGo3dgOkDGFe9UbmxfH2+p8DRUphHmgw=; 25:G5aoUY8CwBwb+xZ9iBmwOT5HzcvCk1h8BAeywfAQHU1xNX/t3yriJ7EA8Sp0TUo9gWdBDwTKY2fi5F0OL3Z73rMiI+3f6U0LpeFvqHZr/VKek3ACxmXJYo0JeuDuSWdyWAXG1nAxrWnzTy8SjYbXzQZiDxLanV/w606kJjZVCNr4s21Dj0LompD/vYDmgVE87+x7TTooz+UuQfaZm7fVxRTzprhx4OVw4//O/qGCp3plURRPk9Ak8zUsT2EObO2kH+7CQ1K82h8+hrXD+I71zA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB487; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB487; 20:Ga5MQHy0z907ku8rn+XCe4S1R5Uij1zSrO5Ilq/Lba2k+wEnMQ8Za2Lnvl7LboFTqO3Rr6OXZcQPvkXXECTAMLebox4OiYniX9jWo1ItzaRaeppcw1g74FywrkZzBlh1VxygxR5v3ZhU+m9+zKg0zTelgFpR6OA9KoiOgb3ZI/Y/XTAETBdvZX3RNJFmxv2GV02gUrOdoWxLjEUwoYMGrT+dm/BFmh0FJScbiGH5Ur2fmd5K3vxdtwL1RDGTjI+rddRTSa/4FMNJu2+6gNghx9DHioLCMEkIJ+t44GHwXb+9rYmLdH2YimQaHuue+w0cMtCJBmH3Vx2ZMCSYJmLT3moQtWvFqS5h9BS3gz2FaKY=; 4:6N2xDZT4cJoOfSOgcHNUqdmvn5a3DA03GANSnHeFBLi0MHOB5f/TRyER5ea7dHksovq16HeQ3YxMtq4wSQImt+eIevaCrQ6KSW1pmVsgR7lX+hG0UScN/UjVZwdpQ1MmOIBVEHzjPDG3c1YHdjBOpBwQ+BAwjnp6kpyqJLF0FTEqQQrSkVNilm/hxlC6H9wBhAx0hOYyjh32l6WUzX9odiQFiKeRVuilC1plVutpqEQ6Zsyh+w8gEuvZFlA13HIYkH1YO4TfMP8RWvAa3IFES/i7MDwr1aal/k1ZaeKiHMaXUPUT0f6ruLG+1Dn/UYXXiC2ZN7E/nPVBXbyX8I7DSexsGbziZ066az0I2kjx+gw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(8121501046)(5005006)(520075)(520078)(3002001); SRVR:BLUPR03MB487; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB487; X-Forefront-PRVS: 070092A9D3 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB487; 23:udC94kDYlwFtRySs2xlnzRziagSboHb86uVN8JEdiU?= =?us-ascii?Q?CUqM+W2ZhhHklGLjPxgtUnZGEdqNGesOvFhMkaZTWxVjjkb6RoclcFfZQup0?= =?us-ascii?Q?/rk3XeyHvIhK0W8KRip/MQaHwNH9X++XygkqLB+1XHZ8KziID44kv664sc38?= =?us-ascii?Q?kGfuhWsvyD/CaRBQcuD5iiQHyNLK4GQo48Q3SMU0LGwVTK+oe/x1yX3VRwXl?= =?us-ascii?Q?KefVAiq5rDQDMsR0VwP803Ynpp8TrIsnd5aa/57EWZ8I2jggUfNU/ZqYSU/k?= =?us-ascii?Q?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ve+r4hyXHUxukStG?= =?us-ascii?Q?LC0B1cjIHRJdF52i9JGxKhxBMiuOW9cy2gxAjYlIsb4UYqJFawbiumKrx0rG?= =?us-ascii?Q?qIDjCPiq82NpJce6GTwcxJGZcKSSgCMgxgGQhjOjEi7i1oAOMyCBX8VUxKTU?= =?us-ascii?Q?fKKbfXVmaW6zfZS3SN2mPtmcOmPt877tSGSjhLFqiu?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB487; 5:uMm4BpjNQ5dURts46IJmTqX+x3tHzBhrdmRIRYXSvdh+KH9IrgFb1quabOsKlmTbg3ns7NjBu3zAesrMDDZFfZklEH1u8cdtjsOMjnfvehjoZzy7YsCJvaKAnmnqtuSfpvsGbEeZjatMj3P/NLJLvw==; 24:zneWINNpTOb0sgSUsbffCPYOtLS09adp9WNmK1+iFMU3010Jz3L7dIpb4zam4/nupF8gVwJj6BkXmTlVqkGDv2LKo5vA4fBobWx1f7ylcpo=; 20:5GCLNoKMf9ytE8HNGx/MUEVx9tREpZYVl5v3GV64cHZb5q1/xE3uuEJdVjTftKJ80s67PuMj+d+XTWn6grW1Fw== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2015 13:55:51.0893 (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: BLUPR03MB487 X-Topics: patch Cc: petri.savolainen@nokia.com, stuart.haslam@arm.com Subject: [lng-odp] [API NEXT PATCH v5 01/17] linux-generic: sysinfo: make the model_str per-CPU data 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.181 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 For AMP system such as ARM big.LITTLE, cores are heterogeneous, and the model_str for each core may be different too, so this patch changes the model_str to data array model_str[] to contain data for each different core, while for the common SMP system, we can simply use the model_str[0] to contain data for all cores because they are all same, but if like, we can fill each item in the data array too. The new API to get each model_str for AMP system will be added later. Signed-off-by: Hongbo Zhang --- platform/linux-generic/include/odp_internal.h | 4 +++- platform/linux-generic/odp_system_info.c | 28 +++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 6f0050f..eac642c 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -23,13 +23,15 @@ extern "C" { extern __thread int __odp_errno; +#define MAX_CPU_NUMBER 128 + typedef struct { uint64_t cpu_hz; uint64_t huge_page_size; uint64_t page_size; int cache_line_size; int cpu_count; - char model_str[128]; + char model_str[MAX_CPU_NUMBER][128]; } odp_system_info_t; struct odp_global_data_s { diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index 31df29e..cf6d5a7 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -139,10 +139,10 @@ static int cpuinfo_x86(FILE *file, odp_system_info_t *sysinfo) if (pos) { int len; pos = strchr(str, ':'); - strncpy(sysinfo->model_str, pos+2, - sizeof(sysinfo->model_str)); - len = strlen(sysinfo->model_str); - sysinfo->model_str[len - 1] = 0; + strncpy(sysinfo->model_str[0], pos + 2, + sizeof(sysinfo->model_str[0])); + len = strlen(sysinfo->model_str[0]); + sysinfo->model_str[0][len - 1] = 0; model = 1; count--; } @@ -188,10 +188,10 @@ static int cpuinfo_octeon(FILE *file, odp_system_info_t *sysinfo) if (pos) { int len; pos = strchr(str, ':'); - strncpy(sysinfo->model_str, pos+2, - sizeof(sysinfo->model_str)); - len = strlen(sysinfo->model_str); - sysinfo->model_str[len - 1] = 0; + strncpy(sysinfo->model_str[0], pos + 2, + sizeof(sysinfo->model_str[0])); + len = strlen(sysinfo->model_str[0]); + sysinfo->model_str[0][len - 1] = 0; model = 1; count--; } @@ -228,10 +228,10 @@ static int cpuinfo_powerpc(FILE *file, odp_system_info_t *sysinfo) if (pos) { int len; pos = strchr(str, ':'); - strncpy(sysinfo->model_str, pos+2, - sizeof(sysinfo->model_str)); - len = strlen(sysinfo->model_str); - sysinfo->model_str[len - 1] = 0; + strncpy(sysinfo->model_str[0], pos + 2, + sizeof(sysinfo->model_str[0])); + len = strlen(sysinfo->model_str[0]); + sysinfo->model_str[0][len - 1] = 0; model = 1; count--; } @@ -333,7 +333,7 @@ static int systemcpu(odp_system_info_t *sysinfo) sysinfo->cpu_hz = 1400000000; sysinfo->cache_line_size = 64; - strncpy(sysinfo->model_str, "UNKNOWN", sizeof(sysinfo->model_str)); + strncpy(sysinfo->model_str[0], "UNKNOWN", sizeof(sysinfo->model_str)); return 0; } @@ -391,7 +391,7 @@ uint64_t odp_sys_page_size(void) const char *odp_sys_cpu_model_str(void) { - return odp_global_data.system_info.model_str; + return odp_global_data.system_info.model_str[0]; } int odp_sys_cache_line_size(void)