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

Commit 2e1a9d88 authored by The Android Open Source Project's avatar The Android Open Source Project Committed by Xin Li
Browse files

Merge ab/7633965

Bug: 169893837
Merged-In: I2a2d02a0d7e67ee9577857a210cb6157683e5598
Change-Id: Iecdf0a17afe650483461978b42161940ce002101
parents a8f9cdbc 810d1937
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -126,7 +126,6 @@ static const TracingCategory k_categories[] = {
    { "aidl",       "AIDL calls",               ATRACE_TAG_AIDL, { } },
    { "nnapi",      "NNAPI",                    ATRACE_TAG_NNAPI, { } },
    { "rro",        "Runtime Resource Overlay", ATRACE_TAG_RRO, { } },
    { "sysprop",    "System Property",          ATRACE_TAG_SYSPROP, { } },
    { k_coreServiceCategory, "Core services", 0, { } },
    { k_pdxServiceCategory, "PDX services", 0, { } },
    { "sched",      "CPU Scheduling",   0, {
+12 −1
Original line number Diff line number Diff line
@@ -266,7 +266,10 @@ on late-init
    chmod 0666 /sys/kernel/debug/tracing/per_cpu/cpu15/trace
    chmod 0666 /sys/kernel/tracing/per_cpu/cpu15/trace

on post-fs-data
# Only create the tracing instance if persist.mm_events.enabled
# Attempting to remove the tracing instance after it has been created
# will likely fail with EBUSY as it would be in use by traced_probes.
on post-fs-data && property:persist.mm_events.enabled=true
# Create MM Events Tracing Instance for Kmem Activity Trigger
    mkdir /sys/kernel/debug/tracing/instances/mm_events 0755 system system
    mkdir /sys/kernel/tracing/instances/mm_events 0755 system system
@@ -275,10 +278,18 @@ on post-fs-data
    chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/buffer_size_kb
    chmod 0666 /sys/kernel/tracing/instances/mm_events/buffer_size_kb

# Set the default buffer size to the minimum
    write /sys/kernel/debug/tracing/instances/mm_events/buffer_size_kb 1
    write /sys/kernel/tracing/instances/mm_events/buffer_size_kb 1

# Read and enable tracing
    chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/tracing_on
    chmod 0666 /sys/kernel/tracing/instances/mm_events/tracing_on

# Tracing disabled by default
    write /sys/kernel/debug/tracing/instances/mm_events/tracing_on 0
    write /sys/kernel/tracing/instances/mm_events/tracing_on 0

# Read and truncate kernel trace
    chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/trace
    chmod 0666 /sys/kernel/tracing/instances/mm_events/trace
+13 −2
Original line number Diff line number Diff line
@@ -176,6 +176,7 @@ void add_mountinfo();
#define LINKERCONFIG_DIR "/linkerconfig"
#define PACKAGE_DEX_USE_LIST "/data/system/package-dex-usage.list"
#define SYSTEM_TRACE_SNAPSHOT "/data/misc/perfetto-traces/bugreport/systrace.pftrace"
#define CGROUPFS_DIR "/sys/fs/cgroup"

// TODO(narayan): Since this information has to be kept in sync
// with tombstoned, we should just put it in a common header.
@@ -1240,8 +1241,15 @@ static Dumpstate::RunStatus RunDumpsysTextByPriority(const std::string& title, i
        if (status == OK) {
            dumpsys.writeDumpHeader(STDOUT_FILENO, service, priority);
            std::chrono::duration<double> elapsed_seconds;
            if (priority == IServiceManager::DUMP_FLAG_PRIORITY_HIGH &&
                service == String16("meminfo")) {
                // Use a longer timeout for meminfo, since 30s is not always enough.
                status = dumpsys.writeDump(STDOUT_FILENO, service, 60s,
                                           /* as_proto = */ false, elapsed_seconds, bytes_written);
            } else {
                status = dumpsys.writeDump(STDOUT_FILENO, service, service_timeout,
                                           /* as_proto = */ false, elapsed_seconds, bytes_written);
            }
            dumpsys.writeDumpFooter(STDOUT_FILENO, service, elapsed_seconds);
            bool dump_complete = (status == OK);
            dumpsys.stopDumpThread(dump_complete);
@@ -1785,6 +1793,9 @@ static Dumpstate::RunStatus dumpstate() {
    // Add linker configuration directory
    ds.AddDir(LINKERCONFIG_DIR, true);

    /* Dump cgroupfs */
    ds.AddDir(CGROUPFS_DIR, true);

    if (ds.dump_pool_) {
        WAIT_TASK_WITH_CONSENT_CHECK(DUMP_INCIDENT_REPORT_TASK, ds.dump_pool_);
    } else {
+1 −2
Original line number Diff line number Diff line
@@ -342,8 +342,7 @@ static int restorecon_app_data_lazy(const std::string& path, const std::string&

    // If the initial top-level restorecon above changed the label, then go
    // back and restorecon everything recursively
    // TODO(b/190567190, b/188141923) Remove recursive fixup of com.google.android.gsf.
    if (strcmp(before, after) || (path.find("com.google.android.gsf") != std::string::npos)) {
    if (strcmp(before, after)) {
        if (existing) {
            LOG(DEBUG) << "Detected label change from " << before << " to " << after << " at "
                    << path << "; running recursive restorecon";
+15 −5
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@
#include <log/log.h>               // TODO: Move everything to base/logging.
#include <openssl/sha.h>
#include <private/android_filesystem_config.h>
#include <processgroup/sched_policy.h>
#include <processgroup/processgroup.h>
#include <selinux/android.h>
#include <server_configurable_flags/get_flags.h>
#include <system/thread_defs.h>
@@ -282,8 +282,8 @@ static bool ShouldUseSwapFileForDexopt() {

static void SetDex2OatScheduling(bool set_to_bg) {
    if (set_to_bg) {
        if (set_sched_policy(0, SP_BACKGROUND) < 0) {
            PLOG(ERROR) << "set_sched_policy failed";
        if (!SetTaskProfiles(0, {"Dex2OatBootComplete"})) {
            LOG(ERROR) << "Failed to set dex2oat task profile";
            exit(DexoptReturnCodes::kSetSchedPolicy);
        }
        if (setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_BACKGROUND) < 0) {
@@ -1231,6 +1231,14 @@ class RunDexoptAnalyzer : public ExecVHelper {
            }
        }

        // On-device signing related. odsign sets the system property odsign.verification.success if
        // AOT artifacts have the expected signatures.
        const bool trust_art_apex_data_files =
                ::android::base::GetBoolProperty("odsign.verification.success", false);
        if (!trust_art_apex_data_files) {
            AddRuntimeArg("-Xdeny-art-apex-data-files");
        }

        PrepareArgs(dexoptanalyzer_bin);
    }

@@ -1363,10 +1371,12 @@ static SecondaryDexAccess check_secondary_dex_access(const std::string& dex_path
        return kSecondaryDexAccessReadOk;
    } else {
        if (errno == ENOENT) {
            LOG(INFO) << "Secondary dex does not exist: " <<  dex_path;
            async_safe_format_log(ANDROID_LOG_INFO, LOG_TAG,
                    "Secondary dex does not exist: %s", dex_path.c_str());
            return kSecondaryDexAccessDoesNotExist;
        } else {
            PLOG(ERROR) << "Could not access secondary dex " << dex_path;
            async_safe_format_log(ANDROID_LOG_ERROR, LOG_TAG,
                    "Could not access secondary dex: %s (%d)", dex_path.c_str(), errno);
            return errno == EACCES
                ? kSecondaryDexAccessPermissionError
                : kSecondaryDexAccessIOError;
Loading