util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lscpu : -b and -c option does not give expected output.
@ 2012-08-06  5:10 Faizan husain
  2012-08-06 11:50 ` Heiko Carstens
  0 siblings, 1 reply; 8+ messages in thread
From: Faizan husain @ 2012-08-06  5:10 UTC (permalink / raw)
  To: util-linux; +Cc: faizan husain

From: faizan husain <faizanh@linux.vnet.ibm.com>

Options for lscpu command are giving incorrect output.
As per the man page or help, '-b' option should limit the output to online CPUs
and '-c' option should limit the output to offline CPUs.
But we could see the output is same for '-a','-b' and '-c' options.

Signed-off-by: faizan husain <faizanh@linux.vnet.ibm.com>
---
 sys-utils/lscpu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index b93998a..7c28a56 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -1101,12 +1101,12 @@ print_summary(struct lscpu_desc *desc, struct lscpu_modifier *mod)
 #endif
 	print_n(_("CPU(s):"), desc->ncpus);
 
-	if (desc->online)
+	if (desc->online && mod->online)
 		print_cpuset(mod->hex ? _("On-line CPU(s) mask:") :
 					_("On-line CPU(s) list:"),
 				desc->online, mod->hex);
 
-	if (desc->online && CPU_COUNT_S(setsize, desc->online) != desc->ncpus) {
+	if (desc->online && mod->offline && CPU_COUNT_S(setsize, desc->online) != desc->ncpus) {
 		cpu_set_t *set;
 
 		/* Linux kernel provides cpuset of off-line CPUs that contains
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] lscpu : -b and -c option does not give expected output.
@ 2012-08-05 10:37 Faizan husain
  2012-08-06  5:08 ` faizan husain
  0 siblings, 1 reply; 8+ messages in thread
From: Faizan husain @ 2012-08-05 10:37 UTC (permalink / raw)
  To: util-linux; +Cc: faizan husain

From: faizan husain <faizanh@linux.vnet.ibm.com>

Options for lscpu command are giving incorrect output.
As per the man page or help, '-b' option should limit the output to online CPUs
and '-c' option should limit the output to offline CPUs.
But we could see the output is same for '-a','-b' and '-c' options.

Signed-off-by: faizan husain <faizanh@linux.vnet.ibm.com>
---
 sys-utils/lscpu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index b93998a..648f51e 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -1101,12 +1101,12 @@ print_summary(struct lscpu_desc *desc, struct lscpu_modifier *mod)
 #endif
 	print_n(_("CPU(s):"), desc->ncpus);
 
-	if (desc->online)
+	if (desc->online && mod->online)
 		print_cpuset(mod->hex ? _("On-line CPU(s) mask:") :
 					_("On-line CPU(s) list:"),
 				desc->online, mod->hex);
 
-	if (desc->online && CPU_COUNT_S(setsize, desc->online) != desc->ncpus) {
+	if (desc->online && mod->online && CPU_COUNT_S(setsize, desc->online) != desc->ncpus) {
 		cpu_set_t *set;
 
 		/* Linux kernel provides cpuset of off-line CPUs that contains
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-08-07  9:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06  5:10 [PATCH] lscpu : -b and -c option does not give expected output Faizan husain
2012-08-06 11:50 ` Heiko Carstens
2012-08-07  5:30   ` faizan husain
2012-08-07  7:35     ` Heiko Carstens
2012-08-07  8:23       ` Bernhard Voelker
2012-08-07  9:01       ` faizan husain
  -- strict thread matches above, loose matches on Subject: below --
2012-08-05 10:37 Faizan husain
2012-08-06  5:08 ` faizan husain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).