Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 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* dex2oat_enabled = opt.Get(RuntimeOptions::Dex2Oat); |
| 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 | // |
Igor Murashkin | c449e8b | 2015-06-10 15:56:42 -0700 | [diff] [blame] | 33 | // Please keep the columns aligned if possible when adding new rows. |
| 34 | // |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 35 | |
| 36 | // Parse-able keys from the command line. |
| 37 | RUNTIME_OPTIONS_KEY (Unit, Zygote) |
| 38 | RUNTIME_OPTIONS_KEY (Unit, Help) |
| 39 | RUNTIME_OPTIONS_KEY (Unit, ShowVersion) |
| 40 | RUNTIME_OPTIONS_KEY (std::string, BootClassPath) |
| 41 | RUNTIME_OPTIONS_KEY (ParseStringList<':'>,BootClassPathLocations) // std::vector<std::string> |
| 42 | RUNTIME_OPTIONS_KEY (std::string, ClassPath) |
| 43 | RUNTIME_OPTIONS_KEY (std::string, Image) |
| 44 | RUNTIME_OPTIONS_KEY (Unit, CheckJni) |
| 45 | RUNTIME_OPTIONS_KEY (Unit, JniOptsForceCopy) |
| 46 | RUNTIME_OPTIONS_KEY (JDWP::JdwpOptions, JdwpOptions) |
| 47 | RUNTIME_OPTIONS_KEY (MemoryKiB, MemoryMaximumSize, gc::Heap::kDefaultMaximumSize) // -Xmx |
| 48 | RUNTIME_OPTIONS_KEY (MemoryKiB, MemoryInitialSize, gc::Heap::kDefaultInitialSize) // -Xms |
| 49 | RUNTIME_OPTIONS_KEY (MemoryKiB, HeapGrowthLimit) // Default is 0 for unlimited |
| 50 | RUNTIME_OPTIONS_KEY (MemoryKiB, HeapMinFree, gc::Heap::kDefaultMinFree) |
| 51 | RUNTIME_OPTIONS_KEY (MemoryKiB, HeapMaxFree, gc::Heap::kDefaultMaxFree) |
| 52 | RUNTIME_OPTIONS_KEY (MemoryKiB, NonMovingSpaceCapacity, gc::Heap::kDefaultNonMovingSpaceCapacity) |
| 53 | RUNTIME_OPTIONS_KEY (double, HeapTargetUtilization, gc::Heap::kDefaultTargetUtilization) |
| 54 | RUNTIME_OPTIONS_KEY (double, ForegroundHeapGrowthMultiplier, gc::Heap::kDefaultHeapGrowthMultiplier) |
Mathieu Chartier | 10d6886 | 2015-04-15 14:21:33 -0700 | [diff] [blame] | 55 | RUNTIME_OPTIONS_KEY (unsigned int, ParallelGCThreads, 0u) |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 56 | RUNTIME_OPTIONS_KEY (unsigned int, ConcGCThreads) |
| 57 | RUNTIME_OPTIONS_KEY (Memory<1>, StackSize) // -Xss |
| 58 | RUNTIME_OPTIONS_KEY (unsigned int, MaxSpinsBeforeThinLockInflation,Monitor::kDefaultMaxSpinsBeforeThinLockInflation) |
| 59 | RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \ |
| 60 | LongPauseLogThreshold, gc::Heap::kDefaultLongPauseLogThreshold) |
| 61 | RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \ |
| 62 | LongGCLogThreshold, gc::Heap::kDefaultLongGCLogThreshold) |
Mathieu Chartier | 3fceaf5 | 2017-01-22 13:33:40 -0800 | [diff] [blame] | 63 | RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \ |
| 64 | ThreadSuspendTimeout, ThreadList::kDefaultThreadSuspendTimeout) |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 65 | RUNTIME_OPTIONS_KEY (Unit, DumpGCPerformanceOnShutdown) |
Mathieu Chartier | a4885cb | 2015-03-09 15:38:54 -0700 | [diff] [blame] | 66 | RUNTIME_OPTIONS_KEY (Unit, DumpJITInfoOnShutdown) |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 67 | RUNTIME_OPTIONS_KEY (Unit, IgnoreMaxFootprint) |
| 68 | RUNTIME_OPTIONS_KEY (Unit, LowMemoryMode) |
Hiroshi Yamauchi | 49b7134 | 2015-05-15 16:24:24 -0700 | [diff] [blame] | 69 | RUNTIME_OPTIONS_KEY (bool, UseTLAB, (kUseTlab || kUseReadBarrier)) |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 70 | RUNTIME_OPTIONS_KEY (bool, EnableHSpaceCompactForOOM, true) |
Calin Juravle | ffc8707 | 2016-04-20 14:22:09 +0100 | [diff] [blame] | 71 | RUNTIME_OPTIONS_KEY (bool, UseJitCompilation, false) |
Nicolas Geoffray | a73280d | 2016-02-15 13:05:16 +0000 | [diff] [blame] | 72 | RUNTIME_OPTIONS_KEY (bool, DumpNativeStackOnSigQuit, true) |
Igor Murashkin | c449e8b | 2015-06-10 15:56:42 -0700 | [diff] [blame] | 73 | RUNTIME_OPTIONS_KEY (unsigned int, JITCompileThreshold, jit::Jit::kDefaultCompileThreshold) |
Nicolas Geoffray | 83f080a | 2016-03-08 16:50:21 +0000 | [diff] [blame] | 74 | RUNTIME_OPTIONS_KEY (unsigned int, JITWarmupThreshold) |
| 75 | RUNTIME_OPTIONS_KEY (unsigned int, JITOsrThreshold) |
Calin Juravle | b2771b4 | 2016-04-07 17:09:25 +0100 | [diff] [blame] | 76 | RUNTIME_OPTIONS_KEY (unsigned int, JITPriorityThreadWeight) |
Calin Juravle | 155ff3d | 2016-04-27 14:14:58 +0100 | [diff] [blame] | 77 | RUNTIME_OPTIONS_KEY (unsigned int, JITInvokeTransitionWeight) |
Nicolas Geoffray | 0a3be16 | 2015-11-18 11:15:22 +0000 | [diff] [blame] | 78 | RUNTIME_OPTIONS_KEY (MemoryKiB, JITCodeCacheInitialCapacity, jit::JitCodeCache::kInitialCapacity) |
| 79 | RUNTIME_OPTIONS_KEY (MemoryKiB, JITCodeCacheMaxCapacity, jit::JitCodeCache::kMaxCapacity) |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 80 | RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \ |
| 81 | HSpaceCompactForOOMMinIntervalsMs,\ |
| 82 | MsToNs(100 * 1000)) // 100s |
| 83 | RUNTIME_OPTIONS_KEY (std::vector<std::string>, \ |
| 84 | PropertiesList) // -D<whatever> -D<whatever> ... |
| 85 | RUNTIME_OPTIONS_KEY (std::string, JniTrace) |
| 86 | RUNTIME_OPTIONS_KEY (std::string, PatchOat) |
| 87 | RUNTIME_OPTIONS_KEY (bool, Relocate, kDefaultMustRelocate) |
Nicolas Geoffray | e722d29 | 2015-12-15 11:51:37 +0000 | [diff] [blame] | 88 | RUNTIME_OPTIONS_KEY (bool, Dex2Oat, true) |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 89 | RUNTIME_OPTIONS_KEY (bool, ImageDex2Oat, true) |
Roland Levillain | 0d5a281 | 2015-11-13 10:07:31 +0000 | [diff] [blame] | 90 | RUNTIME_OPTIONS_KEY (bool, Interpret, false) // -Xint |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 91 | // Disable the compiler for CC (for now). |
| 92 | RUNTIME_OPTIONS_KEY (XGcOption, GcOption) // -Xgc: |
| 93 | RUNTIME_OPTIONS_KEY (gc::space::LargeObjectSpaceType, \ |
| 94 | LargeObjectSpace, gc::Heap::kDefaultLargeObjectSpaceType) |
| 95 | RUNTIME_OPTIONS_KEY (Memory<1>, LargeObjectThreshold, gc::Heap::kDefaultLargeObjectThreshold) |
| 96 | RUNTIME_OPTIONS_KEY (BackgroundGcOption, BackgroundGc) |
| 97 | |
| 98 | RUNTIME_OPTIONS_KEY (Unit, DisableExplicitGC) |
Calin Juravle | 01aaf6e | 2015-06-19 22:05:39 +0100 | [diff] [blame] | 99 | RUNTIME_OPTIONS_KEY (Unit, NoSigChain) |
Calin Juravle | d3e7c6c | 2016-02-04 19:07:51 +0000 | [diff] [blame] | 100 | RUNTIME_OPTIONS_KEY (Unit, ForceNativeBridge) |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 101 | RUNTIME_OPTIONS_KEY (LogVerbosity, Verbose) |
| 102 | RUNTIME_OPTIONS_KEY (unsigned int, LockProfThreshold) |
| 103 | RUNTIME_OPTIONS_KEY (std::string, StackTraceFile) |
| 104 | RUNTIME_OPTIONS_KEY (Unit, MethodTrace) |
Calin Juravle | f83e733 | 2015-11-04 16:16:47 +0000 | [diff] [blame] | 105 | RUNTIME_OPTIONS_KEY (std::string, MethodTraceFile, "/data/misc/trace/method-trace-file.bin") |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 106 | RUNTIME_OPTIONS_KEY (unsigned int, MethodTraceFileSize, 10 * MB) |
Andreas Gampe | 40da286 | 2015-02-27 12:49:04 -0800 | [diff] [blame] | 107 | RUNTIME_OPTIONS_KEY (Unit, MethodTraceStreaming) |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 108 | RUNTIME_OPTIONS_KEY (TraceClockSource, ProfileClock, kDefaultTraceClockSource) // -Xprofile: |
Calin Juravle | 138dbff | 2016-06-28 19:36:58 +0100 | [diff] [blame] | 109 | RUNTIME_OPTIONS_KEY (ProfileSaverOptions, ProfileSaverOpts) // -Xjitsaveprofilinginfo, -Xps-* |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 110 | RUNTIME_OPTIONS_KEY (std::string, Compiler) |
| 111 | RUNTIME_OPTIONS_KEY (std::vector<std::string>, \ |
| 112 | CompilerOptions) // -Xcompiler-option ... |
| 113 | RUNTIME_OPTIONS_KEY (std::vector<std::string>, \ |
| 114 | ImageCompilerOptions) // -Ximage-compiler-option ... |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 115 | RUNTIME_OPTIONS_KEY (verifier::VerifyMode, \ |
| 116 | Verify, verifier::VerifyMode::kEnable) |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 117 | RUNTIME_OPTIONS_KEY (std::string, NativeBridge) |
Igor Murashkin | c449e8b | 2015-06-10 15:56:42 -0700 | [diff] [blame] | 118 | RUNTIME_OPTIONS_KEY (unsigned int, ZygoteMaxFailedBoots, 10) |
| 119 | RUNTIME_OPTIONS_KEY (Unit, NoDexFileFallback) |
Dmitriy Ivanov | 785049f | 2014-07-18 10:08:57 -0700 | [diff] [blame] | 120 | RUNTIME_OPTIONS_KEY (std::string, CpuAbiList) |
Andreas Gampe | dd67125 | 2015-07-23 14:37:18 -0700 | [diff] [blame] | 121 | RUNTIME_OPTIONS_KEY (std::string, Fingerprint) |
Andreas Gampe | 01fd70b | 2017-01-25 10:03:08 -0800 | [diff] [blame] | 122 | RUNTIME_OPTIONS_KEY (ExperimentalFlags, Experimental, ExperimentalFlags::kNone) // -Xexperimental:{...} |
| 123 | RUNTIME_OPTIONS_KEY (std::vector<ti::Agent>, AgentLib) // -agentlib:<libname>=<options> |
| 124 | RUNTIME_OPTIONS_KEY (std::vector<ti::Agent>, AgentPath) // -agentpath:<libname>=<options> |
| 125 | RUNTIME_OPTIONS_KEY (std::vector<Plugin>, Plugins) // -Xplugin:<library> |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 126 | |
| 127 | // Not parse-able from command line, but can be provided explicitly. |
Igor Murashkin | c449e8b | 2015-06-10 15:56:42 -0700 | [diff] [blame] | 128 | // (Do not add anything here that is defined in ParsedOptions::MakeParser) |
Vladimir Marko | 9bdf108 | 2016-01-21 12:15:52 +0000 | [diff] [blame] | 129 | RUNTIME_OPTIONS_KEY (std::vector<std::unique_ptr<const DexFile>>*, \ |
| 130 | BootClassPathDexList) |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 131 | RUNTIME_OPTIONS_KEY (InstructionSet, ImageInstructionSet, kRuntimeISA) |
| 132 | RUNTIME_OPTIONS_KEY (CompilerCallbacks*, CompilerCallbacksPtr) // TDOO: make unique_ptr |
| 133 | RUNTIME_OPTIONS_KEY (bool (*)(), HookIsSensitiveThread) |
| 134 | RUNTIME_OPTIONS_KEY (int32_t (*)(FILE* stream, const char* format, va_list ap), \ |
| 135 | HookVfprintf, vfprintf) |
Hiroshi Yamauchi | 249b4d1 | 2016-05-11 19:27:44 -0700 | [diff] [blame] | 136 | // Use _exit instead of exit so that we won't get DCHECK failures in global data |
| 137 | // destructors. b/28106055. |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 138 | RUNTIME_OPTIONS_KEY (void (*)(int32_t status), \ |
Hiroshi Yamauchi | 249b4d1 | 2016-05-11 19:27:44 -0700 | [diff] [blame] | 139 | HookExit, _exit) |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 140 | // We don't call abort(3) by default; see |
| 141 | // Runtime::Abort. |
| 142 | RUNTIME_OPTIONS_KEY (void (*)(), HookAbort, nullptr) |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 143 | |
| 144 | #undef RUNTIME_OPTIONS_KEY |