powerstats: sort frequencies in descending order
Cpufreq data is sorted in ascending order, but power stats are sorted in descending order. Reverse sorting to maintain consistency with other power stats. Bug: 317429309 Test: vts-tradefed run vts -m VtsHalPowerStatsTargetTest Change-Id: I29a58c02add846eb66a8d6eb247336111363c335 Signed-off-by: Darren Hsu <darrenhsu@google.com>
This commit is contained in:
parent
375b7e13c8
commit
e3e46d4de9
1 changed files with 8 additions and 0 deletions
|
@ -62,6 +62,14 @@ AdaptiveDvfsStateResidencyDataProvider::AdaptiveDvfsStateResidencyDataProvider(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cpufreq data is sorted in ascending order, but power stats are sorted
|
||||||
|
// in descending order. Reverse sorting to maintain consistency with
|
||||||
|
// other power stats.
|
||||||
|
if (states.size() > 1 &&
|
||||||
|
std::atoll(states[0].second.c_str()) < std::atoll(states[1].second.c_str())) {
|
||||||
|
std::reverse(states.begin(), states.end());
|
||||||
|
}
|
||||||
|
|
||||||
mPowerEntities.push_back({powerEntities[i].first, std::move(states)});
|
mPowerEntities.push_back({powerEntities[i].first, std::move(states)});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue