diff options
| author | Len Brown <len.brown@intel.com> | 2024-04-21 11:56:48 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-11 12:47:10 +0200 |
| commit | 325d8659b8fdbee76a56645cc70a39f10667b0df (patch) | |
| tree | 0a011d0281c1b19c041f99aa9ad79a7f78d17bce /tools | |
| parent | 0c97527e916054acc4a46ffb02842988acb2e92b (diff) | |
| download | linux-325d8659b8fdbee76a56645cc70a39f10667b0df.tar.gz linux-325d8659b8fdbee76a56645cc70a39f10667b0df.tar.bz2 linux-325d8659b8fdbee76a56645cc70a39f10667b0df.zip | |
tools/power turbostat: Remember global max_die_id
[ Upstream commit cda203388687aa075db6f8996c3c4549fa518ea8 ]
This is necessary to gracefully handle sparse die_id's.
no functional change
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/power/x86/turbostat/turbostat.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index a41bad8e653b..66e31da94258 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -566,6 +566,7 @@ struct topo_params { int num_cpus; int num_cores; int max_cpu_num; + int max_die_id; int max_node_num; int nodes_per_pkg; int cores_per_node; @@ -5864,7 +5865,6 @@ void topology_probe() int i; int max_core_id = 0; int max_package_id = 0; - int max_die_id = 0; int max_siblings = 0; /* Initialize num_cpus, max_cpu_num */ @@ -5933,8 +5933,8 @@ void topology_probe() /* get die information */ cpus[i].die_id = get_die_id(i); - if (cpus[i].die_id > max_die_id) - max_die_id = cpus[i].die_id; + if (cpus[i].die_id > topo.max_die_id) + topo.max_die_id = cpus[i].die_id; /* get numa node information */ cpus[i].physical_node_id = get_physical_node_id(&cpus[i]); @@ -5960,9 +5960,9 @@ void topology_probe() if (!summary_only && topo.cores_per_node > 1) BIC_PRESENT(BIC_Core); - topo.num_die = max_die_id + 1; + topo.num_die = topo.max_die_id + 1; if (debug > 1) - fprintf(outf, "max_die_id %d, sizing for %d die\n", max_die_id, topo.num_die); + fprintf(outf, "max_die_id %d, sizing for %d die\n", topo.max_die_id, topo.num_die); if (!summary_only && topo.num_die > 1) BIC_PRESENT(BIC_Die); |
