diff options
author | Wiwit Rifa'i <wiwitrifai@google.com> | 2023-08-29 15:11:12 +0800 |
---|---|---|
committer | Wiwit Rifa'i <wiwitrifai@google.com> | 2023-09-05 15:32:45 +0800 |
commit | afbc2293eb633e0dbfac32d8e4ef712fc6aa94b8 (patch) | |
tree | a03e96f23359ec42ffe2f40432c98ff4b963859f | |
parent | 237752a978a1b06a880ae01e323bfa2aef6c188a (diff) | |
download | zuma-afbc2293eb633e0dbfac32d8e4ef712fc6aa94b8.tar.gz |
libhwc2.1: don't construct string if debug log is disabled
In ExynosResourceManagerModule::otfMppReordering, we still construct the
debug string even though it's not used because the debug log is disabled
by default. So, we should only construct the debug string if the debug
log is enabled.
Bug: 295892886
Test: trigger assignResource using hwc-tester & check simpleperf
Test: adb shell vndservice call Exynos.HWCService 105 i32 16777216
Change-Id: Id319a2e8ac0a762f0da924597bf6b5763b839655
-rw-r--r-- | libhwc2.1/libresource/ExynosResourceManagerModule.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libhwc2.1/libresource/ExynosResourceManagerModule.cpp b/libhwc2.1/libresource/ExynosResourceManagerModule.cpp index afb5efd..c2befbd 100644 --- a/libhwc2.1/libresource/ExynosResourceManagerModule.cpp +++ b/libhwc2.1/libresource/ExynosResourceManagerModule.cpp @@ -574,13 +574,15 @@ int32_t ExynosResourceManagerModule::otfMppReordering(ExynosDisplay *display, std::sort(otfMPPs.begin(), otfMPPs.end(), orderPolicy); - String8 after; - for (uint32_t i = 0; i < otfMPPs.size(); i++) { - ExynosMPPModule *mpp = (ExynosMPPModule *)otfMPPs[i]; - after.appendFormat("%s) ->", mpp->mName.string()); - } + if (hwcCheckDebugMessages(eDebugLoadBalancing)) { + String8 after; + for (uint32_t i = 0; i < otfMPPs.size(); i++) { + ExynosMPPModule *mpp = (ExynosMPPModule *)otfMPPs[i]; + after.appendFormat("(%s) -> ", mpp->mName.string()); + } - HDEBUGLOGD(eDebugLoadBalancing, "%s %p, %s", __func__, src.bufferHandle, after.string()); + ALOGD("%s %p, %s", __func__, src.bufferHandle, after.string()); + } return 0; } |