From 4748c6c4d72e17f86bb846289a5a9887891541f1 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Sat, 11 Dec 1999 15:38:04 +0000 Subject: [PATCH] Only set smp flags when we're really on a SMP machine. 1999-12-11 Martin Baulig * cpu.c: Only set smp flags when we're really on a SMP machine. --- sysdeps/linux/ChangeLog | 4 ++++ sysdeps/linux/cpu.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sysdeps/linux/ChangeLog b/sysdeps/linux/ChangeLog index 71642228..10b66fad 100644 --- a/sysdeps/linux/ChangeLog +++ b/sysdeps/linux/ChangeLog @@ -1,3 +1,7 @@ +1999-12-11 Martin Baulig + + * cpu.c: Only set smp flags when we're really on a SMP machine. + 1999-11-28 Martin Baulig * procstate.c (glibtop_get_procstate_s): Stat "/proc/" instead diff --git a/sysdeps/linux/cpu.c b/sysdeps/linux/cpu.c index 63320456..4d4cec00 100644 --- a/sysdeps/linux/cpu.c +++ b/sysdeps/linux/cpu.c @@ -33,7 +33,7 @@ static const unsigned long _glibtop_sysdeps_cpu = static const unsigned long _glibtop_sysdeps_cpu_smp = (1L << GLIBTOP_CPU_XCPU_TOTAL) + (1L << GLIBTOP_CPU_XCPU_USER) + (1L << GLIBTOP_CPU_XCPU_NICE) + (1L << GLIBTOP_CPU_XCPU_SYS) + -(1L << GLIBTOP_CPU_XCPU_IDLE); +(1L << GLIBTOP_CPU_XCPU_IDLE) + (1L << GLIBTOP_CPU_XCPU_FLAGS); /* Init function. */ @@ -100,6 +100,8 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf) if (strncmp (p+1, "cpu", 3) || !isdigit (p [4])) break; + buf->xcpu_flags |= (1L << (u_int64_t) i); + p += 6; buf->xcpu_user [i] = strtoul (p, &p, 0); buf->xcpu_nice [i] = strtoul (p, &p, 0); @@ -114,7 +116,8 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf) buf->xcpu_total [i] = total; } - buf->flags |= _glibtop_sysdeps_cpu_smp; + if (buf->xcpu_flags) + buf->flags |= _glibtop_sysdeps_cpu_smp; return 0; }