blob: 11387a2e0157d53ac9ffcdf7dc6feeb2f1930328 [file] [log] [blame]
Igor Murashkinaaebaa02015-01-26 10:55:53 -08001/*
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:
Nicolas Geoffray3d8a78a2018-08-29 21:10:16 +000024// RuntimeOptions opt; bool* image_dex2oat_enabled = opt.Get(RuntimeOptions::ImageDex2Oat);
Igor Murashkinaaebaa02015-01-26 10:55:53 -080025//
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 Murashkinc449e8b2015-06-10 15:56:42 -070033// Please keep the columns aligned if possible when adding new rows.
34//
Igor Murashkinaaebaa02015-01-26 10:55:53 -080035
36// Parse-able keys from the command line.
37RUNTIME_OPTIONS_KEY (Unit, Zygote)
Nicolas Geoffray4444f1b2019-06-10 14:09:19 +010038RUNTIME_OPTIONS_KEY (Unit, PrimaryZygote)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080039RUNTIME_OPTIONS_KEY (Unit, Help)
40RUNTIME_OPTIONS_KEY (Unit, ShowVersion)
Vladimir Marko91f10322018-12-07 18:04:10 +000041RUNTIME_OPTIONS_KEY (ParseStringList<':'>,BootClassPath) // std::vector<std::string>
Igor Murashkinaaebaa02015-01-26 10:55:53 -080042RUNTIME_OPTIONS_KEY (ParseStringList<':'>,BootClassPathLocations) // std::vector<std::string>
Victor Hsieha09d8b72021-05-24 14:21:55 -070043RUNTIME_OPTIONS_KEY (ParseIntList<':'>, BootClassPathFds) // std::vector<int>
Igor Murashkinaaebaa02015-01-26 10:55:53 -080044RUNTIME_OPTIONS_KEY (std::string, ClassPath)
Victor Hsieh61ffd042021-05-20 15:14:25 -070045RUNTIME_OPTIONS_KEY (ParseStringList<':'>,Image)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080046RUNTIME_OPTIONS_KEY (Unit, CheckJni)
47RUNTIME_OPTIONS_KEY (Unit, JniOptsForceCopy)
Alex Light10592e32020-12-11 19:54:32 +000048RUNTIME_OPTIONS_KEY (std::string, JdwpOptions, "suspend=n,server=y")
Alex Lightbaac7e42018-06-08 15:30:11 +000049RUNTIME_OPTIONS_KEY (JdwpProvider, JdwpProvider, JdwpProvider::kUnset)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080050RUNTIME_OPTIONS_KEY (MemoryKiB, MemoryMaximumSize, gc::Heap::kDefaultMaximumSize) // -Xmx
51RUNTIME_OPTIONS_KEY (MemoryKiB, MemoryInitialSize, gc::Heap::kDefaultInitialSize) // -Xms
52RUNTIME_OPTIONS_KEY (MemoryKiB, HeapGrowthLimit) // Default is 0 for unlimited
53RUNTIME_OPTIONS_KEY (MemoryKiB, HeapMinFree, gc::Heap::kDefaultMinFree)
54RUNTIME_OPTIONS_KEY (MemoryKiB, HeapMaxFree, gc::Heap::kDefaultMaxFree)
55RUNTIME_OPTIONS_KEY (MemoryKiB, NonMovingSpaceCapacity, gc::Heap::kDefaultNonMovingSpaceCapacity)
Hans Boehmbb2467b2019-03-29 22:55:06 -070056RUNTIME_OPTIONS_KEY (MemoryKiB, StopForNativeAllocs, 1 * GB)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080057RUNTIME_OPTIONS_KEY (double, HeapTargetUtilization, gc::Heap::kDefaultTargetUtilization)
58RUNTIME_OPTIONS_KEY (double, ForegroundHeapGrowthMultiplier, gc::Heap::kDefaultHeapGrowthMultiplier)
Mathieu Chartier10d68862015-04-15 14:21:33 -070059RUNTIME_OPTIONS_KEY (unsigned int, ParallelGCThreads, 0u)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080060RUNTIME_OPTIONS_KEY (unsigned int, ConcGCThreads)
Hans Boehmb2155572019-03-27 14:25:53 -070061RUNTIME_OPTIONS_KEY (unsigned int, FinalizerTimeoutMs, 10000u)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080062RUNTIME_OPTIONS_KEY (Memory<1>, StackSize) // -Xss
63RUNTIME_OPTIONS_KEY (unsigned int, MaxSpinsBeforeThinLockInflation,Monitor::kDefaultMaxSpinsBeforeThinLockInflation)
64RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
65 LongPauseLogThreshold, gc::Heap::kDefaultLongPauseLogThreshold)
66RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
67 LongGCLogThreshold, gc::Heap::kDefaultLongGCLogThreshold)
Mathieu Chartier3fceaf52017-01-22 13:33:40 -080068RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
69 ThreadSuspendTimeout, ThreadList::kDefaultThreadSuspendTimeout)
wangguibo0d290722021-04-24 11:27:06 +080070RUNTIME_OPTIONS_KEY (bool, MonitorTimeoutEnable, false)
71RUNTIME_OPTIONS_KEY (int, MonitorTimeout, Monitor::kDefaultMonitorTimeoutMs)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080072RUNTIME_OPTIONS_KEY (Unit, DumpGCPerformanceOnShutdown)
Albert Mingkun Yangde94ea72018-11-16 10:15:49 +000073RUNTIME_OPTIONS_KEY (Unit, DumpRegionInfoBeforeGC)
74RUNTIME_OPTIONS_KEY (Unit, DumpRegionInfoAfterGC)
Mathieu Chartiera4885cb2015-03-09 15:38:54 -070075RUNTIME_OPTIONS_KEY (Unit, DumpJITInfoOnShutdown)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080076RUNTIME_OPTIONS_KEY (Unit, IgnoreMaxFootprint)
Alex Lightb5a0e912020-07-23 10:54:47 -070077RUNTIME_OPTIONS_KEY (bool, AlwaysLogExplicitGcs, true)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080078RUNTIME_OPTIONS_KEY (Unit, LowMemoryMode)
Hiroshi Yamauchi49b71342015-05-15 16:24:24 -070079RUNTIME_OPTIONS_KEY (bool, UseTLAB, (kUseTlab || kUseReadBarrier))
Igor Murashkinaaebaa02015-01-26 10:55:53 -080080RUNTIME_OPTIONS_KEY (bool, EnableHSpaceCompactForOOM, true)
Nicolas Geoffraya5ca8eb2018-08-24 13:39:13 +010081RUNTIME_OPTIONS_KEY (bool, UseJitCompilation, true)
Nicolas Geoffray4bf753d2020-12-14 20:33:53 +000082RUNTIME_OPTIONS_KEY (bool, UseProfiledJitCompilation, false)
Nicolas Geoffray6ee49712018-03-30 14:39:05 +000083RUNTIME_OPTIONS_KEY (bool, DumpNativeStackOnSigQuit, true)
Mathieu Chartierc42cb0e2017-10-13 11:35:00 -070084RUNTIME_OPTIONS_KEY (bool, MadviseRandomAccess, false)
Jagadeesh Pakaravoor06541532021-02-22 21:19:09 -080085RUNTIME_OPTIONS_KEY (unsigned int, MadviseWillNeedVdexFileSize, 0)
86RUNTIME_OPTIONS_KEY (unsigned int, MadviseWillNeedOdexFileSize, 0)
87RUNTIME_OPTIONS_KEY (unsigned int, MadviseWillNeedArtFileSize, 0)
Alex Light4ca2f482019-11-25 16:07:22 -080088RUNTIME_OPTIONS_KEY (JniIdType, OpaqueJniIds, JniIdType::kDefault) // -Xopaque-jni-ids:{true, false, swapable}
89RUNTIME_OPTIONS_KEY (bool, AutoPromoteOpaqueJniIds, true) // testing use only. -Xauto-promote-opaque-jni-ids:{true, false}
Andreas Gampe7897cec2017-07-19 16:28:59 -070090RUNTIME_OPTIONS_KEY (unsigned int, JITCompileThreshold)
Nicolas Geoffray83f080a2016-03-08 16:50:21 +000091RUNTIME_OPTIONS_KEY (unsigned int, JITWarmupThreshold)
92RUNTIME_OPTIONS_KEY (unsigned int, JITOsrThreshold)
Calin Juravleb2771b42016-04-07 17:09:25 +010093RUNTIME_OPTIONS_KEY (unsigned int, JITPriorityThreadWeight)
Calin Juravle155ff3d2016-04-27 14:14:58 +010094RUNTIME_OPTIONS_KEY (unsigned int, JITInvokeTransitionWeight)
Nicolas Geoffray47b95802018-05-16 15:42:17 +010095RUNTIME_OPTIONS_KEY (int, JITPoolThreadPthreadPriority, jit::kJitPoolThreadPthreadDefaultPriority)
Nicolas Geoffray4bf753d2020-12-14 20:33:53 +000096RUNTIME_OPTIONS_KEY (int, JITZygotePoolThreadPthreadPriority, jit::kJitZygotePoolThreadPthreadDefaultPriority)
Nicolas Geoffray0a3be162015-11-18 11:15:22 +000097RUNTIME_OPTIONS_KEY (MemoryKiB, JITCodeCacheInitialCapacity, jit::JitCodeCache::kInitialCapacity)
98RUNTIME_OPTIONS_KEY (MemoryKiB, JITCodeCacheMaxCapacity, jit::JitCodeCache::kMaxCapacity)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080099RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
100 HSpaceCompactForOOMMinIntervalsMs,\
101 MsToNs(100 * 1000)) // 100s
102RUNTIME_OPTIONS_KEY (std::vector<std::string>, \
103 PropertiesList) // -D<whatever> -D<whatever> ...
104RUNTIME_OPTIONS_KEY (std::string, JniTrace)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800105RUNTIME_OPTIONS_KEY (bool, Relocate, kDefaultMustRelocate)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800106RUNTIME_OPTIONS_KEY (bool, ImageDex2Oat, true)
Roland Levillain0d5a2812015-11-13 10:07:31 +0000107RUNTIME_OPTIONS_KEY (bool, Interpret, false) // -Xint
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800108 // Disable the compiler for CC (for now).
109RUNTIME_OPTIONS_KEY (XGcOption, GcOption) // -Xgc:
110RUNTIME_OPTIONS_KEY (gc::space::LargeObjectSpaceType, \
111 LargeObjectSpace, gc::Heap::kDefaultLargeObjectSpaceType)
112RUNTIME_OPTIONS_KEY (Memory<1>, LargeObjectThreshold, gc::Heap::kDefaultLargeObjectThreshold)
113RUNTIME_OPTIONS_KEY (BackgroundGcOption, BackgroundGc)
114
115RUNTIME_OPTIONS_KEY (Unit, DisableExplicitGC)
Calin Juravle01aaf6e2015-06-19 22:05:39 +0100116RUNTIME_OPTIONS_KEY (Unit, NoSigChain)
Calin Juravled3e7c6c2016-02-04 19:07:51 +0000117RUNTIME_OPTIONS_KEY (Unit, ForceNativeBridge)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800118RUNTIME_OPTIONS_KEY (LogVerbosity, Verbose)
119RUNTIME_OPTIONS_KEY (unsigned int, LockProfThreshold)
Andreas Gamped0210e52017-06-23 13:38:09 -0700120RUNTIME_OPTIONS_KEY (unsigned int, StackDumpLockProfThreshold)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800121RUNTIME_OPTIONS_KEY (Unit, MethodTrace)
Calin Juravlef83e7332015-11-04 16:16:47 +0000122RUNTIME_OPTIONS_KEY (std::string, MethodTraceFile, "/data/misc/trace/method-trace-file.bin")
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800123RUNTIME_OPTIONS_KEY (unsigned int, MethodTraceFileSize, 10 * MB)
Andreas Gampe40da2862015-02-27 12:49:04 -0800124RUNTIME_OPTIONS_KEY (Unit, MethodTraceStreaming)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800125RUNTIME_OPTIONS_KEY (TraceClockSource, ProfileClock, kDefaultTraceClockSource) // -Xprofile:
Calin Juravle138dbff2016-06-28 19:36:58 +0100126RUNTIME_OPTIONS_KEY (ProfileSaverOptions, ProfileSaverOpts) // -Xjitsaveprofilinginfo, -Xps-*
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800127RUNTIME_OPTIONS_KEY (std::string, Compiler)
128RUNTIME_OPTIONS_KEY (std::vector<std::string>, \
129 CompilerOptions) // -Xcompiler-option ...
130RUNTIME_OPTIONS_KEY (std::vector<std::string>, \
131 ImageCompilerOptions) // -Ximage-compiler-option ...
Igor Murashkin7617abd2015-07-10 18:27:47 -0700132RUNTIME_OPTIONS_KEY (verifier::VerifyMode, \
133 Verify, verifier::VerifyMode::kEnable)
David Brazdil2bb2fbd2018-11-13 18:24:26 +0000134RUNTIME_OPTIONS_KEY (unsigned int, TargetSdkVersion, \
135 static_cast<unsigned int>(SdkVersion::kUnset))
David Brazdil6dfdfef2019-04-11 17:39:11 +0100136RUNTIME_OPTIONS_KEY (hiddenapi::EnforcementPolicy,
137 HiddenApiPolicy,
138 hiddenapi::EnforcementPolicy::kDisabled)
139RUNTIME_OPTIONS_KEY (hiddenapi::EnforcementPolicy,
140 CorePlatformApiPolicy,
141 hiddenapi::EnforcementPolicy::kDisabled)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800142RUNTIME_OPTIONS_KEY (std::string, NativeBridge)
Igor Murashkinc449e8b2015-06-10 15:56:42 -0700143RUNTIME_OPTIONS_KEY (unsigned int, ZygoteMaxFailedBoots, 10)
Dmitriy Ivanov785049f2014-07-18 10:08:57 -0700144RUNTIME_OPTIONS_KEY (std::string, CpuAbiList)
Andreas Gampedd671252015-07-23 14:37:18 -0700145RUNTIME_OPTIONS_KEY (std::string, Fingerprint)
Andreas Gampe01fd70b2017-01-25 10:03:08 -0800146RUNTIME_OPTIONS_KEY (ExperimentalFlags, Experimental, ExperimentalFlags::kNone) // -Xexperimental:{...}
Andreas Gampeaadcbc62017-12-28 14:05:42 -0800147RUNTIME_OPTIONS_KEY (std::list<ti::AgentSpec>, AgentLib) // -agentlib:<libname>=<options>
148RUNTIME_OPTIONS_KEY (std::list<ti::AgentSpec>, AgentPath) // -agentpath:<libname>=<options>
Andreas Gampe01fd70b2017-01-25 10:03:08 -0800149RUNTIME_OPTIONS_KEY (std::vector<Plugin>, Plugins) // -Xplugin:<library>
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800150
151// Not parse-able from command line, but can be provided explicitly.
Igor Murashkinc449e8b2015-06-10 15:56:42 -0700152// (Do not add anything here that is defined in ParsedOptions::MakeParser)
Vladimir Marko9bdf1082016-01-21 12:15:52 +0000153RUNTIME_OPTIONS_KEY (std::vector<std::unique_ptr<const DexFile>>*, \
154 BootClassPathDexList)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800155RUNTIME_OPTIONS_KEY (InstructionSet, ImageInstructionSet, kRuntimeISA)
Roland Levillain87beba32019-08-09 14:20:32 +0100156RUNTIME_OPTIONS_KEY (CompilerCallbacks*, CompilerCallbacksPtr) // TODO: make unique_ptr
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800157RUNTIME_OPTIONS_KEY (bool (*)(), HookIsSensitiveThread)
158RUNTIME_OPTIONS_KEY (int32_t (*)(FILE* stream, const char* format, va_list ap), \
159 HookVfprintf, vfprintf)
Roland Levillainbdf17372021-05-06 00:19:19 +0100160// Use `art::FastExit` instead of `exit` so that we won't get DCHECK failures
161// in global data destructors (see b/28106055).
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800162RUNTIME_OPTIONS_KEY (void (*)(int32_t status), \
Roland Levillainbdf17372021-05-06 00:19:19 +0100163 HookExit, art::FastExit)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800164 // We don't call abort(3) by default; see
165 // Runtime::Abort.
166RUNTIME_OPTIONS_KEY (void (*)(), HookAbort, nullptr)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800167
Andreas Gampe1c5b42f2017-06-15 18:20:45 -0700168RUNTIME_OPTIONS_KEY (bool, SlowDebug, false)
169
Andreas Gampe1b35b462017-09-29 18:52:15 -0700170RUNTIME_OPTIONS_KEY (unsigned int, GlobalRefAllocStackTraceLimit, 0) // 0 = off
Andreas Gampe25419b52018-02-08 21:30:26 -0800171RUNTIME_OPTIONS_KEY (Unit, UseStderrLogger)
Andreas Gampe1b35b462017-09-29 18:52:15 -0700172
Orion Hodson094b1cf2021-06-08 09:28:28 +0100173RUNTIME_OPTIONS_KEY (Unit, OnlyUseTrustedOatFiles)
Andreas Gampe0b0ffc12018-08-01 14:41:27 -0700174RUNTIME_OPTIONS_KEY (unsigned int, VerifierLoggingThreshold, 100)
Nicolas Geoffray66ff8a82018-02-28 13:27:55 +0000175
Andreas Gampe87658f32019-04-18 18:39:02 +0000176RUNTIME_OPTIONS_KEY (bool, FastClassNotFoundException, true)
Andreas Gampea83a8892019-07-18 13:43:15 -0700177RUNTIME_OPTIONS_KEY (bool, VerifierMissingKThrowFatal, true)
Andreas Gampe87658f32019-04-18 18:39:02 +0000178
Florian Mayer0972d082020-05-15 14:07:31 +0200179// Whether to allow loading of the perfetto hprof plugin.
180// Even with this option set, we will still only actually load the plugin
181// if we are on a userdebug build or the app is debuggable or profileable.
182//
183// We do not want to enable this by default because PerfettoHprof does not
184// work on host, and we do not want to enable it in tests.
185//
186// Switching this on adds ~500us to the startup on userdebug builds, or for
187// profileable / debuggable apps.
188//
189// This is set to true in frameworks/base/core/jni/AndroidRuntime.cpp.
190RUNTIME_OPTIONS_KEY (bool, PerfettoHprof, false)
191
Wessam Hassaneinb5a10be2020-11-11 16:42:52 -0800192// This is to enable/disable Perfetto Java Heap Stack Profiling
193RUNTIME_OPTIONS_KEY (bool, PerfettoJavaHeapStackProf, false)
194
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800195#undef RUNTIME_OPTIONS_KEY