Fixed server->ncpu usage (SMP handling). Need more testing.

* cpu.c: (glibtop_get_cpu_s):
	* glibtop_private.c: (get_scaled), (check_cpu_line):
	* glibtop_private.h:
	* open.c: (glibtop_open_s):
	* proctime.c: (glibtop_get_proc_time_s):

	Fixed server->ncpu usage (SMP handling). Need more testing.
This commit is contained in:
Benoît Dejean
2005-12-13 09:15:49 +00:00
parent ba7355df9e
commit 806a816026
6 changed files with 64 additions and 12 deletions

View File

@@ -77,12 +77,16 @@ glibtop_open_s (glibtop *server, const char *program_name,
file_to_buffer(server, buffer, FILENAME);
p = skip_line(p); /* cpu */
for (server->ncpu = 0; server->ncpu < GLIBTOP_NCPU; server->ncpu++) {
p = skip_line(p);
if (strncmp (p, "cpu", 3) || !isdigit (p [3]))
if (!check_cpu_line(server, p, server->ncpu)) {
server->ncpu--;
break;
}
p = skip_line(p);
}
#ifdef DEBUG