memprof_flags.inc 2.0 KB

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