runtime_options.def revision a4885cbaafd35fe9c60eb6cd95e41e2c86f54f66
1aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin/* 2aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * Copyright (C) 2015 The Android Open Source Project 3aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * 4aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * Licensed under the Apache License, Version 2.0 (the "License") 5aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * you may not use this file except in compliance with the License. 6aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * You may obtain a copy of the License at 7aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * 8aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * http://www.apache.org/licenses/LICENSE-2.0 9aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * 10aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * Unless required by applicable law or agreed to in writing, software 11aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * distributed under the License is distributed on an "AS IS" BASIS, 12aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * See the License for the specific language governing permissions and 14aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin * limitations under the License. 15aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin */ 16aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin 17aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin#ifndef RUNTIME_OPTIONS_KEY 18aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin#error "Please #define RUNTIME_OPTIONS_KEY before #including this file" 19aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin#define RUNTIME_OPTIONS_KEY(...) // Don't display errors in this file in IDEs. 20aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin#endif 21aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin 22aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// This file defines the list of keys for RuntimeOptions. 23aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// These can be used with RuntimeOptions.Get/Set/etc, for example: 24aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// RuntimeOptions opt; bool* dex2oat_enabled = opt.Get(RuntimeOptions::Dex2Oat); 25aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// 26aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// Column Descriptions: 27aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// <<Type>> <<Key Name>> <<Default Value>> 28aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// 29aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// Default values are only used by Map::GetOrDefault(K<T>). 30aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// If a default value is omitted here, T{} is used as the default value, which is 31aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// almost-always the value of the type as if it was memset to all 0. 32aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// 33aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin 34aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// Parse-able keys from the command line. 35aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit, Zygote) 36aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit, Help) 37aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit, ShowVersion) 38aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string, BootClassPath) 39aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (ParseStringList<':'>,BootClassPathLocations) // std::vector<std::string> 40aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string, ClassPath) 41aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string, Image) 42aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit, CheckJni) 43aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit, JniOptsForceCopy) 44aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (JDWP::JdwpOptions, JdwpOptions) 45aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MemoryKiB, MemoryMaximumSize, gc::Heap::kDefaultMaximumSize) // -Xmx 46aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MemoryKiB, MemoryInitialSize, gc::Heap::kDefaultInitialSize) // -Xms 47aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MemoryKiB, HeapGrowthLimit) // Default is 0 for unlimited 48aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MemoryKiB, HeapMinFree, gc::Heap::kDefaultMinFree) 49aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MemoryKiB, HeapMaxFree, gc::Heap::kDefaultMaxFree) 50aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MemoryKiB, NonMovingSpaceCapacity, gc::Heap::kDefaultNonMovingSpaceCapacity) 51aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (double, HeapTargetUtilization, gc::Heap::kDefaultTargetUtilization) 52aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (double, ForegroundHeapGrowthMultiplier, gc::Heap::kDefaultHeapGrowthMultiplier) 53aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (unsigned int, ParallelGCThreads, 1u) 54aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (unsigned int, ConcGCThreads) 55aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Memory<1>, StackSize) // -Xss 56aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (unsigned int, MaxSpinsBeforeThinLockInflation,Monitor::kDefaultMaxSpinsBeforeThinLockInflation) 57aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \ 58aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin LongPauseLogThreshold, gc::Heap::kDefaultLongPauseLogThreshold) 59aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \ 60aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin LongGCLogThreshold, gc::Heap::kDefaultLongGCLogThreshold) 61aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit, DumpGCPerformanceOnShutdown) 62a4885cbaafd35fe9c60eb6cd95e41e2c86f54f66Mathieu ChartierRUNTIME_OPTIONS_KEY (Unit, DumpJITInfoOnShutdown) 63aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit, IgnoreMaxFootprint) 64aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit, LowMemoryMode) 65f360ad091bdc1484db2e4e0f0492f620402dbf58Hiroshi YamauchiRUNTIME_OPTIONS_KEY (bool, UseTLAB, false) 66aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (bool, EnableHSpaceCompactForOOM, true) 67e5f13e57ff8fa36342beb33830b3ec5942a61ccaMathieu ChartierRUNTIME_OPTIONS_KEY (bool, UseJIT, false) 68e5f13e57ff8fa36342beb33830b3ec5942a61ccaMathieu ChartierRUNTIME_OPTIONS_KEY (unsigned int, JITCompileThreshold, jit::Jit::kDefaultCompileThreshold) 69e5f13e57ff8fa36342beb33830b3ec5942a61ccaMathieu ChartierRUNTIME_OPTIONS_KEY (MemoryKiB, JITCodeCacheCapacity, jit::JitCodeCache::kDefaultCapacity) 70aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \ 71aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin HSpaceCompactForOOMMinIntervalsMs,\ 72aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin MsToNs(100 * 1000)) // 100s 73aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::vector<std::string>, \ 74aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin PropertiesList) // -D<whatever> -D<whatever> ... 75aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string, JniTrace) 76aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string, PatchOat) 77aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (bool, Relocate, kDefaultMustRelocate) 78aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (bool, Dex2Oat, true) 79aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (bool, ImageDex2Oat, true) 80aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin // kPoisonHeapReferences currently works with 81aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin // the interpreter only. 82aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin // TODO: make it work with the compiler. 83aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (bool, Interpret, (kPoisonHeapReferences || kUseReadBarrier)) // -Xint 84aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin // Disable the compiler for CC (for now). 85aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (XGcOption, GcOption) // -Xgc: 86aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (gc::space::LargeObjectSpaceType, \ 87aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin LargeObjectSpace, gc::Heap::kDefaultLargeObjectSpaceType) 88aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Memory<1>, LargeObjectThreshold, gc::Heap::kDefaultLargeObjectThreshold) 89aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (BackgroundGcOption, BackgroundGc) 90aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin 91aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit, DisableExplicitGC) 92aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (LogVerbosity, Verbose) 93aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (unsigned int, LockProfThreshold) 94aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string, StackTraceFile) 95aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (Unit, MethodTrace) 96aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string, MethodTraceFile, "/data/method-trace-file.bin") 97aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (unsigned int, MethodTraceFileSize, 10 * MB) 98aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (TraceClockSource, ProfileClock, kDefaultTraceClockSource) // -Xprofile: 99aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (TestProfilerOptions, ProfilerOpts) // -Xenable-profiler, -Xprofile-* 100aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string, Compiler) 101aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::vector<std::string>, \ 102aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin CompilerOptions) // -Xcompiler-option ... 103aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::vector<std::string>, \ 104aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin ImageCompilerOptions) // -Ximage-compiler-option ... 105aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (bool, Verify, true) 106aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (std::string, NativeBridge) 107aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin 108aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin// Not parse-able from command line, but can be provided explicitly. 109aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (const std::vector<const DexFile*>*, \ 110aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin BootClassPathDexList) // TODO: make unique_ptr 111aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (InstructionSet, ImageInstructionSet, kRuntimeISA) 112aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (CompilerCallbacks*, CompilerCallbacksPtr) // TDOO: make unique_ptr 113aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (bool (*)(), HookIsSensitiveThread) 114aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (int32_t (*)(FILE* stream, const char* format, va_list ap), \ 115aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin HookVfprintf, vfprintf) 116aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (void (*)(int32_t status), \ 117aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin HookExit, exit) 118aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin // We don't call abort(3) by default; see 119aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin // Runtime::Abort. 120aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor MurashkinRUNTIME_OPTIONS_KEY (void (*)(), HookAbort, nullptr) 1215a2be3f40125af8b25fbbd9d55dc968168c76ed7Narayan KamathRUNTIME_OPTIONS_KEY (unsigned int, ZygoteMaxFailedBoots, 1) 12224e04aa68c575d349eac0d9d09aab9bd3106ef94Jean Christophe BeylerRUNTIME_OPTIONS_KEY (Unit, NoDexFileFallback) 123aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin 124aaebaa0121be3b9d9f13630585304482cbcaeb4bIgor Murashkin#undef RUNTIME_OPTIONS_KEY 125