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

@@ -122,11 +122,12 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
p = skip_multiple_token (p, 3);
for (i = 0; i < GLIBTOP_NCPU; i++) {
if (strncmp (p+1, "cpu", 3) || !isdigit (p [4]))
for (i = 0; i <= server->ncpu; i++) {
if (!check_cpu_line_warn(server, p + 1, i))
break;
p += 6;
p = skip_token(p);
buf->xcpu_utime [i] = strtoull (p, &p, 0);
buf->xcpu_stime [i] = strtoull (p, &p, 0);
}