docs(heap_debug): Add missing information

- Place the section on alloc failed hook at a better place
- Add reference to the different poisoning configs at the beginning
  of the heap corruption detectino section
- Update the information concerning heap tracing
- Update the heap tracing log examples
- Fix heap tracing standalone code:
  - Update the logging format in heap_trace_dump_base
  - Add freed field in trace stucture to keep this info even
    when no call stack is available
This commit is contained in:
Guillaume Souchere
2024-08-20 14:34:41 +02:00
parent 43b0d1053c
commit 8e06c4ca6a
6 changed files with 218 additions and 99 deletions

View File

@@ -7,6 +7,7 @@
#include "sdkconfig.h"
#include "sys/queue.h"
#include <stdbool.h>
#include <stdint.h>
#include <esp_err.h>
@@ -34,6 +35,7 @@ typedef struct heap_trace_record_t {
uint32_t ccount; ///< CCOUNT of the CPU when the allocation was made. LSB (bit value 1) is the CPU number (0 or 1).
void *address; ///< Address which was allocated. If NULL, then this record is empty.
size_t size; ///< Size of the allocation
bool freed; ///< State of the allocation (false if not freed, true if freed)
void *alloced_by[CONFIG_HEAP_TRACING_STACK_DEPTH]; ///< Call stack of the caller which allocated the memory.
void *freed_by[CONFIG_HEAP_TRACING_STACK_DEPTH]; ///< Call stack of the caller which freed the memory (all zero if not freed.)
#if CONFIG_HEAP_TRACING_STANDALONE