Skip to contentSkip to conversation

lscpu: add cpu flags entry to summary output

PATCH Applied WANG Chao 3 participants 5 messages May 13, 2015 – May 15, 2015 Util-Linux package

lore
Share & tools
lore

WANG Chao

author
#0 lore raw

PATCH 1/1 lscpu: add cpu flags entry to summary output

It'd be convenient to have unified cpu "Flags: " entry in the summary output.

---
 sys-utils/lscpu.c | 3 +++
 1 file changed, 3 insertions(+)
sys-utils/lscpu.c +3 -0
index fd94d1a..b36d1da 100644
@@ -1634,6 +1634,9 @@ print_summary(struct lscpu_desc *desc, struct lscpu_modifier *mod)
 		snprintf(buf, sizeof(buf), _("NUMA node%d CPU(s):"), desc->idx2nodenum[i]);
 		print_cpuset(buf, desc->nodemaps[i], mod->hex);
 	}
+
+	if (desc->flags)
+		print_s(_("Flags:"), desc->flags);
 }
 
 static void __attribute__((__noreturn__)) usage(FILE *out)
Signature · 1 line
2.3.0
#2 lore raw
Quoted 5 lines · Karel Zak
Quoted 2 lines · WANG Chao
 sys-utils/lscpu.c | 3 +++
 1 file changed, 3 insertions(+)

Applied, thanks.

Hello Karel,

just a general question, from my understanding the the summary output is supposed to be human readable. I'm not sure how a 500+ character line fits into this.
At least it doesn't fit to the current layout of the summary output, but maybe that's just my impression.

Just wondering.

maintainer
#3 lore raw
Quoted 5 lines · Heiko Carstens
Quoted 4 lines · Karel Zak
Quoted 2 lines · WANG Chao
 sys-utils/lscpu.c | 3 +++
 1 file changed, 3 insertions(+)
Quoted 7 lines
Quoted 1 line

Applied, thanks.

Hello Karel,

just a general question, from my understanding the the summary output is supposed to be human readable. I'm not sure how a 500+ character line fits into this.

It's last line printed by lscpu, so terminal wraps it and from my point of view it's still pretty human readable.

Quoted 2 lines

At least it doesn't fit to the current layout of the summary output, but maybe that's just my impression.

Any suggestion how to improve it?

I think that provide incomplete info and force people to read also /proc/cpuinfo is bad idea.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#4 lore raw
Quoted 17 lines · Karel Zak
Quoted 5 lines · Heiko Carstens
Quoted 4 lines · Karel Zak
Quoted 2 lines · WANG Chao
 sys-utils/lscpu.c | 3 +++
 1 file changed, 3 insertions(+)
Quoted 7 lines
Quoted 1 line

Applied, thanks.

Hello Karel,

just a general question, from my understanding the the summary output is supposed to be human readable. I'm not sure how a 500+ character line fits into this.

It's last line printed by lscpu, so terminal wraps it and from my point of view it's still pretty human readable.

Quoted 7 lines
Quoted 2 lines

At least it doesn't fit to the current layout of the summary output, but maybe that's just my impression.

Any suggestion how to improve it?

I think that provide incomplete info and force people to read also /proc/cpuinfo is bad idea.

Ok, I was just wondering what the general "guide line" for stuff like this is.
When I applied the patch and saw the output it looked strange to me and it didn't fit to the rest of the output. However that's probably just my personal taste ;)

Anyway, no further objections.