]> granicus.if.org Git - esp-idf/commitdiff
trace: add Kconfig options for app level trace
authorIvan Grokhotkov <ivan@espressif.com>
Tue, 17 Jan 2017 14:58:11 +0000 (22:58 +0800)
committerAlexey Gerenkov <alexey@espressif.com>
Mon, 17 Apr 2017 19:19:14 +0000 (22:19 +0300)
CONFIG_MEMMAP_TRACEMEM is now a hidden underlying option, which can be enabled using either CONFIG_ESP32_TRAX or CONFIG_ESP32_APP_TRACE

components/esp32/Kconfig
components/esp32/cpu_start.c
components/xtensa-debug-module/trax.c

index 0db76f3d596c7ef181ceb90451719da29c2ed4d6..b5497aa8b1a2a9c3f18beb3dec8752363e2a1f86 100644 (file)
@@ -28,24 +28,39 @@ config MEMMAP_SMP
         to save some memory. (ToDo: Make this automatically depend on unicore support)
 
 config MEMMAP_TRACEMEM
+       bool
+       default "n"
+
+config MEMMAP_TRACEMEM_TWOBANKS
+    bool
+    default "n"
+
+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 MEMMAP_TRACEMEM_TWOBANKS
+config ESP32_TRAX_TWOBANKS
     bool "Reserve memory for tracing both pro as well as app cpu execution"
     default "n"
-    depends on MEMMAP_TRACEMEM && MEMMAP_SMP
+    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
index c3ef142c6b6aa20a702766be6efecf87b45ffafa..e9ec77bfe045899110cf1fc1a2dcfa2552a07e82 100644 (file)
@@ -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
index 5174e447761d899d12c3554acd544f3764ad4ccd..15a125584e465c4250d2b5b31c040970af9866c0 100644 (file)
@@ -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