123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- #pragma once
- #include "sdkconfig.h"
- #include <stdint.h>
- #include <esp_err.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- #if !defined(CONFIG_HEAP_TRACING) && !defined(HEAP_TRACE_SRCFILE)
- #warning "esp_heap_trace.h is included but heap tracing is disabled in menuconfig, functions are no-ops"
- #endif
- #ifndef CONFIG_HEAP_TRACING_STACK_DEPTH
- #define CONFIG_HEAP_TRACING_STACK_DEPTH 0
- #endif
- typedef enum {
- HEAP_TRACE_ALL,
- HEAP_TRACE_LEAKS,
- } heap_trace_mode_t;
- typedef struct {
- uint32_t ccount;
- void *address;
- size_t size;
- void *alloced_by[CONFIG_HEAP_TRACING_STACK_DEPTH];
- void *freed_by[CONFIG_HEAP_TRACING_STACK_DEPTH];
- } heap_trace_record_t;
- esp_err_t heap_trace_init_standalone(heap_trace_record_t *record_buffer, size_t num_records);
- esp_err_t heap_trace_init_tohost(void);
- esp_err_t heap_trace_start(heap_trace_mode_t mode);
- esp_err_t heap_trace_stop(void);
- esp_err_t heap_trace_resume(void);
- size_t heap_trace_get_count(void);
- esp_err_t heap_trace_get(size_t index, heap_trace_record_t *record);
- void heap_trace_dump(void);
- #ifdef __cplusplus
- }
- #endif
|