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

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

release-request-e32f3567-b299-4433-aaca-18a62b3f00c0-for-git_oc-dr1-release-39...

release-request-e32f3567-b299-4433-aaca-18a62b3f00c0-for-git_oc-dr1-release-3964195 snap-temp-L52500000059616409

Change-Id: Ie2fc86b5170145797c457d924363e3e52cff59ce
parents d80af014 c9c0075b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@ cc_binary {
    shared_libs: [
        "libbinder",
        "libhwbinder",
        "android.hidl.manager@1.0",
        "libhidlbase",
        "libhidltransport",
        "liblog",
+33 −9
Original line number Diff line number Diff line
@@ -448,8 +448,8 @@ static bool isTraceClock(const char *mode)
        return false;
    }

    char buf[4097];
    ssize_t n = read(fd, buf, 4096);
    char buf[100];
    ssize_t n = read(fd, buf, 99);
    close(fd);
    if (n == -1) {
        fprintf(stderr, "error reading %s: %s (%d)\n", k_traceClockPath,
@@ -473,13 +473,38 @@ static bool isTraceClock(const char *mode)
    return strcmp(mode, start) == 0;
}

// Enable or disable the kernel's use of the global clock.  Disabling the global
// clock will result in the kernel using a per-CPU local clock.
// Read the trace_clock sysfs file and return true if it contains the requested
// value.  The trace_clock file format is:
// local [global] counter uptime perf
static bool traceClockContains(const char *mode)
{
    int fd = open((g_traceFolder + k_traceClockPath).c_str(), O_RDONLY);
    if (fd == -1) {
        fprintf(stderr, "error opening %s: %s (%d)\n", k_traceClockPath,
            strerror(errno), errno);
        return false;
    }

    char buf[100];
    ssize_t n = read(fd, buf, 99);
    close(fd);
    if (n == -1) {
        fprintf(stderr, "error reading %s: %s (%d)\n", k_traceClockPath,
            strerror(errno), errno);
        return false;
    }
    buf[n] = '\0';

    return strstr(buf, mode) != NULL;
}

// Set the clock to the best available option while tracing. Use 'boot' if it's
// available; otherwise, use 'mono'.
// Any write to the trace_clock sysfs file will reset the buffer, so only
// update it if the requested value is not the current value.
static bool setGlobalClockEnable(bool enable)
static bool setClock()
{
    const char *clock = enable ? "global" : "local";
    const char* clock = traceClockContains("boot") ? "boot" : "mono";

    if (isTraceClock(clock)) {
        return true;
@@ -778,7 +803,7 @@ static bool setUpTrace()
    ok &= setCategoriesEnableFromFile(g_categoriesFile);
    ok &= setTraceOverwriteEnable(g_traceOverwrite);
    ok &= setTraceBufferSizeKB(g_traceBufferSizeKB);
    ok &= setGlobalClockEnable(true);
    ok &= setClock();
    ok &= setPrintTgidEnableIfPresent(true);
    ok &= setKernelTraceFuncs(g_kernelTraceFuncs);

@@ -852,7 +877,6 @@ static void cleanUpTrace()
    // Set the options back to their defaults.
    setTraceOverwriteEnable(true);
    setTraceBufferSizeKB(1);
    setGlobalClockEnable(false);
    setPrintTgidEnableIfPresent(false);
    setKernelTraceFuncs(NULL);
}
@@ -1208,7 +1232,7 @@ int main(int argc, char **argv)

    if (ok && traceStart) {
        if (!traceStream) {
            printf("capturing trace...");
            printf("capturing trace...\n");
            fflush(stdout);
        }

+4 −0
Original line number Diff line number Diff line
@@ -124,6 +124,10 @@ on post-fs
    write /sys/kernel/debug/tracing/tracing_on 0
    write /sys/kernel/tracing/tracing_on 0

    # Set the trace clock to boot if it exists, falling back to mono if not.
    write /d/tracing/trace_clock mono
    write /d/tracing/trace_clock boot

# Allow only the shell group to read and truncate the kernel trace.
    chown root shell /sys/kernel/debug/tracing/trace
    chown root shell /sys/kernel/tracing/trace
+2 −2
Original line number Diff line number Diff line
@@ -321,11 +321,11 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd

    bool have_dex2oat_compiler_filter_flag;
    if (skip_compilation) {
        strcpy(dex2oat_compiler_filter_arg, "--compiler-filter=verify-none");
        strcpy(dex2oat_compiler_filter_arg, "--compiler-filter=extract");
        have_dex2oat_compiler_filter_flag = true;
        have_dex2oat_relocation_skip_flag = true;
    } else if (vm_safe_mode) {
        strcpy(dex2oat_compiler_filter_arg, "--compiler-filter=interpret-only");
        strcpy(dex2oat_compiler_filter_arg, "--compiler-filter=quicken");
        have_dex2oat_compiler_filter_flag = true;
    } else if (compiler_filter != nullptr &&
            strlen(compiler_filter) + strlen("--compiler-filter=") <
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ cc_binary {
        "libhidltransport",
        "libhidl-gen-utils",
        "libvintf",
        "android.hidl.manager@1.0",
    ],
    srcs: [
        "Lshal.cpp",
Loading