2017-05-08 01:25:30 -04:00
|
|
|
menu "Heap memory debugging"
|
|
|
|
|
2019-01-25 11:10:53 -05:00
|
|
|
choice HEAP_CORRUPTION_DETECTION
|
|
|
|
prompt "Heap corruption detection"
|
|
|
|
default HEAP_POISONING_DISABLED
|
|
|
|
help
|
|
|
|
Enable heap poisoning features to detect heap corruption caused by out-of-bounds access to heap memory.
|
|
|
|
|
|
|
|
See the "Heap Memory Debugging" page of the IDF documentation
|
|
|
|
for a description of each level of heap corruption detection.
|
|
|
|
|
|
|
|
config HEAP_POISONING_DISABLED
|
|
|
|
bool "Basic (no poisoning)"
|
|
|
|
config HEAP_POISONING_LIGHT
|
|
|
|
bool "Light impact"
|
|
|
|
config HEAP_POISONING_COMPREHENSIVE
|
|
|
|
bool "Comprehensive"
|
|
|
|
endchoice
|
|
|
|
|
2018-12-12 12:29:47 -05:00
|
|
|
choice HEAP_TRACING_DEST
|
|
|
|
bool "Heap tracing"
|
|
|
|
default HEAP_TRACING_OFF
|
2019-01-25 11:10:53 -05:00
|
|
|
help
|
|
|
|
Enables the heap tracing API defined in esp_heap_trace.h.
|
|
|
|
|
|
|
|
This function causes a moderate increase in IRAM code side and a minor increase in heap function
|
2018-12-12 12:29:47 -05:00
|
|
|
(malloc/free/realloc) CPU overhead, even when the tracing feature is not used.
|
|
|
|
So it's best to keep it disabled unless tracing is being used.
|
|
|
|
|
|
|
|
config HEAP_TRACING_OFF
|
|
|
|
bool "Disabled"
|
|
|
|
config HEAP_TRACING_STANDALONE
|
|
|
|
bool "Standalone"
|
|
|
|
select HEAP_TRACING
|
|
|
|
config HEAP_TRACING_TOHOST
|
|
|
|
bool "Host-based"
|
|
|
|
select HEAP_TRACING
|
|
|
|
endchoice
|
|
|
|
|
|
|
|
config HEAP_TRACING
|
|
|
|
bool
|
|
|
|
default F
|
|
|
|
help
|
|
|
|
Enables/disables heap tracing API.
|
2019-01-25 11:10:53 -05:00
|
|
|
|
|
|
|
config HEAP_TRACING_STACK_DEPTH
|
|
|
|
int "Heap tracing stack depth"
|
2021-06-11 03:38:11 -04:00
|
|
|
range 0 0 if IDF_TARGET_ARCH_RISCV # Disabled for RISC-V due to `__builtin_return_address` limitation
|
|
|
|
default 0 if IDF_TARGET_ARCH_RISCV
|
2019-01-25 11:10:53 -05:00
|
|
|
range 0 10
|
|
|
|
default 2
|
|
|
|
depends on HEAP_TRACING
|
|
|
|
help
|
|
|
|
Number of stack frames to save when tracing heap operation callers.
|
|
|
|
|
|
|
|
More stack frames uses more memory in the heap trace buffer (and slows down allocation), but
|
|
|
|
can provide useful information.
|
|
|
|
|
2023-03-08 04:48:17 -05:00
|
|
|
config HEAP_USE_HOOKS
|
|
|
|
bool "Use allocation and free hooks"
|
|
|
|
help
|
|
|
|
Enable the user to implement function hooks triggered for each successful allocation and free.
|
|
|
|
|
2019-01-25 11:10:53 -05:00
|
|
|
config HEAP_TASK_TRACKING
|
|
|
|
bool "Enable heap task tracking"
|
|
|
|
depends on !HEAP_POISONING_DISABLED
|
|
|
|
help
|
|
|
|
Enables tracking the task responsible for each heap allocation.
|
|
|
|
|
|
|
|
This function depends on heap poisoning being enabled and adds four more bytes of overhead for each block
|
|
|
|
allocated.
|
2018-01-10 04:14:47 -05:00
|
|
|
|
2023-03-01 06:42:14 -05:00
|
|
|
config HEAP_TRACE_HASH_MAP
|
|
|
|
bool "Use hash map mechanism to access heap trace records"
|
|
|
|
depends on HEAP_TRACING_STANDALONE
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
Enable this flag to use a hash map to increase performance in handling
|
|
|
|
heap trace records.
|
|
|
|
|
|
|
|
Keeping this as "n" in your project will save RAM and heap memory but will lower
|
|
|
|
the performance of the heap trace in adding, retrieving and removing trace records.
|
|
|
|
Making this as "y" in your project, you will decrease free RAM and heap memory but,
|
|
|
|
the heap trace performances in adding retrieving and removing trace records will be
|
|
|
|
enhanced.
|
|
|
|
|
2023-04-12 06:17:00 -04:00
|
|
|
config HEAP_TRACE_HASH_MAP_IN_EXT_RAM
|
|
|
|
bool "Place hash map in the bss section of the external RAM"
|
|
|
|
depends on HEAP_TRACE_HASH_MAP && SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
When enabled this configuration forces the hash map to be placed in the bss section
|
|
|
|
of the external RAM.
|
|
|
|
|
|
|
|
Note that this functionality can only be enabled when CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
|
|
|
|
is enabled.
|
|
|
|
|
2023-03-01 06:42:14 -05:00
|
|
|
config HEAP_TRACE_HASH_MAP_SIZE
|
|
|
|
int "The number of entries in the hash map"
|
|
|
|
depends on HEAP_TRACE_HASH_MAP
|
|
|
|
default 10
|
|
|
|
help
|
2023-03-30 06:37:51 -04:00
|
|
|
Defines the number of entries in the heap trace hashmap. The bigger this number is,
|
|
|
|
the bigger the hash map will be in the memory. In case the tracing mode is set to
|
|
|
|
HEAP_TRACE_ALL, the bigger the hashmap is, the better the performances are.
|
2023-03-01 06:42:14 -05:00
|
|
|
|
2020-04-27 16:09:15 -04:00
|
|
|
config HEAP_ABORT_WHEN_ALLOCATION_FAILS
|
|
|
|
bool "Abort if memory allocation fails"
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
When enabled, if a memory allocation operation fails it will cause a system abort.
|
|
|
|
|
2022-05-06 07:20:05 -04:00
|
|
|
config HEAP_TLSF_USE_ROM_IMPL
|
|
|
|
bool "Use ROM implementation of heap tlsf library"
|
|
|
|
depends on ESP_ROM_HAS_HEAP_TLSF
|
2021-03-19 05:29:42 -04:00
|
|
|
default y
|
|
|
|
help
|
|
|
|
Enable this flag to use heap functions from ROM instead of ESP-IDF.
|
|
|
|
|
|
|
|
If keeping this as "n" in your project, you will have less free IRAM.
|
|
|
|
If making this as "y" in your project, you will increase free IRAM,
|
|
|
|
but you will lose the possibility to debug this module, and some new
|
|
|
|
features will be added and bugs will be fixed in the IDF source
|
|
|
|
but cannot be synced to ROM.
|
|
|
|
|
2023-04-03 09:16:55 -04:00
|
|
|
config HEAP_PLACE_FUNCTION_INTO_FLASH
|
|
|
|
bool "Force the entire heap component to be placed in flash memory"
|
|
|
|
depends on !HEAP_TLSF_USE_ROM_IMPL
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
Enable this flag to save up RAM space by placing the heap component in the flash memory
|
|
|
|
|
|
|
|
Note that it is only safe to enable this configuration if no functions from esp_heap_caps.h
|
|
|
|
or esp_heap_trace.h are called from ISR.
|
2017-05-08 01:25:30 -04:00
|
|
|
endmenu
|