From 445137072b1e792d2ca825c62a9d6186c2afd76a Mon Sep 17 00:00:00 2001 From: Jimmy Shiu Date: Mon, 18 Oct 2021 10:02:28 +0800 Subject: [PATCH] power: ADPF: fix stale trace status Bug: 196192645 Test: Manual Change-Id: Ibdbb8f47a16032ce3249aa667fa0c11e7869748f --- aidl/power-libperfmgr/PowerHintSession.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aidl/power-libperfmgr/PowerHintSession.cpp b/aidl/power-libperfmgr/PowerHintSession.cpp index 3db6ea1..359fcc3 100644 --- a/aidl/power-libperfmgr/PowerHintSession.cpp +++ b/aidl/power-libperfmgr/PowerHintSession.cpp @@ -146,6 +146,8 @@ PowerHintSession::PowerHintSession(int32_t tgid, int32_t uid, const std::vector< ATRACE_INT(sz.c_str(), (int64_t)mDescriptor->duration.count()); sz = StringPrintf("adpf.%s-active", idstr.c_str()); ATRACE_INT(sz.c_str(), mDescriptor->is_active.load()); + sz = StringPrintf("adpf.%s-stale", idstr.c_str()); + ATRACE_INT(sz.c_str(), isStale()); } PowerSessionManager::getInstance()->addPowerSession(this); // init boost @@ -443,6 +445,11 @@ void PowerHintSession::StaleHandler::updateStaleTimer() { duration_cast(next - now).count(), this, NULL); mIsMonitoringStale.store(true); } + if (ATRACE_ENABLED()) { + const std::string idstr = mSession->getIdString(); + std::string sz = StringPrintf("adpf.%s-stale", idstr.c_str()); + ATRACE_INT(sz.c_str(), 0); + } } }