summaryrefslogtreecommitdiff
path: root/libhwc2.1/ExynosHWCDebug.cpp
diff options
context:
space:
mode:
authorWiwit Rifa'i <wiwitrifai@google.com>2022-01-26 11:48:07 +0800
committerWiwit Rifa'i <wiwitrifai@google.com>2022-03-24 20:33:39 +0800
commit75d18a2743f3a703bd225aab5cac54828719dabf (patch)
tree490ad15493800dd0a63c6aab8cf59345f5846460 /libhwc2.1/ExynosHWCDebug.cpp
parente99e2f48c694ab97c4d642cae22882e648051f99 (diff)
libhwc2.1: optimize & refine fence tracer
Prevent iterating all 1024 fence entries by maintaining the fences in a map. We also don't need to limit the fences up to 1024 anymore. This patch will also remove the spamming warning log of "fence (fd:%d) over MAX fd number" since we don't limit the number of traced fences anymore. Test: simpleperf Bug: 205901399 Bug: 201249391 Change-Id: I4e96eb7053dae24e3eeec88c9b74ca2b5f12714e
Diffstat (limited to 'libhwc2.1/ExynosHWCDebug.cpp')
-rw-r--r--libhwc2.1/ExynosHWCDebug.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/libhwc2.1/ExynosHWCDebug.cpp b/libhwc2.1/ExynosHWCDebug.cpp
index e3e3fe8..982a54d 100644
--- a/libhwc2.1/ExynosHWCDebug.cpp
+++ b/libhwc2.1/ExynosHWCDebug.cpp
@@ -109,17 +109,14 @@ int32_t saveFenceTrace(ExynosDisplay *display) {
struct timeval tv;
ExynosDevice *device = display->mDevice;
- hwc_fence_info_t* _info = device->mFenceInfo;
if (device != NULL) {
- for(int i=0; i<1024;i ++){
-
+ for (const auto &[i, info] : device->mFenceInfos) {
+#if 0
bool sysFdOpen = false;
- hwc_fence_info_t info = _info[i];
// FIXME: sync_fence_info and sync_pt_info are deprecated
// HWC guys should fix this
-#if 0
struct sync_pt_info* pt_info = NULL;
info.sync_data = sync_fence_info(i);
if (info.sync_data != NULL) {
@@ -137,9 +134,9 @@ int32_t saveFenceTrace(ExynosDisplay *display) {
sysFdOpen = true;
sync_fence_info_free(info.sync_data);
}
-#endif
if ((info.usage == 0) && !sysFdOpen) continue;
+#endif
saveString.appendFormat("\n-- FD hwc : %d, usage %d\n", i, info.usage);