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

Commit 0d1014c9 authored by David Sehr's avatar David Sehr Committed by Andreas Gampe
Browse files

Add system option to disable lock profiling

Disable lock profiling to test for overhead.

(cherry picked from commit 26a6427c)

Bug: 133257467
Test: build
Merged-In: Ida5f83e626c82266de69b13dc2def0477cc87b0f
Change-Id: Ida5f83e626c82266de69b13dc2def0477cc87b0f
parent fb9843f8
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -250,6 +250,11 @@ static const char* ENABLE_APEX_IMAGE = "enable_apex_image";
// Flag to pass to the runtime when using the apex image.
static const char* kApexImageOption = "-Ximage:/system/framework/apex.art";

// Feature flag name for disabling lock profiling.
static const char* DISABLE_LOCK_PROFILING = "disable_lock_profiling";
// Runtime option disabling lock profiling.
static const char* kLockProfThresholdRuntimeOption = "-Xlockprofthreshold:0";

static AndroidRuntime* gCurRuntime = NULL;

/*
@@ -698,6 +703,17 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote)
        ALOGI("Using default boot image");
    }

    std::string disable_lock_profiling =
        server_configurable_flags::GetServerConfigurableFlag(RUNTIME_NATIVE_BOOT_NAMESPACE,
                                                             DISABLE_LOCK_PROFILING,
                                                             /*default_value=*/ "");
    if (disable_lock_profiling == "true") {
        addOption(kLockProfThresholdRuntimeOption);
        ALOGI("Disabling lock profiling: '%s'\n", kLockProfThresholdRuntimeOption);
    } else {
        ALOGI("Leaving lock profiling enabled");
    }

    bool checkJni = false;
    property_get("dalvik.vm.checkjni", propBuf, "");
    if (strcmp(propBuf, "true") == 0) {