1 Star 0 Fork 23

streamlet_hy/util-linux

forked from src-anolis-os/util-linux 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0081-lscpu-don-t-read-from-HW-when-use-sys-snapshot.patch 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
renbo02 提交于 2023-01-30 16:56 . update to util-linux-2.32.1-39.el8_7
From c223ad8f05d2d20a80e21dbb4b6240f11909f92c Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 14 Jul 2022 13:10:16 +0200
Subject: lscpu: don;t read from HW when use /sys snapshot
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2069187
Signed-off-by: Karel Zak <kzak@redhat.com>
---
sys-utils/lscpu.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index 70a797dd6..01f8fba35 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -1850,7 +1850,10 @@ print_summary(struct lscpu_desc *desc, struct lscpu_modifier *mod)
}
} else {
if (desc->is_cluster) {
- int sockets = get_number_of_physical_sockets_from_dmi();
+ int sockets = 0;
+
+ if (mod->system == SYSTEM_LIVE)
+ sockets = get_number_of_physical_sockets_from_dmi();
if (sockets > 0)
add_summary_n(tb, _("Socket(s):"), sockets);
@@ -2109,7 +2112,8 @@ int main(int argc, char *argv[])
qsort(desc->ecaches, desc->necaches,
sizeof(struct cpu_cache), cachecmp);
- desc->is_cluster = is_fallback_to_cluster(desc);
+ if (mod->system == SYSTEM_LIVE)
+ desc->is_cluster = is_fallback_to_cluster(desc);
read_nodes(desc);
read_hypervisor(desc, mod);
--
2.36.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/streamlet_hy/util-linux.git
git@gitee.com:streamlet_hy/util-linux.git
streamlet_hy
util-linux
util-linux
a8

搜索帮助

Cb406eda 1850385 E526c682 1850385