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

Commit 504ed7de authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5147358 from 910c0aa1 to qt-release

Change-Id: I1a88704c6008d22176cc485412f0f239adb9bb7e
parents 8f7b7524 910c0aa1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -105,6 +105,8 @@ on late-init
    chmod 0666 /sys/kernel/tracing/events/mm_event/mm_event_record/enable
    chmod 0666 /sys/kernel/debug/tracing/events/lowmemorykiller/lowmemory_kill/enable
    chmod 0666 /sys/kernel/tracing/events/lowmemorykiller/lowmemory_kill/enable
    chmod 0666 /sys/kernel/debug/tracing/events/oom/oom_score_adj_update/enable
    chmod 0666 /sys/kernel/tracing/events/oom/oom_score_adj_update/enable

    # disk
    chmod 0666 /sys/kernel/tracing/events/f2fs/f2fs_get_data_block/enable
+1 −12
Original line number Diff line number Diff line
@@ -1100,7 +1100,7 @@ static void RunDumpsysProto(const std::string& title, int priority,
    }
}

// Runs dumpsys on services that must dump first and and will take less than 100ms to dump.
// Runs dumpsys on services that must dump first and will take less than 100ms to dump.
static void RunDumpsysCritical() {
    RunDumpsysText("DUMPSYS CRITICAL", IServiceManager::DUMP_FLAG_PRIORITY_CRITICAL,
                   /* timeout= */ 5s, /* service_timeout= */ 500ms);
@@ -1864,17 +1864,6 @@ static void FinalizeFile() {
            do_text_file = true;
        } else {
            do_text_file = false;
            // Since zip file is already created, it needs to be renamed.
            std::string new_path = ds.GetPath(".zip");
            if (ds.path_ != new_path) {
                MYLOGD("Renaming zip file from %s to %s\n", ds.path_.c_str(), new_path.c_str());
                if (rename(ds.path_.c_str(), new_path.c_str())) {
                    MYLOGE("rename(%s, %s): %s\n", ds.path_.c_str(), new_path.c_str(),
                           strerror(errno));
                } else {
                    ds.path_ = new_path;
                }
            }
        }
    }
    if (do_text_file) {
+1 −1
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ class Dumpstate {
                                        std::chrono::milliseconds timeout);

    /*
     * Adds a text entry entry to the existing zip file.
     * Adds a text entry to the existing zip file.
     */
    bool AddTextZipEntry(const std::string& entry_name, const std::string& content);

+1 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ filegroup {
        "Scheduler/DispSyncSource.cpp",
        "Scheduler/EventControlThread.cpp",
        "Scheduler/EventThread.cpp",
        "Scheduler/LayerHistory.cpp",
        "Scheduler/MessageQueue.cpp",
        "Scheduler/Scheduler.cpp",
        "StartPropertySetThread.cpp",
+49 −0
Original line number Diff line number Diff line
/*
 * Copyright 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "LayerHistory.h"

#include <cinttypes>
#include <cstdint>
#include <numeric>
#include <string>
#include <unordered_map>

#include <utils/Log.h>
#include <utils/Timers.h>
#include <utils/Trace.h>

namespace android {

LayerHistory::LayerHistory() {}

LayerHistory::~LayerHistory() = default;

void LayerHistory::insert(const std::string layerName, nsecs_t presentTime) {
    mElements[mCounter].insert(std::make_pair(layerName, presentTime));
}

void LayerHistory::incrementCounter() {
    mCounter++;
    mCounter = mCounter % ARRAY_SIZE;
    mElements[mCounter].clear();
}

const std::unordered_map<std::string, nsecs_t>& LayerHistory::get(size_t index) const {
    return mElements.at(index);
}

} // namespace android
 No newline at end of file
Loading