diff mbox

[3/6] AArch64: Parse cputopology from /proc/cpuinfo.

Message ID 1381240151-15060-4-git-send-email-pranavkumar@linaro.org
State New
Headers show

Commit Message

PranavkumarSawargaonkar Oct. 8, 2013, 1:49 p.m. UTC
CPU "parser" for AArch64.
Showing cputopology in arm64 linux is work-in-progress so for now
all AArch64 cpus belong to same socket (like PPC).

Also we parse BogoMIPS same like arm 32bit.

Signed-off-by: Anup Patel <anup.patel@linaro.org>
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
---
 src/nodeinfo.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Cole Robinson Oct. 9, 2013, 1:52 p.m. UTC | #1
On 10/08/2013 09:49 AM, Pranavkumar Sawargaonkar wrote:
> CPU "parser" for AArch64.
> Showing cputopology in arm64 linux is work-in-progress so for now
> all AArch64 cpus belong to same socket (like PPC).
> 
> Also we parse BogoMIPS same like arm 32bit.
> 
> Signed-off-by: Anup Patel <anup.patel@linaro.org>
> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
> ---
>  src/nodeinfo.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/nodeinfo.c b/src/nodeinfo.c
> index 320d8f8..309066c 100644
> --- a/src/nodeinfo.c
> +++ b/src/nodeinfo.c
> @@ -205,7 +205,8 @@ virNodeParseSocket(const char *dir, unsigned int cpu)
>  # if defined(__powerpc__) || \
>      defined(__powerpc64__) || \
>      defined(__s390__) || \
> -    defined(__s390x__)
> +    defined(__s390x__) || \
> +    defined(__aarch64__)
>      /* ppc and s390(x) has -1 */
>      if (ret < 0)
>          ret = 0;
> @@ -441,7 +442,7 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
>               * and parsed in next iteration, because it is not in expected
>               * format and thus lead to error. */
>          }
> -# elif defined(__arm__)
> +# elif defined(__arm__) || defined(__aarch64__)
>          char *buf = line;
>          if (STRPREFIX(buf, "BogoMIPS")) {
>              char *p;
> 

ACK

- Cole
Daniel P. Berrangé Oct. 9, 2013, 2:47 p.m. UTC | #2
On Tue, Oct 08, 2013 at 07:19:08PM +0530, Pranavkumar Sawargaonkar wrote:
> CPU "parser" for AArch64.
> Showing cputopology in arm64 linux is work-in-progress so for now
> all AArch64 cpus belong to same socket (like PPC).
> 
> Also we parse BogoMIPS same like arm 32bit.
> 
> Signed-off-by: Anup Patel <anup.patel@linaro.org>
> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
> ---
>  src/nodeinfo.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

ACK


Daniel
diff mbox

Patch

diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 320d8f8..309066c 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -205,7 +205,8 @@  virNodeParseSocket(const char *dir, unsigned int cpu)
 # if defined(__powerpc__) || \
     defined(__powerpc64__) || \
     defined(__s390__) || \
-    defined(__s390x__)
+    defined(__s390x__) || \
+    defined(__aarch64__)
     /* ppc and s390(x) has -1 */
     if (ret < 0)
         ret = 0;
@@ -441,7 +442,7 @@  int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
              * and parsed in next iteration, because it is not in expected
              * format and thus lead to error. */
         }
-# elif defined(__arm__)
+# elif defined(__arm__) || defined(__aarch64__)
         char *buf = line;
         if (STRPREFIX(buf, "BogoMIPS")) {
             char *p;