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

Commit 361ea97e authored by Raymond Chiu's avatar Raymond Chiu
Browse files

Output additional trace points for each frame

Test: ran systrace to see frames being tracked.

Change-Id: I87b5e852e3ac927e0df9685bbe58f5e8fe54b5a1
parent d73ce176
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -173,8 +173,8 @@ void TimeStats::flushAvailableRecordsToStatsLocked(int32_t layerID) {
        ALOGV("[%d]-[%" PRIu64 "]-presentFenceTime[%" PRId64 "]", layerID,
              timeRecords[0].frameTime.frameNumber, timeRecords[0].frameTime.presentTime);

        if (prevTimeRecord.ready) {
        const std::string& layerName = layerRecord.layerName;
        if (prevTimeRecord.ready) {
            if (!mTimeStats.stats.count(layerName)) {
                mTimeStats.stats[layerName].layerName = layerName;
                mTimeStats.stats[layerName].packageName = getPackageName(layerName);
@@ -220,6 +220,18 @@ void TimeStats::flushAvailableRecordsToStatsLocked(int32_t layerID) {
                  timeRecords[0].frameTime.frameNumber, presentToPresentMs);
            timeStatsLayer.deltas["present2present"].insert(presentToPresentMs);
        }

        // Output additional trace points to track frame time.
        ATRACE_INT64(("TimeStats-Post - " + layerName).c_str(), timeRecords[0].frameTime.postTime);
        ATRACE_INT64(("TimeStats-Acquire - " + layerName).c_str(),
                     timeRecords[0].frameTime.acquireTime);
        ATRACE_INT64(("TimeStats-Latch - " + layerName).c_str(),
                     timeRecords[0].frameTime.latchTime);
        ATRACE_INT64(("TimeStats-Desired - " + layerName).c_str(),
                     timeRecords[0].frameTime.desiredTime);
        ATRACE_INT64(("TimeStats-Present - " + layerName).c_str(),
                     timeRecords[0].frameTime.presentTime);

        prevTimeRecord = timeRecords[0];
        timeRecords.pop_front();
        layerRecord.waitData--;