runtime_options.def revision 9724c636467d56632a45fdf6353e3d57d1925501
1aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin/*
2aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * Copyright (C) 2015 The Android Open Source Project
3aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin *
4aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * Licensed under the Apache License, Version 2.0 (the "License")
5aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * you may not use this file except in compliance with the License.
6aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * You may obtain a copy of the License at
7aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin *
8aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin *      http://www.apache.org/licenses/LICENSE-2.0
9aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin *
10aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * Unless required by applicable law or agreed to in writing, software
11aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * distributed under the License is distributed on an "AS IS" BASIS,
12aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * See the License for the specific language governing permissions and
14aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * limitations under the License.
15aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin */
16aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin
17aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin#ifndef RUNTIME_OPTIONS_KEY
18aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin#error "Please #define RUNTIME_OPTIONS_KEY before #including this file"
19aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin#define RUNTIME_OPTIONS_KEY(...)  // Don't display errors in this file in IDEs.
20aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin#endif
21aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin
22aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// This file defines the list of keys for RuntimeOptions.
23aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// These can be used with RuntimeOptions.Get/Set/etc, for example:
24aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin//         RuntimeOptions opt; bool* dex2oat_enabled = opt.Get(RuntimeOptions::Dex2Oat);
25aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin//
26aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// Column Descriptions:
27aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin//                   <<Type>>             <<Key Name>>                  <<Default Value>>
28aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin//
29aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// Default values are only used by Map::GetOrDefault(K<T>).
30aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// If a default value is omitted here, T{} is used as the default value, which is
31aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// almost-always the value of the type as if it was memset to all 0.
32aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin//
33c449e8b79aaaf156ce055524c41474cc1200ed5aIgor Murashkin// Please keep the columns aligned if possible when adding new rows.
34c449e8b79aaaf156ce055524c41474cc1200ed5aIgor Murashkin//
35aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin
36aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// Parse-able keys from the command line.
37aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit,                Zygote)
38aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit,                Help)
39aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit,                ShowVersion)
40aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string,         BootClassPath)
41aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (ParseStringList<':'>,BootClassPathLocations)  // std::vector<std::string>
42aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string,         ClassPath)
43aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string,         Image)
44aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit,                CheckJni)
45aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit,                JniOptsForceCopy)
46aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (JDWP::JdwpOptions,   JdwpOptions)
47aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MemoryKiB,           MemoryMaximumSize,              gc::Heap::kDefaultMaximumSize)  // -Xmx
48aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MemoryKiB,           MemoryInitialSize,              gc::Heap::kDefaultInitialSize)  // -Xms
49aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MemoryKiB,           HeapGrowthLimit)                // Default is 0 for unlimited
50aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MemoryKiB,           HeapMinFree,                    gc::Heap::kDefaultMinFree)
51aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MemoryKiB,           HeapMaxFree,                    gc::Heap::kDefaultMaxFree)
52aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MemoryKiB,           NonMovingSpaceCapacity,         gc::Heap::kDefaultNonMovingSpaceCapacity)
53aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (double,              HeapTargetUtilization,          gc::Heap::kDefaultTargetUtilization)
54aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (double,              ForegroundHeapGrowthMultiplier, gc::Heap::kDefaultHeapGrowthMultiplier)
5510d6886c9ce3ed87431cf10d376a69c23950fa61Mathieu ChartierRUNTIME_OPTIONS_KEY (unsigned int,        ParallelGCThreads,              0u)
56aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (unsigned int,        ConcGCThreads)
57aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Memory<1>,           StackSize)  // -Xss
58aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (unsigned int,        MaxSpinsBeforeThinLockInflation,Monitor::kDefaultMaxSpinsBeforeThinLockInflation)
59aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
60aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                          LongPauseLogThreshold,          gc::Heap::kDefaultLongPauseLogThreshold)
61aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
62aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                          LongGCLogThreshold,             gc::Heap::kDefaultLongGCLogThreshold)
63aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit,                DumpGCPerformanceOnShutdown)
64a4885cbaafd35fe9c60eb6cd95e41e2c86f54f66Mathieu ChartierRUNTIME_OPTIONS_KEY (Unit,                DumpJITInfoOnShutdown)
65aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit,                IgnoreMaxFootprint)
66aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit,                LowMemoryMode)
6749b7134f29439326d3d20bfea7bfde0e360c320cHiroshi YamauchiRUNTIME_OPTIONS_KEY (bool,                UseTLAB,                        (kUseTlab || kUseReadBarrier))
68aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (bool,                EnableHSpaceCompactForOOM,      true)
69e722d2921615102941ca4b6717c9d9e1edae1192Nicolas GeoffrayRUNTIME_OPTIONS_KEY (bool,                UseJIT,                         false)
70c449e8b79aaaf156ce055524c41474cc1200ed5aIgor MurashkinRUNTIME_OPTIONS_KEY (unsigned int,        JITCompileThreshold,            jit::Jit::kDefaultCompileThreshold)
715550ca8bcc742b109d77e62f3a0877c667d894d3Nicolas GeoffrayRUNTIME_OPTIONS_KEY (unsigned int,        JITWarmupThreshold,             jit::Jit::kDefaultWarmupThreshold)
720a3be1620a3560253cfa789cb9819013293c5654Nicolas GeoffrayRUNTIME_OPTIONS_KEY (MemoryKiB,           JITCodeCacheInitialCapacity,    jit::JitCodeCache::kInitialCapacity)
730a3be1620a3560253cfa789cb9819013293c5654Nicolas GeoffrayRUNTIME_OPTIONS_KEY (MemoryKiB,           JITCodeCacheMaxCapacity,        jit::JitCodeCache::kMaxCapacity)
7431f2c155975c5794d481df03eb0947cb48d2c6b5Calin JuravleRUNTIME_OPTIONS_KEY (bool,                JITSaveProfilingInfo,           false)
75aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
76aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                          HSpaceCompactForOOMMinIntervalsMs,\
77aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                                                          MsToNs(100 * 1000))  // 100s
78aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::vector<std::string>, \
79aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                          PropertiesList)  // -D<whatever> -D<whatever> ...
80aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string,         JniTrace)
81aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string,         PatchOat)
82aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (bool,                Relocate,                       kDefaultMustRelocate)
83e722d2921615102941ca4b6717c9d9e1edae1192Nicolas GeoffrayRUNTIME_OPTIONS_KEY (bool,                Dex2Oat,                        true)
84aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (bool,                ImageDex2Oat,                   true)
850d5a281c671444bfa75d63caf1427a8c0e6e1177Roland LevillainRUNTIME_OPTIONS_KEY (bool,                Interpret,                      false) // -Xint
86aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                                        // Disable the compiler for CC (for now).
87aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (XGcOption,           GcOption)  // -Xgc:
88aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (gc::space::LargeObjectSpaceType, \
89aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                          LargeObjectSpace,               gc::Heap::kDefaultLargeObjectSpaceType)
90aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Memory<1>,           LargeObjectThreshold,           gc::Heap::kDefaultLargeObjectThreshold)
91aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (BackgroundGcOption,  BackgroundGc)
92aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin
93aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit,                DisableExplicitGC)
9401aaf6ef3e3e35cc8e41cf3fe899a7bf337042f4Calin JuravleRUNTIME_OPTIONS_KEY (Unit,                NoSigChain)
95aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (LogVerbosity,        Verbose)
96aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (unsigned int,        LockProfThreshold)
97aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string,         StackTraceFile)
98aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit,                MethodTrace)
99f83e733618066e3c672c9a7ee872a3bba8202e7fCalin JuravleRUNTIME_OPTIONS_KEY (std::string,         MethodTraceFile,                "/data/misc/trace/method-trace-file.bin")
100aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (unsigned int,        MethodTraceFileSize,            10 * MB)
10140da286d3207d88ed8ff3f5caac4873874603428Andreas GampeRUNTIME_OPTIONS_KEY (Unit,                MethodTraceStreaming)
102aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (TraceClockSource,    ProfileClock,                   kDefaultTraceClockSource)  // -Xprofile:
103aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (TestProfilerOptions, ProfilerOpts)  // -Xenable-profiler, -Xprofile-*
104aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string,         Compiler)
105aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::vector<std::string>, \
106aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                          CompilerOptions)  // -Xcompiler-option ...
107aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::vector<std::string>, \
108aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                          ImageCompilerOptions)  // -Ximage-compiler-option ...
1097617abdb402fd0419daa3eefb2ad059ccbb8b6dbIgor MurashkinRUNTIME_OPTIONS_KEY (verifier::VerifyMode, \
1107617abdb402fd0419daa3eefb2ad059ccbb8b6dbIgor Murashkin                                          Verify,                         verifier::VerifyMode::kEnable)
111aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string,         NativeBridge)
112c449e8b79aaaf156ce055524c41474cc1200ed5aIgor MurashkinRUNTIME_OPTIONS_KEY (unsigned int,        ZygoteMaxFailedBoots,           10)
113c449e8b79aaaf156ce055524c41474cc1200ed5aIgor MurashkinRUNTIME_OPTIONS_KEY (Unit,                NoDexFileFallback)
114785049f8083e56e88dfeab5ff74fb3817f9854e3Dmitriy IvanovRUNTIME_OPTIONS_KEY (std::string,         CpuAbiList)
115dd6712578b6aa8a292bc6249295b6d2a7b182717Andreas GampeRUNTIME_OPTIONS_KEY (std::string,         Fingerprint)
1169724c636467d56632a45fdf6353e3d57d1925501Neil FullerRUNTIME_OPTIONS_KEY (ExperimentalFlags,   Experimental,     ExperimentalFlags::kNone) // -Xexperimental:{none, lambdas}
117aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin
118aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// Not parse-able from command line, but can be provided explicitly.
119c449e8b79aaaf156ce055524c41474cc1200ed5aIgor Murashkin// (Do not add anything here that is defined in ParsedOptions::MakeParser)
1209bdf108885a27ba05fae8501725649574d7c491bVladimir MarkoRUNTIME_OPTIONS_KEY (std::vector<std::unique_ptr<const DexFile>>*, \
1219bdf108885a27ba05fae8501725649574d7c491bVladimir Marko                                          BootClassPathDexList)
122aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (InstructionSet,      ImageInstructionSet,            kRuntimeISA)
123aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (CompilerCallbacks*,  CompilerCallbacksPtr)  // TDOO: make unique_ptr
124aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (bool (*)(),          HookIsSensitiveThread)
125aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (int32_t (*)(FILE* stream, const char* format, va_list ap), \
126aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                          HookVfprintf,                   vfprintf)
127aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (void (*)(int32_t status), \
128aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                          HookExit,                       exit)
129aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                                                          // We don't call abort(3) by default; see
130aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin                                                                          // Runtime::Abort.
131aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (void (*)(),          HookAbort,                      nullptr)
132aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin
133aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin#undef RUNTIME_OPTIONS_KEY
134