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:
@@ -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
|
||||
|
Reference in New Issue
Block a user