blob: 4e47953f3fed8b4a3a1dc7e74327930cab7faef9 [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:
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 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)
38RUNTIME_OPTIONS_KEY (Unit, Help)
39RUNTIME_OPTIONS_KEY (Unit, ShowVersion)
40RUNTIME_OPTIONS_KEY (std::string, BootClassPath)
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 (JDWP::JdwpOptions, JdwpOptions)
47RUNTIME_OPTIONS_KEY (MemoryKiB, MemoryMaximumSize, gc::Heap::kDefaultMaximumSize) // -Xmx
48RUNTIME_OPTIONS_KEY (MemoryKiB, MemoryInitialSize, gc::Heap::kDefaultInitialSize) // -Xms
49RUNTIME_OPTIONS_KEY (MemoryKiB, HeapGrowthLimit) // Default is 0 for unlimited
50RUNTIME_OPTIONS_KEY (MemoryKiB, HeapMinFree, gc::Heap::kDefaultMinFree)
51RUNTIME_OPTIONS_KEY (MemoryKiB, HeapMaxFree, gc::Heap::kDefaultMaxFree)
52RUNTIME_OPTIONS_KEY (MemoryKiB, NonMovingSpaceCapacity, gc::Heap::kDefaultNonMovingSpaceCapacity)
53RUNTIME_OPTIONS_KEY (double, HeapTargetUtilization, gc::Heap::kDefaultTargetUtilization)
54RUNTIME_OPTIONS_KEY (double, ForegroundHeapGrowthMultiplier, gc::Heap::kDefaultHeapGrowthMultiplier)
Mathieu Chartier10d68862015-04-15 14:21:33 -070055RUNTIME_OPTIONS_KEY (unsigned int, ParallelGCThreads, 0u)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080056RUNTIME_OPTIONS_KEY (unsigned int, ConcGCThreads)
57RUNTIME_OPTIONS_KEY (Memory<1>, StackSize) // -Xss
58RUNTIME_OPTIONS_KEY (unsigned int, MaxSpinsBeforeThinLockInflation,Monitor::kDefaultMaxSpinsBeforeThinLockInflation)
59RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
60 LongPauseLogThreshold, gc::Heap::kDefaultLongPauseLogThreshold)
61RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
62 LongGCLogThreshold, gc::Heap::kDefaultLongGCLogThreshold)
63RUNTIME_OPTIONS_KEY (Unit, DumpGCPerformanceOnShutdown)
Mathieu Chartiera4885cb2015-03-09 15:38:54 -070064RUNTIME_OPTIONS_KEY (Unit, DumpJITInfoOnShutdown)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080065RUNTIME_OPTIONS_KEY (Unit, IgnoreMaxFootprint)
66RUNTIME_OPTIONS_KEY (Unit, LowMemoryMode)
Hiroshi Yamauchi49b71342015-05-15 16:24:24 -070067RUNTIME_OPTIONS_KEY (bool, UseTLAB, (kUseTlab || kUseReadBarrier))
Igor Murashkinaaebaa02015-01-26 10:55:53 -080068RUNTIME_OPTIONS_KEY (bool, EnableHSpaceCompactForOOM, true)
Calin Juravleffc87072016-04-20 14:22:09 +010069RUNTIME_OPTIONS_KEY (bool, UseJitCompilation, false)
Nicolas Geoffraya73280d2016-02-15 13:05:16 +000070RUNTIME_OPTIONS_KEY (bool, DumpNativeStackOnSigQuit, true)
Igor Murashkinc449e8b2015-06-10 15:56:42 -070071RUNTIME_OPTIONS_KEY (unsigned int, JITCompileThreshold, jit::Jit::kDefaultCompileThreshold)
Nicolas Geoffray83f080a2016-03-08 16:50:21 +000072RUNTIME_OPTIONS_KEY (unsigned int, JITWarmupThreshold)
73RUNTIME_OPTIONS_KEY (unsigned int, JITOsrThreshold)
Calin Juravleb2771b42016-04-07 17:09:25 +010074RUNTIME_OPTIONS_KEY (unsigned int, JITPriorityThreadWeight)
Nicolas Geoffray0a3be162015-11-18 11:15:22 +000075RUNTIME_OPTIONS_KEY (MemoryKiB, JITCodeCacheInitialCapacity, jit::JitCodeCache::kInitialCapacity)
76RUNTIME_OPTIONS_KEY (MemoryKiB, JITCodeCacheMaxCapacity, jit::JitCodeCache::kMaxCapacity)
Calin Juravle31f2c152015-10-23 17:56:15 +010077RUNTIME_OPTIONS_KEY (bool, JITSaveProfilingInfo, false)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080078RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
79 HSpaceCompactForOOMMinIntervalsMs,\
80 MsToNs(100 * 1000)) // 100s
81RUNTIME_OPTIONS_KEY (std::vector<std::string>, \
82 PropertiesList) // -D<whatever> -D<whatever> ...
83RUNTIME_OPTIONS_KEY (std::string, JniTrace)
84RUNTIME_OPTIONS_KEY (std::string, PatchOat)
85RUNTIME_OPTIONS_KEY (bool, Relocate, kDefaultMustRelocate)
Nicolas Geoffraye722d292015-12-15 11:51:37 +000086RUNTIME_OPTIONS_KEY (bool, Dex2Oat, true)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080087RUNTIME_OPTIONS_KEY (bool, ImageDex2Oat, true)
Roland Levillain0d5a2812015-11-13 10:07:31 +000088RUNTIME_OPTIONS_KEY (bool, Interpret, false) // -Xint
Igor Murashkinaaebaa02015-01-26 10:55:53 -080089 // Disable the compiler for CC (for now).
90RUNTIME_OPTIONS_KEY (XGcOption, GcOption) // -Xgc:
91RUNTIME_OPTIONS_KEY (gc::space::LargeObjectSpaceType, \
92 LargeObjectSpace, gc::Heap::kDefaultLargeObjectSpaceType)
93RUNTIME_OPTIONS_KEY (Memory<1>, LargeObjectThreshold, gc::Heap::kDefaultLargeObjectThreshold)
94RUNTIME_OPTIONS_KEY (BackgroundGcOption, BackgroundGc)
95
96RUNTIME_OPTIONS_KEY (Unit, DisableExplicitGC)
Calin Juravle01aaf6e2015-06-19 22:05:39 +010097RUNTIME_OPTIONS_KEY (Unit, NoSigChain)
Calin Juravled3e7c6c2016-02-04 19:07:51 +000098RUNTIME_OPTIONS_KEY (Unit, ForceNativeBridge)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080099RUNTIME_OPTIONS_KEY (LogVerbosity, Verbose)
100RUNTIME_OPTIONS_KEY (unsigned int, LockProfThreshold)
101RUNTIME_OPTIONS_KEY (std::string, StackTraceFile)
102RUNTIME_OPTIONS_KEY (Unit, MethodTrace)
Calin Juravlef83e7332015-11-04 16:16:47 +0000103RUNTIME_OPTIONS_KEY (std::string, MethodTraceFile, "/data/misc/trace/method-trace-file.bin")
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800104RUNTIME_OPTIONS_KEY (unsigned int, MethodTraceFileSize, 10 * MB)
Andreas Gampe40da2862015-02-27 12:49:04 -0800105RUNTIME_OPTIONS_KEY (Unit, MethodTraceStreaming)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800106RUNTIME_OPTIONS_KEY (TraceClockSource, ProfileClock, kDefaultTraceClockSource) // -Xprofile:
107RUNTIME_OPTIONS_KEY (TestProfilerOptions, ProfilerOpts) // -Xenable-profiler, -Xprofile-*
108RUNTIME_OPTIONS_KEY (std::string, Compiler)
109RUNTIME_OPTIONS_KEY (std::vector<std::string>, \
110 CompilerOptions) // -Xcompiler-option ...
111RUNTIME_OPTIONS_KEY (std::vector<std::string>, \
112 ImageCompilerOptions) // -Ximage-compiler-option ...
Igor Murashkin7617abd2015-07-10 18:27:47 -0700113RUNTIME_OPTIONS_KEY (verifier::VerifyMode, \
114 Verify, verifier::VerifyMode::kEnable)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800115RUNTIME_OPTIONS_KEY (std::string, NativeBridge)
Igor Murashkinc449e8b2015-06-10 15:56:42 -0700116RUNTIME_OPTIONS_KEY (unsigned int, ZygoteMaxFailedBoots, 10)
117RUNTIME_OPTIONS_KEY (Unit, NoDexFileFallback)
Dmitriy Ivanov785049f2014-07-18 10:08:57 -0700118RUNTIME_OPTIONS_KEY (std::string, CpuAbiList)
Andreas Gampedd671252015-07-23 14:37:18 -0700119RUNTIME_OPTIONS_KEY (std::string, Fingerprint)
Neil Fuller9724c632016-01-07 15:42:47 +0000120RUNTIME_OPTIONS_KEY (ExperimentalFlags, Experimental, ExperimentalFlags::kNone) // -Xexperimental:{none, lambdas}
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800121
122// Not parse-able from command line, but can be provided explicitly.
Igor Murashkinc449e8b2015-06-10 15:56:42 -0700123// (Do not add anything here that is defined in ParsedOptions::MakeParser)
Vladimir Marko9bdf1082016-01-21 12:15:52 +0000124RUNTIME_OPTIONS_KEY (std::vector<std::unique_ptr<const DexFile>>*, \
125 BootClassPathDexList)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800126RUNTIME_OPTIONS_KEY (InstructionSet, ImageInstructionSet, kRuntimeISA)
127RUNTIME_OPTIONS_KEY (CompilerCallbacks*, CompilerCallbacksPtr) // TDOO: make unique_ptr
128RUNTIME_OPTIONS_KEY (bool (*)(), HookIsSensitiveThread)
129RUNTIME_OPTIONS_KEY (int32_t (*)(FILE* stream, const char* format, va_list ap), \
130 HookVfprintf, vfprintf)
131RUNTIME_OPTIONS_KEY (void (*)(int32_t status), \
132 HookExit, exit)
133 // We don't call abort(3) by default; see
134 // Runtime::Abort.
135RUNTIME_OPTIONS_KEY (void (*)(), HookAbort, nullptr)
Andreas Gampe29d38e72016-03-23 15:31:51 +0000136RUNTIME_OPTIONS_KEY (std::string, OatFileManagerCompilerFilter, "speed")
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800137
138#undef RUNTIME_OPTIONS_KEY