diff options
author | Gopala Krishna Nuthaki <quic_gnuthaki@quicinc.com> | 2023-03-14 13:48:07 +0530 |
---|---|---|
committer | Gopala Krishna Nuthaki <quic_gnuthaki@quicinc.com> | 2023-03-14 13:48:07 +0530 |
commit | cff488aacc477fd94784e9544d807f105f2e85ee (patch) | |
tree | 72ef0a54f0d861073f81474b1ab28744e9947836 | |
parent | c8718b60d17ce12ee77e5335f9c8074f4a19a02b (diff) |
thermal_hal: Add support to handle CPUs with non-sequential core_ids
Some targets support to have only selected cpu cores enabled and
in such cases, cpu ids will be in non-sequencial order.
Update logic to maintain cpu list with cpu counter instead of
cpu_id as list index.
Change-Id: If249f1ee0d0e8f5f0a2240c22b4fcfb136be4026
Signed-off-by: Gopala Krishna Nuthaki <quic_gnuthaki@quicinc.com>
-rw-r--r-- | thermalCommon.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/thermalCommon.cpp b/thermalCommon.cpp index 3f0c997..9c9d632 100644 --- a/thermalCommon.cpp +++ b/thermalCommon.cpp @@ -645,10 +645,10 @@ int ThermalCommon::get_cpu_usages(hidl_vec<CpuUsage>& list) { } fclose(cpu_file); - list[cpu_num].name = std::string("CPU") + std::to_string(cpu_num); - list[cpu_num].active = active; - list[cpu_num].total = total; - list[cpu_num].isOnline = online; + list[cpu].name = std::string("CPU") + std::to_string(cpu_num); + list[cpu].active = active; + list[cpu].total = total; + list[cpu].isOnline = online; cpu++; } fclose(file); |