Path: blob/main/contrib/llvm-project/compiler-rt/lib/memprof/memprof_flags.h
35236 views
//===-- memprof_flags.h ---------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file is a part of MemProfiler, a memory profiler.9//10// MemProf runtime flags.11//===----------------------------------------------------------------------===//1213#ifndef MEMPROF_FLAGS_H14#define MEMPROF_FLAGS_H1516#include "sanitizer_common/sanitizer_flag_parser.h"17#include "sanitizer_common/sanitizer_internal_defs.h"1819// MemProf flag values can be defined in four ways:20// 1) initialized with default values at startup.21// 2) overriden during compilation of MemProf runtime by providing22// compile definition MEMPROF_DEFAULT_OPTIONS.23// 3) overriden from string returned by user-specified function24// __memprof_default_options().25// 4) overriden from env variable MEMPROF_OPTIONS.2627namespace __memprof {2829struct Flags {30#define MEMPROF_FLAG(Type, Name, DefaultValue, Description) Type Name;31#include "memprof_flags.inc"32#undef MEMPROF_FLAG3334void SetDefaults();35};3637extern Flags memprof_flags_dont_use_directly;38inline Flags *flags() { return &memprof_flags_dont_use_directly; }3940void InitializeFlags();4142} // namespace __memprof4344#endif // MEMPROF_FLAGS_H454647