Skip to contentSkip to conversation

lscpu: Print ISA information in summary

PATCH Superseded Sunil V L 1 participant 2 messages Mar 4, 2025 – Mar 5, 2025 Util-Linux package

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sunil V L

author
#0 lore raw

PATCH 1/1 lscpu: Print ISA information in summary

The ISA information for RISC-V is an important information to understand the different extensions supported by the CPU. Print this information in the summary.

---
 sys-utils/lscpu-cputype.c | 1 +
 sys-utils/lscpu.c         | 3 +++
 2 files changed, 4 insertions(+)
sys-utils/lscpu-cputype.c +1 -0
index 739dd99c5..bdb33ac78 100644
@@ -233,6 +233,7 @@ static const struct cpuinfo_pattern type_patterns[] =
 	DEF_PAT_CPUTYPE( "family",		PAT_FAMILY,	family),
 	DEF_PAT_CPUTYPE( "features",		PAT_FEATURES,	flags),		/* s390 */
 	DEF_PAT_CPUTYPE( "flags",		PAT_FLAGS,	flags),		/* x86 */
+	DEF_PAT_CPUTYPE( "isa",			PAT_ISA,	isa),		/* riscv */
 	DEF_PAT_CPUTYPE( "marchid",		PAT_FAMILY,	family),	/* riscv */
 	DEF_PAT_CPUTYPE( "max thread id",	PAT_MAX_THREAD_ID, mtid),	/* s390 */
 	DEF_PAT_CPUTYPE( "mimpid",		PAT_MODEL,	model),		/* riscv */
sys-utils/lscpu.c +3 -0
index ffec37206..9f00b1757 100644
@@ -954,6 +954,9 @@ print_summary_cputype(struct lscpu_cxt *cxt,
 
 	if (ct->flags)
 		add_summary_s(tb, sec, _("Flags:"), ct->flags);
+
+	if (ct->isa)
+		add_summary_s(tb, sec, _("ISA:"), ct->isa);
 }
 
 /*
Signature · 1 line
2.43.0
author
#1 lore raw
Quoted 4 lines · Sunil V L

The ISA information for RISC-V is an important information to understand the different extensions supported by the CPU. Print this information in the summary.

Hi,

I had some offline conversation with Drew and Anup regarding the formatting of the ISA. I will send v2 of this patch to address the feedback from them. So, please ignore this version for now.

Thanks,
Sunil