Unconditionally enable SMP support for linux.
1999-01-06 Martin Baulig <martin@home-of-linux.org> Unconditionally enable SMP support for linux. * open.c (_glibtop_open_s): Always determine the number of CPUs we have here, not only when SMP support was enabled. * cpu.c, proctime.c: Use `server->ncpu' to determine whether to enable SMP support.
This commit is contained in:
committed by
Martin Baulig
parent
688e65fbec
commit
e491343151
@@ -38,11 +38,10 @@ static const unsigned long _glibtop_sysdeps_cpu_smp =
|
||||
void
|
||||
glibtop_init_cpu_s (glibtop *server)
|
||||
{
|
||||
#if HAVE_LIBGTOP_SMP
|
||||
server->sysdeps.cpu = _glibtop_sysdeps_cpu | _glibtop_sysdeps_cpu_smp;
|
||||
#else
|
||||
server->sysdeps.cpu = _glibtop_sysdeps_cpu;
|
||||
#endif
|
||||
|
||||
if (server->ncpu)
|
||||
server->sysdeps.cpu |= _glibtop_sysdeps_cpu_smp;
|
||||
}
|
||||
|
||||
/* Provides information about cpu usage. */
|
||||
@@ -83,8 +82,7 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
|
||||
buf->frequency = 100;
|
||||
buf->flags = _glibtop_sysdeps_cpu;
|
||||
|
||||
#if HAVE_LIBGTOP_SMP
|
||||
for (i = 0; i < GLIBTOP_NCPU; i++) {
|
||||
for (i = 0; i < server->ncpu; i++) {
|
||||
if (strncmp (p+1, "cpu", 3) || !isdigit (p [4]))
|
||||
break;
|
||||
|
||||
@@ -99,5 +97,4 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
|
||||
}
|
||||
|
||||
buf->flags |= _glibtop_sysdeps_cpu_smp;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user