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

Commit 82af73a6 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-ccd04736-6e66-4825-a227-ecd69d8b5337-for-git_oc-mr1-release-41...

release-request-ccd04736-6e66-4825-a227-ecd69d8b5337-for-git_oc-mr1-release-4163697 snap-temp-L79500000080559163

Change-Id: I7a7f0b9ba205f802f892a5025751bdca0fc83ce7
parents f4994098 7cd6d937
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -14,3 +14,9 @@ subdirs = [
    "services/*",
    "vulkan",
]

cc_library_headers {
    name: "libandroid_sensor_headers",
    vendor: true,
    export_include_dirs: ["include_sensor"],
}
+3 −0
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@ cc_binary {
        "libz",
        "libbase",
    ],
    static_libs: [
        "libpdx_default_transport",
    ],

    init_rc: ["atrace.rc"],

+22 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#include <android/hidl/manager/1.0/IServiceManager.h>
#include <hidl/ServiceManagement.h>

#include <pdx/default_transport/service_utility.h>
#include <utils/String8.h>
#include <utils/Timers.h>
#include <utils/Tokenizer.h>
@@ -50,6 +51,7 @@
#include <android-base/stringprintf.h>

using namespace android;
using pdx::default_transport::ServiceUtility;

using std::string;

@@ -61,6 +63,7 @@ const char* k_traceTagsProperty = "debug.atrace.tags.enableflags";
const char* k_traceAppsNumberProperty = "debug.atrace.app_number";
const char* k_traceAppsPropertyTemplate = "debug.atrace.app_%d";
const char* k_coreServiceCategory = "core_services";
const char* k_pdxServiceCategory = "pdx";
const char* k_coreServicesProp = "ro.atrace.core.services";

typedef enum { OPT, REQ } requiredness  ;
@@ -114,6 +117,7 @@ static const TracingCategory k_categories[] = {
    { "network",    "Network",          ATRACE_TAG_NETWORK, { } },
    { "adb",        "ADB",              ATRACE_TAG_ADB, { } },
    { k_coreServiceCategory, "Core services", 0, { } },
    { k_pdxServiceCategory, "PDX services", 0, { } },
    { "sched",      "CPU Scheduling",   0, {
        { REQ,      "events/sched/sched_switch/enable" },
        { REQ,      "events/sched/sched_wakeup/enable" },
@@ -210,6 +214,7 @@ static const char* g_debugAppCmdLine = "";
static const char* g_outputFile = nullptr;

/* Global state */
static bool g_tracePdx = false;
static bool g_traceAborted = false;
static bool g_categoryEnables[arraysize(k_categories)] = {};
static std::string g_traceFolder;
@@ -369,6 +374,10 @@ static bool isCategorySupported(const TracingCategory& category)
        return !android::base::GetProperty(k_coreServicesProp, "").empty();
    }

    if (strcmp(category.name, k_pdxServiceCategory) == 0) {
        return true;
    }

    bool ok = category.tags != 0;
    for (int i = 0; i < MAX_SYS_FILES; i++) {
        const char* path = category.sysfiles[i].path;
@@ -791,6 +800,11 @@ static bool setUpTrace()
        if (strcmp(k_categories[i].name, k_coreServiceCategory) == 0) {
            coreServicesTagEnabled = g_categoryEnables[i];
        }

        // Set whether to poke PDX services in this session.
        if (strcmp(k_categories[i].name, k_pdxServiceCategory) == 0) {
            g_tracePdx = g_categoryEnables[i];
        }
    }

    std::string packageList(g_debugAppCmdLine);
@@ -804,6 +818,10 @@ static bool setUpTrace()
    ok &= pokeBinderServices();
    pokeHalServices();

    if (g_tracePdx) {
        ok &= ServiceUtility::PokeServices();
    }

    // Disable all the sysfs enables.  This is done as a separate loop from
    // the enables to allow the same enable to exist in multiple categories.
    ok &= disableKernelTraceEvents();
@@ -841,6 +859,10 @@ static void cleanUpTrace()
    clearAppProperties();
    pokeBinderServices();

    if (g_tracePdx) {
        ServiceUtility::PokeServices();
    }

    // Set the options back to their defaults.
    setTraceOverwriteEnable(true);
    setTraceBufferSizeKB(1);
+14 −0
Original line number Diff line number Diff line
@@ -1641,6 +1641,7 @@ binder::Status InstalldNativeService::getExternalSize(const std::unique_ptr<std:
    int64_t videoSize = 0;
    int64_t imageSize = 0;
    int64_t appSize = 0;
    int64_t obbSize = 0;

    auto device = findQuotaDeviceForUuid(uuid);
    if (device.empty()) {
@@ -1688,6 +1689,13 @@ binder::Status InstalldNativeService::getExternalSize(const std::unique_ptr<std:
#endif
            imageSize = dq.dqb_curspace;
        }
        if (quotactl(QCMD(Q_GETQUOTA, GRPQUOTA), device.c_str(), AID_MEDIA_OBB,
                reinterpret_cast<char*>(&dq)) == 0) {
#if MEASURE_DEBUG
            LOG(DEBUG) << "quotactl() for GID " << AID_MEDIA_OBB << " " << dq.dqb_curspace;
#endif
            obbSize = dq.dqb_curspace;
        }
        ATRACE_END();

        ATRACE_BEGIN("apps");
@@ -1744,6 +1752,11 @@ binder::Status InstalldNativeService::getExternalSize(const std::unique_ptr<std:
        }
        fts_close(fts);
        ATRACE_END();

        ATRACE_BEGIN("obb");
        auto obbPath = create_data_media_obb_path(uuid_, "");
        calculate_tree_size(obbPath, &obbSize);
        ATRACE_END();
    }

    std::vector<int64_t> ret;
@@ -1752,6 +1765,7 @@ binder::Status InstalldNativeService::getExternalSize(const std::unique_ptr<std:
    ret.push_back(videoSize);
    ret.push_back(imageSize);
    ret.push_back(appSize);
    ret.push_back(obbSize);
#if MEASURE_DEBUG
    LOG(DEBUG) << "Final result " << toString(ret);
#endif
+0 −4
Original line number Diff line number Diff line
@@ -753,10 +753,6 @@ private:
    }

    static const char* ParseNull(const char* arg) {
        // b/38186355. Revert soon.
        if (strcmp(arg, "!null") == 0) {
            return nullptr;
        }
        return (strcmp(arg, "!") == 0) ? nullptr : arg;
    }

Loading