diff options
author | Christopher Ferris <cferris@google.com> | 2018-05-25 12:46:55 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2018-05-25 13:28:05 -0700 |
commit | 770cbb35cf3441770ce8a808f864beb68b0091cb (patch) | |
tree | 172e8ed21d5c6027f93313bc65d9c4cb329b7e7e /libc/malloc_debug/Config.cpp | |
parent | 8aa6d67f2d48aa01f099a85adc432097a13172f1 (diff) |
Point to online documentation.
Test: Unit tests pass.
Change-Id: Ibbdc260bfdf6a6daf091c4a49cdf03e51f6ca6cf
Diffstat (limited to 'libc/malloc_debug/Config.cpp')
-rw-r--r-- | libc/malloc_debug/Config.cpp | 116 |
1 files changed, 2 insertions, 114 deletions
diff --git a/libc/malloc_debug/Config.cpp b/libc/malloc_debug/Config.cpp index 96fc27f73..926b26581 100644 --- a/libc/malloc_debug/Config.cpp +++ b/libc/malloc_debug/Config.cpp @@ -319,120 +319,8 @@ bool Config::VerifyValueEmpty(const std::string& option, const std::string& valu } void Config::LogUsage() const { - error_log("malloc debug options usage:"); - error_log(""); - error_log(" front_guard[=XX]"); - error_log(" Enables a front guard on all allocations. If XX is set"); - error_log(" it sets the number of bytes in the guard. The default is"); - error_log(" %zu bytes, the max bytes is %zu.", DEFAULT_GUARD_BYTES, MAX_GUARD_BYTES); - error_log(""); - error_log(" rear_guard[=XX]"); - error_log(" Enables a rear guard on all allocations. If XX is set"); - error_log(" it sets the number of bytes in the guard. The default is"); - error_log(" %zu bytes, the max bytes is %zu.", DEFAULT_GUARD_BYTES, MAX_GUARD_BYTES); - error_log(""); - error_log(" guard[=XX]"); - error_log(" Enables both a front guard and a rear guard on all allocations."); - error_log(" If XX is set it sets the number of bytes in both guards."); - error_log(" The default is %zu bytes, the max bytes is %zu.", DEFAULT_GUARD_BYTES, - MAX_GUARD_BYTES); - error_log(""); - error_log(" backtrace[=XX]"); - error_log(" Enable capturing the backtrace at the point of allocation."); - error_log(" If XX is set it sets the number of backtrace frames."); - error_log(" This option also enables dumping the backtrace heap data"); - error_log(" when a signal is received. The data is dumped to the file"); - error_log(" backtrace_dump_prefix.<PID>.txt."); - error_log(" The default is %zu frames, the max number of frames is %zu.", - DEFAULT_BACKTRACE_FRAMES, MAX_BACKTRACE_FRAMES); - error_log(""); - error_log(" backtrace_enable_on_signal[=XX]"); - error_log(" Enable capturing the backtrace at the point of allocation."); - error_log(" The backtrace capture is not enabled until the process"); - error_log(" receives a signal. If XX is set it sets the number of backtrace"); - error_log(" frames. The default is %zu frames, the max number of frames is %zu.", - DEFAULT_BACKTRACE_FRAMES, MAX_BACKTRACE_FRAMES); - error_log(""); - error_log(" backtrace_dump_prefix[=FILE]"); - error_log(" This option only has meaning if the backtrace option has been specified."); - error_log(" This is the prefix of the name of the file to which backtrace heap"); - error_log(" data will be dumped. The file will be named backtrace_dump_prefix.<PID>.txt."); - error_log(" The default is %s.", DEFAULT_BACKTRACE_DUMP_PREFIX); - - error_log(""); - error_log(" backtrace_dump_on_exit"); - error_log(" This option only has meaning if the backtrace option has been specified."); - error_log(" This will cause all live allocations to be dumped to the file"); - error_log(" backtrace_dump_prefix.<PID>.final.txt."); - error_log(" The default is false."); - error_log(""); - error_log(" backtrace_full"); - error_log(" Any time a backtrace is acquired, use an unwinder that can"); - error_log(" display Java stack frames. This unwinder can run slower than"); - error_log(" normal unwinder."); - error_log(""); - error_log(" fill_on_alloc[=XX]"); - error_log(" On first allocation, fill with the value 0x%02x.", DEFAULT_FILL_ALLOC_VALUE); - error_log(" If XX is set it will only fill up to XX bytes of the"); - error_log(" allocation. The default is to fill the entire allocation."); - error_log(""); - error_log(" fill_on_free[=XX]"); - error_log(" On free, fill with the value 0x%02x. If XX is set it will", - DEFAULT_FILL_FREE_VALUE); - error_log(" only fill up to XX bytes of the allocation. The default is to"); - error_log(" fill the entire allocation."); - error_log(""); - error_log(" fill[=XX]"); - error_log(" On both first allocation free, fill with the value 0x%02x on", - DEFAULT_FILL_ALLOC_VALUE); - error_log(" first allocation and the value 0x%02x. If XX is set, only fill", - DEFAULT_FILL_FREE_VALUE); - error_log(" up to XX bytes. The default is to fill the entire allocation."); - error_log(""); - error_log(" expand_alloc[=XX]"); - error_log(" Allocate an extra number of bytes for every allocation call."); - error_log(" If XX is set, that is the number of bytes to expand the"); - error_log(" allocation by. The default is %zu bytes, the max bytes is %zu.", - DEFAULT_EXPAND_BYTES, MAX_EXPAND_BYTES); - error_log(""); - error_log(" free_track[=XX]"); - error_log(" When a pointer is freed, do not free the memory right away."); - error_log(" Instead, keep XX of these allocations around and then verify"); - error_log(" that they have not been modified when the total number of freed"); - error_log(" allocations exceeds the XX amount. When the program terminates,"); - error_log(" the rest of these allocations are verified. When this option is"); - error_log(" enabled, it automatically records the backtrace at the time of the free."); - error_log(" The default is to record %zu allocations, the max allocations", - DEFAULT_FREE_TRACK_ALLOCATIONS); - error_log(" to record is %zu.", MAX_FREE_TRACK_ALLOCATIONS); - error_log(""); - error_log(" free_track_backtrace_num_frames[=XX]"); - error_log(" This option only has meaning if free_track is set. This indicates"); - error_log(" how many backtrace frames to capture when an allocation is freed."); - error_log(" If XX is set, that is the number of frames to capture. If XX"); - error_log(" is set to zero, then no backtrace will be captured."); - error_log(" The default is to record %zu frames, the max number of frames is %zu.", - DEFAULT_BACKTRACE_FRAMES, MAX_BACKTRACE_FRAMES); - error_log(""); - error_log(" leak_track"); - error_log(" Enable the leak tracking of memory allocations."); - error_log(""); - error_log(" record_allocs[=XX]"); - error_log(" Record every single allocation/free call. When a specific signal"); - error_log(" is sent to the process, the contents of recording are written to"); - error_log(" a file (%s) and the recording is cleared.", DEFAULT_RECORD_ALLOCS_FILE); - error_log(" If XX is set, that is the total number of allocations/frees that can"); - error_log(" recorded. of frames to capture. The default value is %zu.", DEFAULT_RECORD_ALLOCS); - error_log(" If the allocation list fills up, all further allocations are not recorded."); - error_log(""); - error_log(" record_allocs_file[=FILE]"); - error_log(" This option only has meaning if the record_allocs options has been specified."); - error_log(" This is the name of the file to which recording information will be dumped."); - error_log(" The default is %s.", DEFAULT_RECORD_ALLOCS_FILE); - error_log(""); - error_log(" verify_pointers"); - error_log(" A lightweight way to verify that free/malloc_usable_size/realloc"); - error_log(" are passed valid pointers."); + error_log("For malloc debug option descriptions go to:"); + error_log(" https://android.googlesource.com/platform/bionic/+/master/libc/malloc_debug/README.md"); } bool Config::GetOption(const char** options_str, std::string* option, std::string* value) { |