Skip to content

Commit

Permalink
Optionally disable logs in espcoredump component
Browse files Browse the repository at this point in the history
Early log strings used by this component are placed in DRAM.
Disabling these logs saves ~5KB of internal memory

Signed-off-by: Vikram <[email protected]>
  • Loading branch information
vikramdattu committed Jun 29, 2023
1 parent cbce221 commit 207ac93
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions components/espcoredump/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ menu "Core dump"
help
Enables/disable core dump module.

config ESP_COREDUMP_LOGS
bool "Enable coredump logs for debugging"
depends on ESP_COREDUMP_ENABLE
default y
help
Enable/disable coredump logs. Logs strings from espcoredump component are
placed in DRAM. Disabling these helps to save ~5KB of internal memory.

config ESP_COREDUMP_MAX_TASKS_NUM
int "Maximum number of tasks"
depends on ESP_COREDUMP_ENABLE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -18,7 +18,12 @@ extern "C" {
#include "esp_private/panic_internal.h"
#include "core_dump_checksum.h"

#if CONFIG_ESP_COREDUMP_LOGS
#define ESP_COREDUMP_LOG( level, format, ... ) if (LOG_LOCAL_LEVEL >= level) { esp_rom_printf(DRAM_STR(format), esp_log_early_timestamp(), (const char *)TAG, ##__VA_ARGS__); }
#else
#define ESP_COREDUMP_LOG( level, format, ... ) // dummy define doing nothing
#endif

#define ESP_COREDUMP_LOGE( format, ... ) ESP_COREDUMP_LOG(ESP_LOG_ERROR, LOG_FORMAT(E, format), ##__VA_ARGS__)
#define ESP_COREDUMP_LOGW( format, ... ) ESP_COREDUMP_LOG(ESP_LOG_WARN, LOG_FORMAT(W, format), ##__VA_ARGS__)
#define ESP_COREDUMP_LOGI( format, ... ) ESP_COREDUMP_LOG(ESP_LOG_INFO, LOG_FORMAT(I, format), ##__VA_ARGS__)
Expand Down

0 comments on commit 207ac93

Please sign in to comment.