Heap debug

API Reference

Functions

int heap_trace_is_on(void)

Check if heap trace is on.

Return
true if on or false

esp_err_t heap_trace_init_standalone(heap_trace_record_t *record_buffer, size_t num_records)

Empty function just for passing compiling some place.

esp_err_t heap_trace_start(heap_trace_mode_t mode)

Start heap tracing. All heap allocations will be traced, until heap_trace_stop() is called.

Return
  • ESP_OK Tracing is started.
Parameters
  • mode: Mode for tracing.
    • HEAP_TRACE_LEAKS means only suspected memory leaks are traced. (When memory is freed, the record is removed from the trace buffer.)

esp_err_t heap_trace_stop(void)

Stop heap tracing.

Return
  • ESP_OK Heap tracing stopped..

esp_err_t heap_trace_resume(void)

Resume heap tracing which was previously stopped.

Return
  • ESP_ERR_NOT_SUPPORTED Project was compiled without heap tracing enabled in menuconfig.
  • ESP_OK Heap tracing resumed.

void heap_trace_dump(void)

Dump heap trace record data to stdout.

Note
It is safe to call this function while heap tracing is running, however in HEAP_TRACE_LEAK mode the dump may skip entries unless heap tracing is stopped first.

Structures

struct heap_trace_record_t

heap trace record information(not used)

Public Members

char buf[1]

record buffer

Enumerations

enum heap_trace_mode_t

Values:

HEAP_TRACE_NONE = 0
HEAP_TRACE_LEAKS