Adjustment to the "offline" patch-set to make the initial system

banner, the "sys" command, and the X86_64 "mach" command, to only
show the "OFFLINE" cpu count if there are actually offline cpus.
(anderson@redhat.com)
This commit is contained in:
Dave Anderson 2014-10-15 10:07:29 -04:00
parent d5b362edf7
commit 00cfb79c04
2 changed files with 14 additions and 5 deletions

View File

@ -4798,9 +4798,14 @@ display_sys_stats(void)
if (machine_type("PPC64"))
fprintf(fp, " CPUS: %d\n", get_cpus_to_display());
else
fprintf(fp, " CPUS: %d [OFFLINE: %d]\n", kt->cpus,
kt->cpus - get_cpus_to_display());
else {
fprintf(fp, " CPUS: %d", kt->cpus);
if (kt->cpus - get_cpus_to_display())
fprintf(fp, " [OFFLINE: %d]",
kt->cpus - get_cpus_to_display());
fprintf(fp, "\n");
}
if (ACTIVE())
get_xtime(&kt->date);
fprintf(fp, " DATE: %s\n",

View File

@ -5047,8 +5047,12 @@ x86_64_display_machine_stats(void)
fprintf(fp, " MACHINE TYPE: %s\n", uts->machine);
fprintf(fp, " MEMORY SIZE: %s\n", get_memory_size(buf));
fprintf(fp, " CPUS: %d [OFFLINE: %d]\n", kt->cpus,
kt->cpus - get_cpus_to_display());
fprintf(fp, " CPUS: %d", kt->cpus);
if (kt->cpus - get_cpus_to_display())
fprintf(fp, " [OFFLINE: %d]\n",
kt->cpus - get_cpus_to_display());
else
fprintf(fp, "\n");
if (!STREQ(kt->hypervisor, "(undetermined)") &&
!STREQ(kt->hypervisor, "bare hardware"))
fprintf(fp, " HYPERVISOR: %s\n", kt->hypervisor);