mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The specific environment variable is SWIFT_DEBUG_RUNTIME_EXCLUSIVITY_LOGGING. We only check the environment the first time we try to lookup the TLSContext, so it shouldn't impact exclusivity performance. My intention is to use this to write some FileCheck tests so that we can really be sure that the runtime is doing what we think it is. As such I also changed the small amount of logging routines meant for use in the debugger to use stdout.
73 lines
2.7 KiB
C++
73 lines
2.7 KiB
C++
//===--- EnvironmentVariables.def - Debug variables. ------------*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines x-macros used for metaprogramming with the set of
|
|
// environment variables used for configuring or enabling debug features in the
|
|
// runtime.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// #define VARIABLE(name, type, defaultValue, help)
|
|
|
|
#ifndef VARIABLE
|
|
#error "Must define VARIABLE to include EnvironmentVariables.def"
|
|
#endif
|
|
|
|
VARIABLE(SWIFT_DEBUG_ENABLE_METADATA_ALLOCATION_ITERATION, bool, false,
|
|
"Enable additional metadata allocation tracking for swift-inspect to "
|
|
"use.")
|
|
|
|
VARIABLE(SWIFT_DEBUG_ENABLE_METADATA_BACKTRACE_LOGGING, bool, false,
|
|
"Enable logging of backtraces for each metadata allocation. Requires "
|
|
"SWIFT_DEBUG_ENABLE_METADATA_ALLOCATION_ITERATION to be enabled.")
|
|
|
|
VARIABLE(SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT, uint8_t, 2,
|
|
"Print warnings when using implicit @objc entrypoints. Set to "
|
|
"desired reporting level, 0-3.")
|
|
|
|
VARIABLE(SWIFT_DETERMINISTIC_HASHING, bool, false,
|
|
"Disable randomized hash seeding.")
|
|
|
|
VARIABLE(SWIFT_ENABLE_MANGLED_NAME_VERIFICATION, bool, false,
|
|
"Enable verification that metadata can roundtrip through a mangled "
|
|
"name each time metadata is instantiated.")
|
|
|
|
VARIABLE(SWIFT_DEBUG_ENABLE_MALLOC_SCRIBBLE, bool, false,
|
|
"Scribble on runtime allocations such as metadata allocations.")
|
|
|
|
VARIABLE(SWIFT_DEBUG_ENABLE_COW_CHECKS, bool, false,
|
|
"Enable internal checks for copy-on-write operations.")
|
|
|
|
VARIABLE(SWIFT_ENABLE_ASYNC_JOB_DISPATCH_INTEGRATION, bool, true,
|
|
"Enable use of dispatch_async_swift_job when available.")
|
|
|
|
#if defined(__APPLE__) && defined(__MACH__)
|
|
|
|
VARIABLE(SWIFT_DEBUG_VALIDATE_SHARED_CACHE_PROTOCOL_CONFORMANCES, bool, false,
|
|
"Validate shared cache protocol conformance results against the "
|
|
"lists of conformances in the shared cache images.")
|
|
|
|
VARIABLE(SWIFT_DEBUG_ENABLE_SHARED_CACHE_PROTOCOL_CONFORMANCES, bool, true,
|
|
"Enable querying precomputed protocol conformances in the shared "
|
|
"cache.")
|
|
|
|
#endif
|
|
|
|
#ifndef NDEBUG
|
|
|
|
VARIABLE(SWIFT_DEBUG_RUNTIME_EXCLUSIVITY_LOGGING, bool, false,
|
|
"Enable the an asserts runtime to emit logging as it works.")
|
|
|
|
#endif
|
|
|
|
#undef VARIABLE
|