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

Commit 71ae4557 authored by Orion Hodson's avatar Orion Hodson
Browse files

installd: add dex2oat cpu-set system properties

The naming for these follows the convention of the dex2oat-*thread
system properties:

 dalvik.vm.dex2oat-cpu-set [default compiler thread affinity]
 dalvik.vm.boot-dex2oat-cpu-set [compiler thread affinity for boot]
 dalvik.vm.image-dex2oat-cpu-set [thread affinity recompiling the boot image]

Bug: 141446571
Bug: 149395059
Test: add cpu-set properties to target/product/sdk_phone_x86.mk;
Test: lunch sdk_phone_x86-userdebug; m; emulator &
Test: atest -s emulator-5554 --test-mapping frameworks/native/cmds/installd:presubmit
Change-Id: Ic0d452fd1f2a9f94a55c39715111728b8104822a
Merged-In: Ic0d452fd1f2a9f94a55c39715111728b8104822a
(cherry picked from commit 45837466)
parent eab94c8f
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -336,6 +336,10 @@ class RunDex2Oat : public ExecVHelper {
                ? "dalvik.vm.dex2oat-threads"
                ? "dalvik.vm.dex2oat-threads"
                : "dalvik.vm.boot-dex2oat-threads";
                : "dalvik.vm.boot-dex2oat-threads";
        std::string dex2oat_threads_arg = MapPropertyToArg(threads_property, "-j%s");
        std::string dex2oat_threads_arg = MapPropertyToArg(threads_property, "-j%s");
        const char* cpu_set_property = post_bootcomplete
                ? "dalvik.vm.dex2oat-cpu-set"
                : "dalvik.vm.boot-dex2oat-cpu-set";
        std::string dex2oat_cpu_set_arg = MapPropertyToArg(cpu_set_property, "--cpu-set=%s");


        std::string bootclasspath;
        std::string bootclasspath;
        char* dex2oat_bootclasspath = getenv("DEX2OATBOOTCLASSPATH");
        char* dex2oat_bootclasspath = getenv("DEX2OATBOOTCLASSPATH");
@@ -507,6 +511,7 @@ class RunDex2Oat : public ExecVHelper {
        AddArg(image_block_size_arg);
        AddArg(image_block_size_arg);
        AddArg(dex2oat_compiler_filter_arg);
        AddArg(dex2oat_compiler_filter_arg);
        AddArg(dex2oat_threads_arg);
        AddArg(dex2oat_threads_arg);
        AddArg(dex2oat_cpu_set_arg);
        AddArg(dex2oat_swap_fd);
        AddArg(dex2oat_swap_fd);
        AddArg(dex2oat_image_fd);
        AddArg(dex2oat_image_fd);


+4 −0
Original line number Original line Diff line number Diff line
@@ -478,6 +478,10 @@ private:
                "-j",
                "-j",
                false,
                false,
                cmd);
                cmd);
        AddCompilerOptionFromSystemProperty("dalvik.vm.image-dex2oat-cpu-set",
                "--cpu-set=",
                false,
                cmd);
        AddCompilerOptionFromSystemProperty(
        AddCompilerOptionFromSystemProperty(
                StringPrintf("dalvik.vm.isa.%s.variant", isa).c_str(),
                StringPrintf("dalvik.vm.isa.%s.variant", isa).c_str(),
                "--instruction-set-variant=",
                "--instruction-set-variant=",