Patryk Wlazlyn 44d0dc6ef3 tools/power turbostat: Avoid possible memory corruption due to sparse topology IDs
[ Upstream commit 3559ea813ad3a9627934325c68ad05b18008a077 ]

Save the highest core and package id when parsing topology to
allocate enough memory when get_rapl_counters() is called with a core or
a package id as a domain.

Note that RAPL domains are per-package on Intel, but per-core on AMD.
Thus, the RAPL code effectively runs in different modes on those two
product lines.

Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-11 12:51:06 +02:00
..