xref: /freebsd/contrib/llvm-project/compiler-rt/lib/memprof/memprof_flags.inc (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1e8d8bef9SDimitry Andric//===-- memprof_flags.inc --------------------------------------*- C++ -*-===//
2e8d8bef9SDimitry Andric//
3e8d8bef9SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4e8d8bef9SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
5e8d8bef9SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6e8d8bef9SDimitry Andric//
7e8d8bef9SDimitry Andric//===----------------------------------------------------------------------===//
8e8d8bef9SDimitry Andric//
9e8d8bef9SDimitry Andric// MemProf runtime flags.
10e8d8bef9SDimitry Andric//
11e8d8bef9SDimitry Andric//===----------------------------------------------------------------------===//
12e8d8bef9SDimitry Andric#ifndef MEMPROF_FLAG
13e8d8bef9SDimitry Andric#error "Define MEMPROF_FLAG prior to including this file!"
14e8d8bef9SDimitry Andric#endif
15e8d8bef9SDimitry Andric
16e8d8bef9SDimitry Andric// MEMPROF_FLAG(Type, Name, DefaultValue, Description)
17e8d8bef9SDimitry Andric// See COMMON_FLAG in sanitizer_flags.inc for more details.
18e8d8bef9SDimitry Andric
19e8d8bef9SDimitry AndricMEMPROF_FLAG(bool, unmap_shadow_on_exit, false,
20e8d8bef9SDimitry Andric             "If set, explicitly unmaps the (huge) shadow at exit.")
21e8d8bef9SDimitry AndricMEMPROF_FLAG(bool, protect_shadow_gap, true, "If set, mprotect the shadow gap")
22e8d8bef9SDimitry AndricMEMPROF_FLAG(bool, print_legend, true, "Print the legend for the shadow bytes.")
23e8d8bef9SDimitry AndricMEMPROF_FLAG(bool, atexit, false,
24e8d8bef9SDimitry Andric             "If set, prints MemProf exit stats even after program terminates "
25e8d8bef9SDimitry Andric             "successfully.")
26e8d8bef9SDimitry AndricMEMPROF_FLAG(
27e8d8bef9SDimitry Andric    bool, print_full_thread_history, true,
28e8d8bef9SDimitry Andric    "If set, prints thread creation stacks for the threads involved in the "
29e8d8bef9SDimitry Andric    "report and their ancestors up to the main thread.")
30e8d8bef9SDimitry Andric
31e8d8bef9SDimitry AndricMEMPROF_FLAG(bool, halt_on_error, true,
32e8d8bef9SDimitry Andric             "Crash the program after printing the first error report "
33e8d8bef9SDimitry Andric             "(WARNING: USE AT YOUR OWN RISK!)")
34e8d8bef9SDimitry AndricMEMPROF_FLAG(bool, allocator_frees_and_returns_null_on_realloc_zero, true,
35e8d8bef9SDimitry Andric             "realloc(p, 0) is equivalent to free(p) by default (Same as the "
36e8d8bef9SDimitry Andric             "POSIX standard). If set to false, realloc(p, 0) will return a "
37e8d8bef9SDimitry Andric             "pointer to an allocated space which can not be used.")
38*349cc55cSDimitry AndricMEMPROF_FLAG(bool, print_text, false,
39*349cc55cSDimitry Andric  "If set, prints the heap profile in text format. Else use the raw binary serialization format.")
40e8d8bef9SDimitry AndricMEMPROF_FLAG(bool, print_terse, false,
41*349cc55cSDimitry Andric             "If set, prints memory profile in a terse format. Only applicable if print_text = true.")