sm6375-common: power-libperfmgr: Add better tracing for sendHint and refactor existing tracing

Reset traced hint value to -1 on reportActualWorkDuration or stale
timeout, and rewrite existing tracing for readability.

Bug: b/243973548
Test: manual
Change-Id: I135ec5f8971a9902d880e4089b0df746f5b917e2
This commit is contained in:
Matt Buckley 2024-07-18 20:16:00 +05:30 committed by Anand S
commit 3f3622d6be
No known key found for this signature in database
GPG key ID: 3B2983FA448B3D61
2 changed files with 56 additions and 88 deletions

View file

@ -109,13 +109,15 @@ class PowerHintSession : public BnPowerHintSession {
void updateUniveralBoostMode();
int setSessionUclampMin(int32_t min);
void tryToSendPowerHint(std::string hint);
std::string getIdString() const;
int64_t convertWorkDurationToBoostByPid(const std::vector<WorkDuration> &actualDurations);
void traceSessionVal(char const *identifier, int64_t val) const;
AppHintDesc *mDescriptor = nullptr;
sp<StaleTimerHandler> mStaleTimerHandler;
std::atomic<time_point<steady_clock>> mLastUpdatedTime;
sp<MessageHandler> mPowerManagerHandler;
std::mutex mSessionLock;
std::atomic<bool> mSessionClosed = false;
std::string mIdString;
// To cache the status of whether ADPF hints are supported.
std::unordered_map<std::string, std::optional<bool>> mSupportedHints;
};