提交 cca149c6 编写于 作者: L Len Brown 提交者: Yang Yingliang

tools/power turbostat: reduce debug output

mainline inclusion
from mainline-v5.0-rc1
commit 0ec712e3
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I47H3V
CVE: NA

--------------------------------

A recent turbostat release increased topo.max_cpu_num
to make it convenient to handle sysfs bitmaps of 32-cpus.

But users, who regularly make use of "--debug", then saw a bunch of output
for cpus that were not present.

Remove that extra output by checking a cpu is online before dumping its info.
Signed-off-by: NLen Brown <len.brown@intel.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: NJackie Liu <liuyun01@kylinos.cn>
Reviewed-by: N江国庆 <jiangguoqing@kylinos.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 4d516770
...@@ -5002,6 +5002,8 @@ void topology_probe() ...@@ -5002,6 +5002,8 @@ void topology_probe()
return; return;
for (i = 0; i <= topo.max_cpu_num; ++i) { for (i = 0; i <= topo.max_cpu_num; ++i) {
if (cpu_is_not_present(i))
continue;
fprintf(outf, fprintf(outf,
"cpu %d pkg %d node %d lnode %d core %d thread %d\n", "cpu %d pkg %d node %d lnode %d core %d thread %d\n",
i, cpus[i].physical_package_id, i, cpus[i].physical_package_id,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册