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,12 +38,10 @@ static const unsigned long _glibtop_sysdeps_proc_time_smp =
|
||||
void
|
||||
glibtop_init_proc_time_s (glibtop *server)
|
||||
{
|
||||
#if HAVE_LIBGTOP_SMP
|
||||
server->sysdeps.proc_time = _glibtop_sysdeps_proc_time |
|
||||
_glibtop_sysdeps_proc_time_smp;
|
||||
#else
|
||||
server->sysdeps.proc_time = _glibtop_sysdeps_proc_time;
|
||||
#endif
|
||||
|
||||
if (server->ncpu)
|
||||
server->sysdeps.proc_time |= _glibtop_sysdeps_proc_time_smp;
|
||||
}
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
@@ -83,7 +81,9 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
|
||||
|
||||
buf->flags = _glibtop_sysdeps_proc_time;
|
||||
|
||||
#if HAVE_LIBGTOP_SMP
|
||||
if (!server->ncpu)
|
||||
return;
|
||||
|
||||
if (proc_file_to_buffer (buffer, "/proc/%d/cpu", pid))
|
||||
return;
|
||||
|
||||
@@ -101,5 +101,4 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
|
||||
}
|
||||
|
||||
buf->flags |= _glibtop_sysdeps_proc_time_smp;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user