From: Alexey Gerenkov Date: Mon, 12 Nov 2018 21:01:24 +0000 (+0300) Subject: esp32: Adds menuconfig option for max tasks number in core dump X-Git-Tag: v3.3-beta1~113^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=181a40ae309fc7ec1ac9000c514180333a00c5e4;p=esp-idf esp32: Adds menuconfig option for max tasks number in core dump --- diff --git a/components/esp32/Kconfig b/components/esp32/Kconfig index 32f699d7be..b2f10fbe7b 100644 --- a/components/esp32/Kconfig +++ b/components/esp32/Kconfig @@ -272,8 +272,10 @@ config TRACEMEM_RESERVE_DRAM default 0x4000 if MEMMAP_TRACEMEM && !MEMMAP_TRACEMEM_TWOBANKS default 0x0 +menu "Core dump" + choice ESP32_COREDUMP_TO_FLASH_OR_UART - prompt "Core dump destination" + prompt "Data destination" default ESP32_ENABLE_COREDUMP_TO_NONE help Select place to store core dump: flash, uart or none (to disable core dumps generation). @@ -298,14 +300,23 @@ config ESP32_ENABLE_COREDUMP help Enables/disable core dump module. +config ESP32_CORE_DUMP_MAX_TASKS_NUM + int "Maximum number of tasks" + depends on ESP32_ENABLE_COREDUMP + default 64 + help + Maximum number of tasks snapshots in core dump. + config ESP32_CORE_DUMP_UART_DELAY - int "Core dump print to UART delay" + int "Delay before print to UART" depends on ESP32_ENABLE_COREDUMP_TO_UART default 0 help Config delay (in ms) before printing core dump to UART. Delay can be interrupted by pressing Enter key. +endmenu + choice NUMBER_OF_UNIVERSAL_MAC_ADDRESS bool "Number of universally administered (by IEEE) MAC address" default FOUR_UNIVERSAL_MAC_ADDRESS diff --git a/components/esp32/core_dump.c b/components/esp32/core_dump.c index 5608653c06..25175f19b0 100644 --- a/components/esp32/core_dump.c +++ b/components/esp32/core_dump.c @@ -45,8 +45,6 @@ typedef uint32_t core_dump_crc_t; #define ESP_COREDUMP_LOG_PROCESS( format, ... ) do{/*(__VA_ARGS__);*/}while(0) #endif -// TODO: allow user to set this in menuconfig or get tasks iteratively -#define COREDUMP_MAX_TASKS_NUM 32 #define COREDUMP_MAX_TASK_STACK_SIZE (64*1024) @@ -104,7 +102,7 @@ static void esp_core_dump_write(XtExcFrame *frame, core_dump_write_config_t *wri { int cur_task_bad = 0; esp_err_t err; - TaskSnapshot_t tasks[COREDUMP_MAX_TASKS_NUM]; + TaskSnapshot_t tasks[CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM]; UBaseType_t tcb_sz, tcb_sz_padded, task_num; uint32_t data_len = 0, i, len; union @@ -113,7 +111,7 @@ static void esp_core_dump_write(XtExcFrame *frame, core_dump_write_config_t *wri core_dump_task_header_t task_hdr; } dump_data; - task_num = uxTaskGetSnapshotAll(tasks, COREDUMP_MAX_TASKS_NUM, &tcb_sz); + task_num = uxTaskGetSnapshotAll(tasks, CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM, &tcb_sz); // take TCB padding into account, actual TCB size will be stored in header if (tcb_sz % sizeof(uint32_t)) tcb_sz_padded = (tcb_sz / sizeof(uint32_t) + 1) * sizeof(uint32_t); diff --git a/docs/en/api-guides/core_dump.rst b/docs/en/api-guides/core_dump.rst index be75cbe1de..5b3a6e3c53 100644 --- a/docs/en/api-guides/core_dump.rst +++ b/docs/en/api-guides/core_dump.rst @@ -18,13 +18,15 @@ Configuration There are a number of core dump related configuration options which user can choose in configuration menu of the application (`make menuconfig`). -1. Core dump data destination (`Components -> ESP32-specific config -> Core dump destination`): +1. Core dump data destination (`Components -> ESP32-specific config -> Core dump -> Data destination`): * Disable core dump generation * Save core dump to flash * Print core dump to UART -2. Delay before core dump will be printed to UART (`Components -> ESP32-specific config -> Core dump print to UART delay`). Value is in ms. +2. Maximum number of tasks snapshots in core dump (`Components -> ESP32-specific config -> Core dump -> Maximum number of tasks`). + +3. Delay before core dump is printed to UART (`Components -> ESP32-specific config -> Core dump -> Delay before print to UART`). Value is in ms. Save core dump to flash