Blame SOURCES/0054-lscpu-show-physical-socket-on-aarch64-without-ACPI-P.patch

439b44
From ac6651b2bc599af707ccc96936bb028d31c1aea8 Mon Sep 17 00:00:00 2001
439b44
From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
439b44
Date: Fri, 11 Sep 2020 09:53:28 -0400
439b44
Subject: [PATCH 54/56] lscpu: show physical socket on aarch64 without ACPI
439b44
 PPTT
439b44
439b44
Show the number of physical socket even if the sysfs doesn't have
439b44
the physical socket information.
439b44
Note, lscpu cannot show the number of socket info for unprivileged
439b44
users because it needs to access the DMI table.
439b44
439b44
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1883056
439b44
Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
439b44
Signed-off-by: Karel Zak <kzak@redhat.com>
439b44
---
439b44
 sys-utils/lscpu.c | 6 ++++--
439b44
 sys-utils/lscpu.h | 1 -
439b44
 2 files changed, 4 insertions(+), 3 deletions(-)
439b44
439b44
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
439b44
index a8b448fa0..dc6dc97c3 100644
439b44
--- a/sys-utils/lscpu.c
439b44
+++ b/sys-utils/lscpu.c
439b44
@@ -1850,8 +1850,10 @@ print_summary(struct lscpu_desc *desc, struct lscpu_modifier *mod)
439b44
 			}
439b44
 		} else {
439b44
 			if (desc->is_cluster) {
439b44
-				if (desc->nr_socket_on_cluster > 0)
439b44
-					add_summary_n(tb, _("Socket(s):"), desc->nr_socket_on_cluster);
439b44
+				int sockets = get_number_of_physical_sockets_from_dmi();
439b44
+
439b44
+				if (sockets > 0)
439b44
+					add_summary_n(tb, _("Socket(s):"), sockets);
439b44
 				else
439b44
 					add_summary_s(tb, _("Socket(s):"), "-");
439b44
 
439b44
diff --git a/sys-utils/lscpu.h b/sys-utils/lscpu.h
439b44
index b190afd21..1aef8202d 100644
439b44
--- a/sys-utils/lscpu.h
439b44
+++ b/sys-utils/lscpu.h
439b44
@@ -160,7 +160,6 @@ struct lscpu_desc {
439b44
 	int		physcoresperchip;	/* Physical cores per chip */
439b44
 
439b44
 	int		is_cluster;
439b44
-	int		nr_socket_on_cluster;
439b44
 };
439b44
 
439b44
 enum {
439b44
-- 
439b44
2.29.2
439b44