1/* 2 * Copyright (C) 2015 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License") 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef RUNTIME_OPTIONS_KEY 18#error "Please #define RUNTIME_OPTIONS_KEY before #including this file" 19#define RUNTIME_OPTIONS_KEY(...) // Don't display errors in this file in IDEs. 20#endif 21 22// This file defines the list of keys for RuntimeOptions. 23// These can be used with RuntimeOptions.Get/Set/etc, for example: 24// RuntimeOptions opt; bool* image_dex2oat_enabled = opt.Get(RuntimeOptions::ImageDex2Oat); 25// 26// Column Descriptions: 27// <<Type>> <<Key Name>> <<Default Value>> 28// 29// Default values are only used by Map::GetOrDefault(K<T>). 30// If a default value is omitted here, T{} is used as the default value, which is 31// almost-always the value of the type as if it was memset to all 0. 32// 33// Please keep the columns aligned if possible when adding new rows. 34// 35 36// Parse-able keys from the command line. 37RUNTIME_OPTIONS_KEY (Unit, Zygote) 38RUNTIME_OPTIONS_KEY (Unit, Help) 39RUNTIME_OPTIONS_KEY (Unit, ShowVersion) 40RUNTIME_OPTIONS_KEY (ParseStringList<':'>,BootClassPath) // std::vector<std::string> 41RUNTIME_OPTIONS_KEY (ParseStringList<':'>,BootClassPathLocations) // std::vector<std::string> 42RUNTIME_OPTIONS_KEY (std::string, ClassPath) 43RUNTIME_OPTIONS_KEY (std::string, Image) 44RUNTIME_OPTIONS_KEY (Unit, CheckJni) 45RUNTIME_OPTIONS_KEY (Unit, JniOptsForceCopy) 46RUNTIME_OPTIONS_KEY (std::string, JdwpOptions, "") 47RUNTIME_OPTIONS_KEY (JdwpProvider, JdwpProvider, JdwpProvider::kUnset) 48RUNTIME_OPTIONS_KEY (MemoryKiB, MemoryMaximumSize, gc::Heap::kDefaultMaximumSize) // -Xmx 49RUNTIME_OPTIONS_KEY (MemoryKiB, MemoryInitialSize, gc::Heap::kDefaultInitialSize) // -Xms 50RUNTIME_OPTIONS_KEY (MemoryKiB, HeapGrowthLimit) // Default is 0 for unlimited 51RUNTIME_OPTIONS_KEY (MemoryKiB, HeapMinFree, gc::Heap::kDefaultMinFree) 52RUNTIME_OPTIONS_KEY (MemoryKiB, HeapMaxFree, gc::Heap::kDefaultMaxFree) 53RUNTIME_OPTIONS_KEY (MemoryKiB, NonMovingSpaceCapacity, gc::Heap::kDefaultNonMovingSpaceCapacity) 54RUNTIME_OPTIONS_KEY (double, HeapTargetUtilization, gc::Heap::kDefaultTargetUtilization) 55RUNTIME_OPTIONS_KEY (double, ForegroundHeapGrowthMultiplier, gc::Heap::kDefaultHeapGrowthMultiplier) 56RUNTIME_OPTIONS_KEY (unsigned int, ParallelGCThreads, 0u) 57RUNTIME_OPTIONS_KEY (unsigned int, ConcGCThreads) 58RUNTIME_OPTIONS_KEY (unsigned int, FinalizerTimeoutMs, 10000u) 59RUNTIME_OPTIONS_KEY (Memory<1>, StackSize) // -Xss 60RUNTIME_OPTIONS_KEY (unsigned int, MaxSpinsBeforeThinLockInflation,Monitor::kDefaultMaxSpinsBeforeThinLockInflation) 61RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \ 62 LongPauseLogThreshold, gc::Heap::kDefaultLongPauseLogThreshold) 63RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \ 64 LongGCLogThreshold, gc::Heap::kDefaultLongGCLogThreshold) 65RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \ 66 ThreadSuspendTimeout, ThreadList::kDefaultThreadSuspendTimeout) 67RUNTIME_OPTIONS_KEY (Unit, DumpGCPerformanceOnShutdown) 68RUNTIME_OPTIONS_KEY (Unit, DumpRegionInfoBeforeGC) 69RUNTIME_OPTIONS_KEY (Unit, DumpRegionInfoAfterGC) 70RUNTIME_OPTIONS_KEY (Unit, DumpJITInfoOnShutdown) 71RUNTIME_OPTIONS_KEY (Unit, IgnoreMaxFootprint) 72RUNTIME_OPTIONS_KEY (Unit, LowMemoryMode) 73RUNTIME_OPTIONS_KEY (bool, UseTLAB, (kUseTlab || kUseReadBarrier)) 74RUNTIME_OPTIONS_KEY (bool, EnableHSpaceCompactForOOM, true) 75RUNTIME_OPTIONS_KEY (bool, UseJitCompilation, true) 76RUNTIME_OPTIONS_KEY (bool, DumpNativeStackOnSigQuit, true) 77RUNTIME_OPTIONS_KEY (bool, MadviseRandomAccess, false) 78RUNTIME_OPTIONS_KEY (unsigned int, JITCompileThreshold) 79RUNTIME_OPTIONS_KEY (unsigned int, JITWarmupThreshold) 80RUNTIME_OPTIONS_KEY (unsigned int, JITOsrThreshold) 81RUNTIME_OPTIONS_KEY (unsigned int, JITPriorityThreadWeight) 82RUNTIME_OPTIONS_KEY (unsigned int, JITInvokeTransitionWeight) 83RUNTIME_OPTIONS_KEY (int, JITPoolThreadPthreadPriority, jit::kJitPoolThreadPthreadDefaultPriority) 84RUNTIME_OPTIONS_KEY (MemoryKiB, JITCodeCacheInitialCapacity, jit::JitCodeCache::kInitialCapacity) 85RUNTIME_OPTIONS_KEY (MemoryKiB, JITCodeCacheMaxCapacity, jit::JitCodeCache::kMaxCapacity) 86RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \ 87 HSpaceCompactForOOMMinIntervalsMs,\ 88 MsToNs(100 * 1000)) // 100s 89RUNTIME_OPTIONS_KEY (std::vector<std::string>, \ 90 PropertiesList) // -D<whatever> -D<whatever> ... 91RUNTIME_OPTIONS_KEY (std::string, JniTrace) 92RUNTIME_OPTIONS_KEY (bool, Relocate, kDefaultMustRelocate) 93RUNTIME_OPTIONS_KEY (bool, ImageDex2Oat, true) 94RUNTIME_OPTIONS_KEY (bool, Interpret, false) // -Xint 95 // Disable the compiler for CC (for now). 96RUNTIME_OPTIONS_KEY (XGcOption, GcOption) // -Xgc: 97RUNTIME_OPTIONS_KEY (gc::space::LargeObjectSpaceType, \ 98 LargeObjectSpace, gc::Heap::kDefaultLargeObjectSpaceType) 99RUNTIME_OPTIONS_KEY (Memory<1>, LargeObjectThreshold, gc::Heap::kDefaultLargeObjectThreshold) 100RUNTIME_OPTIONS_KEY (BackgroundGcOption, BackgroundGc) 101 102RUNTIME_OPTIONS_KEY (Unit, DisableExplicitGC) 103RUNTIME_OPTIONS_KEY (Unit, NoSigChain) 104RUNTIME_OPTIONS_KEY (Unit, ForceNativeBridge) 105RUNTIME_OPTIONS_KEY (LogVerbosity, Verbose) 106RUNTIME_OPTIONS_KEY (unsigned int, LockProfThreshold) 107RUNTIME_OPTIONS_KEY (unsigned int, StackDumpLockProfThreshold) 108RUNTIME_OPTIONS_KEY (Unit, MethodTrace) 109RUNTIME_OPTIONS_KEY (std::string, MethodTraceFile, "/data/misc/trace/method-trace-file.bin") 110RUNTIME_OPTIONS_KEY (unsigned int, MethodTraceFileSize, 10 * MB) 111RUNTIME_OPTIONS_KEY (Unit, MethodTraceStreaming) 112RUNTIME_OPTIONS_KEY (TraceClockSource, ProfileClock, kDefaultTraceClockSource) // -Xprofile: 113RUNTIME_OPTIONS_KEY (ProfileSaverOptions, ProfileSaverOpts) // -Xjitsaveprofilinginfo, -Xps-* 114RUNTIME_OPTIONS_KEY (std::string, Compiler) 115RUNTIME_OPTIONS_KEY (std::vector<std::string>, \ 116 CompilerOptions) // -Xcompiler-option ... 117RUNTIME_OPTIONS_KEY (std::vector<std::string>, \ 118 ImageCompilerOptions) // -Ximage-compiler-option ... 119RUNTIME_OPTIONS_KEY (verifier::VerifyMode, \ 120 Verify, verifier::VerifyMode::kEnable) 121RUNTIME_OPTIONS_KEY (unsigned int, TargetSdkVersion, \ 122 static_cast<unsigned int>(SdkVersion::kUnset)) 123RUNTIME_OPTIONS_KEY (hiddenapi::EnforcementPolicy, 124 HiddenApiPolicy, 125 hiddenapi::EnforcementPolicy::kDisabled) 126RUNTIME_OPTIONS_KEY (hiddenapi::EnforcementPolicy, 127 CorePlatformApiPolicy, 128 hiddenapi::EnforcementPolicy::kDisabled) 129RUNTIME_OPTIONS_KEY (std::string, NativeBridge) 130RUNTIME_OPTIONS_KEY (unsigned int, ZygoteMaxFailedBoots, 10) 131RUNTIME_OPTIONS_KEY (Unit, NoDexFileFallback) 132RUNTIME_OPTIONS_KEY (std::string, CpuAbiList) 133RUNTIME_OPTIONS_KEY (std::string, Fingerprint) 134RUNTIME_OPTIONS_KEY (ExperimentalFlags, Experimental, ExperimentalFlags::kNone) // -Xexperimental:{...} 135RUNTIME_OPTIONS_KEY (std::list<ti::AgentSpec>, AgentLib) // -agentlib:<libname>=<options> 136RUNTIME_OPTIONS_KEY (std::list<ti::AgentSpec>, AgentPath) // -agentpath:<libname>=<options> 137RUNTIME_OPTIONS_KEY (std::vector<Plugin>, Plugins) // -Xplugin:<library> 138 139// Not parse-able from command line, but can be provided explicitly. 140// (Do not add anything here that is defined in ParsedOptions::MakeParser) 141RUNTIME_OPTIONS_KEY (std::vector<std::unique_ptr<const DexFile>>*, \ 142 BootClassPathDexList) 143RUNTIME_OPTIONS_KEY (InstructionSet, ImageInstructionSet, kRuntimeISA) 144RUNTIME_OPTIONS_KEY (CompilerCallbacks*, CompilerCallbacksPtr) // TDOO: make unique_ptr 145RUNTIME_OPTIONS_KEY (bool (*)(), HookIsSensitiveThread) 146RUNTIME_OPTIONS_KEY (int32_t (*)(FILE* stream, const char* format, va_list ap), \ 147 HookVfprintf, vfprintf) 148// Use _exit instead of exit so that we won't get DCHECK failures in global data 149// destructors. b/28106055. 150RUNTIME_OPTIONS_KEY (void (*)(int32_t status), \ 151 HookExit, _exit) 152 // We don't call abort(3) by default; see 153 // Runtime::Abort. 154RUNTIME_OPTIONS_KEY (void (*)(), HookAbort, nullptr) 155 156RUNTIME_OPTIONS_KEY (bool, SlowDebug, false) 157 158RUNTIME_OPTIONS_KEY (unsigned int, GlobalRefAllocStackTraceLimit, 0) // 0 = off 159RUNTIME_OPTIONS_KEY (Unit, UseStderrLogger) 160 161RUNTIME_OPTIONS_KEY (Unit, OnlyUseSystemOatFiles) 162RUNTIME_OPTIONS_KEY (unsigned int, VerifierLoggingThreshold, 100) 163 164RUNTIME_OPTIONS_KEY (gc::space::ImageSpaceLoadingOrder, \ 165 ImageSpaceLoadingOrder, \ 166 gc::space::ImageSpaceLoadingOrder::kSystemFirst) 167 168RUNTIME_OPTIONS_KEY (bool, FastClassNotFoundException, true) 169 170#undef RUNTIME_OPTIONS_KEY 171