blob: 339f925f5587e82de84f3c1ccd492e0b4ccaf52c [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//
33
34// Parse-able keys from the command line.
35RUNTIME_OPTIONS_KEY (Unit, Zygote)
36RUNTIME_OPTIONS_KEY (Unit, Help)
37RUNTIME_OPTIONS_KEY (Unit, ShowVersion)
38RUNTIME_OPTIONS_KEY (std::string, BootClassPath)
39RUNTIME_OPTIONS_KEY (ParseStringList<':'>,BootClassPathLocations) // std::vector<std::string>
40RUNTIME_OPTIONS_KEY (std::string, ClassPath)
41RUNTIME_OPTIONS_KEY (std::string, Image)
42RUNTIME_OPTIONS_KEY (Unit, CheckJni)
43RUNTIME_OPTIONS_KEY (Unit, JniOptsForceCopy)
44RUNTIME_OPTIONS_KEY (JDWP::JdwpOptions, JdwpOptions)
45RUNTIME_OPTIONS_KEY (MemoryKiB, MemoryMaximumSize, gc::Heap::kDefaultMaximumSize) // -Xmx
46RUNTIME_OPTIONS_KEY (MemoryKiB, MemoryInitialSize, gc::Heap::kDefaultInitialSize) // -Xms
47RUNTIME_OPTIONS_KEY (MemoryKiB, HeapGrowthLimit) // Default is 0 for unlimited
48RUNTIME_OPTIONS_KEY (MemoryKiB, HeapMinFree, gc::Heap::kDefaultMinFree)
49RUNTIME_OPTIONS_KEY (MemoryKiB, HeapMaxFree, gc::Heap::kDefaultMaxFree)
50RUNTIME_OPTIONS_KEY (MemoryKiB, NonMovingSpaceCapacity, gc::Heap::kDefaultNonMovingSpaceCapacity)
51RUNTIME_OPTIONS_KEY (double, HeapTargetUtilization, gc::Heap::kDefaultTargetUtilization)
52RUNTIME_OPTIONS_KEY (double, ForegroundHeapGrowthMultiplier, gc::Heap::kDefaultHeapGrowthMultiplier)
53RUNTIME_OPTIONS_KEY (unsigned int, ParallelGCThreads, 1u)
54RUNTIME_OPTIONS_KEY (unsigned int, ConcGCThreads)
55RUNTIME_OPTIONS_KEY (Memory<1>, StackSize) // -Xss
56RUNTIME_OPTIONS_KEY (unsigned int, MaxSpinsBeforeThinLockInflation,Monitor::kDefaultMaxSpinsBeforeThinLockInflation)
57RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
58 LongPauseLogThreshold, gc::Heap::kDefaultLongPauseLogThreshold)
59RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
60 LongGCLogThreshold, gc::Heap::kDefaultLongGCLogThreshold)
61RUNTIME_OPTIONS_KEY (Unit, DumpGCPerformanceOnShutdown)
Mathieu Chartiera4885cb2015-03-09 15:38:54 -070062RUNTIME_OPTIONS_KEY (Unit, DumpJITInfoOnShutdown)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080063RUNTIME_OPTIONS_KEY (Unit, IgnoreMaxFootprint)
64RUNTIME_OPTIONS_KEY (Unit, LowMemoryMode)
Hiroshi Yamauchi79bd2bf2015-03-20 10:28:34 -070065RUNTIME_OPTIONS_KEY (bool, UseTLAB, kUseTlab)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080066RUNTIME_OPTIONS_KEY (bool, EnableHSpaceCompactForOOM, true)
Mathieu Chartiere5f13e52015-02-24 09:37:21 -080067RUNTIME_OPTIONS_KEY (bool, UseJIT, false)
68RUNTIME_OPTIONS_KEY (unsigned int, JITCompileThreshold, jit::Jit::kDefaultCompileThreshold)
69RUNTIME_OPTIONS_KEY (MemoryKiB, JITCodeCacheCapacity, jit::JitCodeCache::kDefaultCapacity)
Igor Murashkinaaebaa02015-01-26 10:55:53 -080070RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
71 HSpaceCompactForOOMMinIntervalsMs,\
72 MsToNs(100 * 1000)) // 100s
73RUNTIME_OPTIONS_KEY (std::vector<std::string>, \
74 PropertiesList) // -D<whatever> -D<whatever> ...
75RUNTIME_OPTIONS_KEY (std::string, JniTrace)
76RUNTIME_OPTIONS_KEY (std::string, PatchOat)
77RUNTIME_OPTIONS_KEY (bool, Relocate, kDefaultMustRelocate)
78RUNTIME_OPTIONS_KEY (bool, Dex2Oat, true)
79RUNTIME_OPTIONS_KEY (bool, ImageDex2Oat, true)
80 // kPoisonHeapReferences currently works with
81 // the interpreter only.
82 // TODO: make it work with the compiler.
83RUNTIME_OPTIONS_KEY (bool, Interpret, (kPoisonHeapReferences || kUseReadBarrier)) // -Xint
84 // Disable the compiler for CC (for now).
85RUNTIME_OPTIONS_KEY (XGcOption, GcOption) // -Xgc:
86RUNTIME_OPTIONS_KEY (gc::space::LargeObjectSpaceType, \
87 LargeObjectSpace, gc::Heap::kDefaultLargeObjectSpaceType)
88RUNTIME_OPTIONS_KEY (Memory<1>, LargeObjectThreshold, gc::Heap::kDefaultLargeObjectThreshold)
89RUNTIME_OPTIONS_KEY (BackgroundGcOption, BackgroundGc)
90
91RUNTIME_OPTIONS_KEY (Unit, DisableExplicitGC)
92RUNTIME_OPTIONS_KEY (LogVerbosity, Verbose)
93RUNTIME_OPTIONS_KEY (unsigned int, LockProfThreshold)
94RUNTIME_OPTIONS_KEY (std::string, StackTraceFile)
95RUNTIME_OPTIONS_KEY (Unit, MethodTrace)
96RUNTIME_OPTIONS_KEY (std::string, MethodTraceFile, "/data/method-trace-file.bin")
97RUNTIME_OPTIONS_KEY (unsigned int, MethodTraceFileSize, 10 * MB)
98RUNTIME_OPTIONS_KEY (TraceClockSource, ProfileClock, kDefaultTraceClockSource) // -Xprofile:
99RUNTIME_OPTIONS_KEY (TestProfilerOptions, ProfilerOpts) // -Xenable-profiler, -Xprofile-*
100RUNTIME_OPTIONS_KEY (std::string, Compiler)
101RUNTIME_OPTIONS_KEY (std::vector<std::string>, \
102 CompilerOptions) // -Xcompiler-option ...
103RUNTIME_OPTIONS_KEY (std::vector<std::string>, \
104 ImageCompilerOptions) // -Ximage-compiler-option ...
105RUNTIME_OPTIONS_KEY (bool, Verify, true)
106RUNTIME_OPTIONS_KEY (std::string, NativeBridge)
Dmitriy Ivanov785049f2014-07-18 10:08:57 -0700107RUNTIME_OPTIONS_KEY (std::string, CpuAbiList)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800108
109// Not parse-able from command line, but can be provided explicitly.
110RUNTIME_OPTIONS_KEY (const std::vector<const DexFile*>*, \
111 BootClassPathDexList) // TODO: make unique_ptr
112RUNTIME_OPTIONS_KEY (InstructionSet, ImageInstructionSet, kRuntimeISA)
113RUNTIME_OPTIONS_KEY (CompilerCallbacks*, CompilerCallbacksPtr) // TDOO: make unique_ptr
114RUNTIME_OPTIONS_KEY (bool (*)(), HookIsSensitiveThread)
115RUNTIME_OPTIONS_KEY (int32_t (*)(FILE* stream, const char* format, va_list ap), \
116 HookVfprintf, vfprintf)
117RUNTIME_OPTIONS_KEY (void (*)(int32_t status), \
118 HookExit, exit)
119 // We don't call abort(3) by default; see
120 // Runtime::Abort.
121RUNTIME_OPTIONS_KEY (void (*)(), HookAbort, nullptr)
Andreas Gampe9106e522015-03-31 14:54:03 -0700122RUNTIME_OPTIONS_KEY (unsigned int, ZygoteMaxFailedBoots, 10)
Jean Christophe Beyler24e04aa2014-09-12 12:03:25 -0700123RUNTIME_OPTIONS_KEY (Unit, NoDexFileFallback)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800124
125#undef RUNTIME_OPTIONS_KEY