Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47fe4cac authored by Yiwei Zhang's avatar Yiwei Zhang Committed by Android (Google) Code Review
Browse files

Merge "SF TimeStats: change the container of TimeRecord" into pi-dev

parents f43eaab7 c5f2c455
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ void TimeStats::flushAvailableRecordsToStatsLocked(const std::string& layerName)

    LayerRecord& layerRecord = timeStatsTracker[layerName];
    TimeRecord& prevTimeRecord = layerRecord.prevTimeRecord;
    std::vector<TimeRecord>& timeRecords = layerRecord.timeRecords;
    std::deque<TimeRecord>& timeRecords = layerRecord.timeRecords;
    while (!timeRecords.empty()) {
        if (!recordReadyLocked(layerName, &timeRecords[0])) break;
        ALOGV("[%s]-[%" PRIu64 "]-presentFenceTime[%" PRId64 "]", layerName.c_str(),
@@ -199,8 +199,7 @@ void TimeStats::flushAvailableRecordsToStatsLocked(const std::string& layerName)
            timeStats.stats[layerName].statsEnd = static_cast<int64_t>(std::time(0));
        }
        prevTimeRecord = timeRecords[0];
        // TODO(zzyiwei): change timeRecords to use std::deque
        timeRecords.erase(timeRecords.begin());
        timeRecords.pop_front();
        layerRecord.waitData--;
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -25,9 +25,9 @@
#include <utils/String8.h>
#include <utils/Vector.h>

#include <deque>
#include <mutex>
#include <unordered_map>
#include <vector>

using namespace android::surfaceflinger;

@@ -57,7 +57,7 @@ class TimeStats {
        // fences to signal, but rather waiting to receive those fences/timestamps.
        int32_t waitData = -1;
        TimeRecord prevTimeRecord;
        std::vector<TimeRecord> timeRecords;
        std::deque<TimeRecord> timeRecords;
    };

public: