sm6375-common: power-libperfmgr: ADPF: dump ADPF session info

Dump current ADPF profile and ADPF session list into bugreport.

Bug: 204444691
Test: adb root && adb shell dumpsys android.hardware.power.IPower/default
Test: gpaste/6469309887938560
Change-Id: I17c0d615051f5e51c2e1fe99d17c402f9a65679a
This commit is contained in:
jimmyshiu 2024-07-18 20:16:00 +05:30 committed by Anand S
commit 0118a38571
No known key found for this signature in database
GPG key ID: 3B2983FA448B3D61
5 changed files with 33 additions and 1 deletions

View file

@ -19,6 +19,7 @@
#include "PowerSessionManager.h"
#include <android-base/file.h>
#include <log/log.h>
#include <perfmgr/HintManager.h>
#include <processgroup/processgroup.h>
@ -201,6 +202,28 @@ void PowerSessionManager::handleMessage(const Message &) {
}
}
void PowerSessionManager::dumpToFd(int fd) {
std::ostringstream dump_buf;
std::lock_guard<std::mutex> guard(mLock);
dump_buf << "========== Begin PowerSessionManager ADPF list ==========\n";
for (PowerHintSession *s : mSessions) {
s->dumpToStream(dump_buf);
dump_buf << " Tid:Ref[";
for (size_t i = 0, len = s->getTidList().size(); i < len; i++) {
int t = s->getTidList()[i];
dump_buf << t << ":" << mTidSessionListMap[t].size();
if (i < len - 1) {
dump_buf << ", ";
}
}
dump_buf << "]\n";
}
dump_buf << "========== End PowerSessionManager ADPF list ==========\n";
if (!::android::base::WriteStringToFd(dump_buf.str(), fd)) {
ALOGE("Failed to dump one of session list to fd:%d", fd);
}
}
void PowerSessionManager::enableSystemTopAppBoost() {
if (HintManager::GetInstance()->IsHintSupported(kDisableBoostHintName)) {
ALOGV("PowerSessionManager::enableSystemTopAppBoost!!");