/* * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */#include<sdkconfig.h>#defineHEAP_TRACE_SRCFILE/* don't warn on inclusion here */#include"esp_heap_trace.h"#undefHEAP_TRACE_SRCFILE#include"esp_heap_caps.h"#ifCONFIG_APPTRACE_SV_ENABLE#include"esp_app_trace.h"#include"esp_sysview_trace.h"/* ... */#endif#defineSTACK_DEPTHCONFIG_HEAP_TRACING_STACK_DEPTH#ifdefCONFIG_HEAP_TRACING_TOHOST#if!CONFIG_APPTRACE_SV_ENABLE#errorNoneoftheheaptracingbackendsisenabled!YoumustenableSystemViewcompatibletracingtousethisfeature.#endifstaticbools_tracing;esp_err_theap_trace_init_tohost(void){if(s_tracing){returnESP_ERR_INVALID_STATE;}{...}returnESP_OK;}{ ... }esp_err_theap_trace_start(heap_trace_mode_tmode_param){#ifCONFIG_APPTRACE_SV_ENABLEesp_err_tret=esp_sysview_heap_trace_start((uint32_t)-1);if(ret!=ESP_OK){returnret;}{...}/* ... */#endifs_tracing=true;returnESP_OK;}{ ... }esp_err_theap_trace_stop(void){esp_err_tret=ESP_ERR_NOT_SUPPORTED;#ifCONFIG_APPTRACE_SV_ENABLEret=esp_sysview_heap_trace_stop();#endifs_tracing=false;returnret;}{ ... }esp_err_theap_trace_resume(void){returnheap_trace_start(HEAP_TRACE_ALL);}{ ... }size_theap_trace_get_count(void){return0;}{ ... }esp_err_theap_trace_get(size_tindex,heap_trace_record_t*record){returnESP_ERR_NOT_SUPPORTED;}{ ... }esp_err_theap_trace_summary(heap_trace_summary_t*summary){returnESP_ERR_NOT_SUPPORTED;}{ ... }voidheap_trace_dump(void){return;}{ ... }voidheap_trace_dump_caps(__attribute__((unused))constuint32_tcaps){return;}{ ... }/* Add a new allocation to the heap trace records */staticHEAP_IRAM_ATTRvoidrecord_allocation(constheap_trace_record_t*record){if(!s_tracing){return;}{...}#ifCONFIG_APPTRACE_SV_ENABLEesp_sysview_heap_trace_alloc(record->address,record->size,record->alloced_by);#endif}{ ... }/* record a free event in the heap trace log For HEAP_TRACE_ALL, this means filling in the freed_by pointer. For HEAP_TRACE_LEAKS, this means removing the record from the log.*//* ... */staticHEAP_IRAM_ATTRvoidrecord_free(void*p,void**callers){if(!s_tracing){return;}{...}#ifCONFIG_APPTRACE_SV_ENABLEesp_sysview_heap_trace_free(p,callers);#endif}{ ... }#include"heap_trace.inc"/* ... */#endif/*CONFIG_HEAP_TRACING_TOHOST*/
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.