trace: add Kconfig options for app level trace

CONFIG_MEMMAP_TRACEMEM is now a hidden underlying option, which can be enabled using either CONFIG_ESP32_TRAX or CONFIG_ESP32_APP_TRACE
pull/515/merge
Ivan Grokhotkov 2017-01-17 22:58:11 +08:00 zatwierdzone przez Alexey Gerenkov
rodzic 3ac080fc80
commit 639557d975
3 zmienionych plików z 31 dodań i 16 usunięć

Wyświetl plik

@ -28,24 +28,39 @@ config MEMMAP_SMP
to save some memory. (ToDo: Make this automatically depend on unicore support)
config MEMMAP_TRACEMEM
bool "Use TRAX tracing feature"
default "n"
help
The ESP32 contains a feature which allows you to trace the execution path the processor
has taken through the program. This is stored in a chunk of 32K (16K for single-processor)
of memory that can't be used for general purposes anymore. Disable this if you do not know
what this is.
bool
default "n"
config MEMMAP_TRACEMEM_TWOBANKS
bool "Reserve memory for tracing both pro as well as app cpu execution"
bool
default "n"
depends on MEMMAP_TRACEMEM && MEMMAP_SMP
config ESP32_TRAX
bool "Use TRAX tracing feature"
default "n"
select MEMMAP_TRACEMEM
help
The ESP32 contains a feature which allows you to trace the execution path the processor
has taken through the program. This is stored in a chunk of 32K (16K for single-processor)
of memory that can't be used for general purposes anymore. Disable this if you do not know
what this is.
config ESP32_TRAX_TWOBANKS
bool "Reserve memory for tracing both pro as well as app cpu execution"
default "n"
depends on ESP32_TRAX && MEMMAP_SMP
select MEMMAP_TRACEMEM_TWOBANKS
help
The ESP32 contains a feature which allows you to trace the execution path the processor
has taken through the program. This is stored in a chunk of 32K (16K for single-processor)
of memory that can't be used for general purposes anymore. Disable this if you do not know
what this is.
config ESP32_APP_TRACE
bool "Use two trace memory banks for application level trace"
default "n"
select MEMMAP_TRACEMEM
select MEMMAP_TRACEMEM_TWOBANKS
# Memory to reverse for trace, used in linker script
config TRACEMEM_RESERVE_DRAM

Wyświetl plik

@ -193,8 +193,8 @@ void start_cpu0_default(void)
{
esp_setup_syscall_table();
//Enable trace memory and immediately start trace.
#if CONFIG_MEMMAP_TRACEMEM
#if CONFIG_MEMMAP_TRACEMEM_TWOBANKS
#if CONFIG_ESP32_TRAX
#if CONFIG_ESP32_TRAX_TWOBANKS
trax_enable(TRAX_ENA_PRO_APP);
#else
trax_enable(TRAX_ENA_PRO);
@ -250,7 +250,7 @@ void start_cpu0_default(void)
#if !CONFIG_FREERTOS_UNICORE
void start_cpu1_default(void)
{
#if CONFIG_MEMMAP_TRACEMEM_TWOBANKS
#if CONFIG_ESP32_TRAX_TWOBANKS
trax_start_trace(TRAX_DOWNCOUNT_WORDS);
#endif
// Wait for FreeRTOS initialization to finish on PRO CPU

Wyświetl plik

@ -30,11 +30,11 @@ static const char* TAG = "trax";
int trax_enable(trax_ena_select_t which)
{
#if !CONFIG_MEMMAP_TRACEMEM
#if !CONFIG_ESP32_TRAX
ESP_LOGE(TAG, "Trax_enable called, but trax is disabled in menuconfig!");
return ESP_ERR_NO_MEM;
#endif
#if !CONFIG_MEMMAP_TRACEMEM_TWOBANKS
#if !CONFIG_ESP32_TRAX_TWOBANKS
if (which == TRAX_ENA_PRO_APP || which == TRAX_ENA_PRO_APP_SWAP) return ESP_ERR_NO_MEM;
#endif
if (which == TRAX_ENA_PRO_APP || which == TRAX_ENA_PRO_APP_SWAP) {
@ -50,7 +50,7 @@ int trax_enable(trax_ena_select_t which)
int trax_start_trace(trax_downcount_unit_t units_until_stop)
{
#if !CONFIG_MEMMAP_TRACEMEM
#if !CONFIG_ESP32_TRAX
ESP_LOGE(TAG, "Trax_start_trace called, but trax is disabled in menuconfig!");
return ESP_ERR_NO_MEM;
#endif
@ -74,7 +74,7 @@ int trax_start_trace(trax_downcount_unit_t units_until_stop)
int trax_trigger_traceend_after_delay(int delay)
{
#if !CONFIG_MEMMAP_TRACEMEM
#if !CONFIG_ESP32_TRAX
ESP_LOGE(TAG, "Trax_trigger_traceend_after_delay called, but trax is disabled in menuconfig!");
return ESP_ERR_NO_MEM;
#endif