[PATCH 4/4] lscpu: show physical socket on aarch64 without ACPI PPTT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Masayoshi Mizuma <m.mizuma@xxxxxxxxxxxxxx>

Show the number of physical socket even if the sysfs doesn't have
the physical socket information.
Note, lscpu cannot show the number of socket info for unprivileged
users because it needs to access the DMI table.

Signed-off-by: Masayoshi Mizuma <m.mizuma@xxxxxxxxxxxxxx>
---
 sys-utils/lscpu.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index 8c823c170..3e7da2eac 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -2182,9 +2182,15 @@ print_summary(struct lscpu_desc *desc, struct lscpu_modifier *mod)
 				add_summary_n(tb, _("Book(s):"), books_per_drawer ?: desc->nbooks);
 			}
 		} else {
-			if (is_cluster)
+			if (is_cluster) {
+				int sockets = get_number_of_physical_sockets_from_dmi();
+
+				if (sockets > 0)
+					add_summary_n(tb, _("Socket(s):"), sockets);
+				else
+					add_summary_s(tb, _("Socket(s):"), "-");
 				add_summary_n(tb, _("Cluster(s):"), desc->nsockets);
-			else
+			} else
 				add_summary_n(tb, _("Socket(s):"),
 						sockets_per_book ?: desc->nsockets);
 		}
-- 
2.27.0




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux