The modifier mod->allcpus must be set earlier and also must be used earlier. The current code only reads sysfs attributes from online cpus but skips offline cpus. So initialize mod->allcpus earlier. Signed-off-by: Heiko Carstens <heiko.carstens@xxxxxxxxxx> --- sys-utils/lscpu.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index 78d936f..63377d1 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -1266,11 +1266,13 @@ int main(int argc, char *argv[]) usage(stderr); } } + if (mod->mode == OUTPUT_READABLE && !mod->online) + mod->allcpus = 1; read_basicinfo(desc, mod); for (i = 0; i < desc->ncpus; i++) { - if (desc->online && !is_cpu_online(desc, i)) + if (desc->online && !is_cpu_online(desc, i) && !mod->allcpus) continue; read_topology(desc, i); read_cache(desc, i); @@ -1300,8 +1302,6 @@ int main(int argc, char *argv[]) print_parsable(desc, columns, ncolumns, mod); break; case OUTPUT_READABLE: - if (!mod->online) - mod->allcpus = 1; if (!ncolumns) { /* No list was given. Just print whatever is there. */ columns[ncolumns++] = COL_CPU; -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html