Implemented server->real_ncpu. Add a warning to display ncpu and real_ncpu
* open.c: (glibtop_open_s): Implemented server->real_ncpu. Add a warning to display ncpu and real_ncpu on open.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2005-12-14 Benoît Dejean <benoit@placenet.org>
|
||||||
|
|
||||||
|
* open.c: (glibtop_open_s):
|
||||||
|
|
||||||
|
Implemented server->real_ncpu.
|
||||||
|
Add a warning to display ncpu and real_ncpu on open.
|
||||||
|
|
||||||
2005-12-13 Benoît Dejean <benoit@placenet.org>
|
2005-12-13 Benoît Dejean <benoit@placenet.org>
|
||||||
|
|
||||||
* cpu.c: (glibtop_get_cpu_s):
|
* cpu.c: (glibtop_get_cpu_s):
|
||||||
|
@@ -79,17 +79,21 @@ glibtop_open_s (glibtop *server, const char *program_name,
|
|||||||
|
|
||||||
p = skip_line(p); /* cpu */
|
p = skip_line(p); /* cpu */
|
||||||
|
|
||||||
for (server->ncpu = 0; server->ncpu < GLIBTOP_NCPU; server->ncpu++) {
|
for (server->real_ncpu = 0; /* nop */; server->real_ncpu++) {
|
||||||
|
|
||||||
if (!check_cpu_line(server, p, server->ncpu)) {
|
if (!check_cpu_line(server, p, server->real_ncpu)) {
|
||||||
server->ncpu--;
|
server->real_ncpu--;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = skip_line(p);
|
p = skip_line(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
server->ncpu = MIN(GLIBTOP_NCPU - 1, server->real_ncpu);
|
||||||
printf ("\nThis machine has %d CPUs.\n\n", server->ncpu);
|
|
||||||
#endif
|
glibtop_warn_r(server,
|
||||||
|
"This machine has %d CPUs, "
|
||||||
|
"%d are being monitored.",
|
||||||
|
server->real_ncpu + 1,
|
||||||
|
server->ncpu + 1);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user