]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lscpu: use CPU types de-duplication
authorKarel Zak <kzak@redhat.com>
Thu, 30 May 2024 11:59:16 +0000 (13:59 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 30 May 2024 11:59:16 +0000 (13:59 +0200)
commiteb6514b4c2618ff68abbafd36fc3520beed87812
tree4ab61bcb2eaa06fbf4d7e87f8f717645cdbc5679
parent0284eb3a8a6505dd9745b042089046ad368bfe74
lscpu: use CPU types de-duplication

The new CPU type was always allocated when a new relevant value for
the type was found in the cpuinfo file. However, this solution is
fragile because it can result in the parser creating a cputype struct
with incomplete information.

For instance, on ARM systems with multiple CPU types, a new CPU type
would be triggered by a different "CPU part ID". In cases where the
vendor remained the same, a new type would be created later but the
vendor would not be initialized.

The new implementation creates a new CPU type for each CPU (almost)
and then later de-duplicates the array based on vendor, model, etc.

Addresses: https://github.com/util-linux/util-linux/issues/3062
Signed-off-by: Karel Zak <kzak@redhat.com>
include/strutils.h
sys-utils/lscpu-cpu.c
sys-utils/lscpu-cputype.c
sys-utils/lscpu.1.adoc