diff --git a/Kconfig b/Kconfig index cd2add3e64..8688396f1f 100644 --- a/Kconfig +++ b/Kconfig @@ -1556,6 +1556,10 @@ menu "LVGL configuration" int "Default profiler trace buffer size in bytes" depends on LV_USE_PROFILER_BUILTIN default 16384 + config LV_PROFILER_BUILTIN_DEFAULT_ENABLE + bool "Enable built-in profiler by default" + depends on LV_USE_PROFILER_BUILTIN + default y config LV_PROFILER_INCLUDE string "Header to include for the profiler" default "lvgl/src/misc/lv_profiler_builtin.h" diff --git a/lv_conf_template.h b/lv_conf_template.h index a597f6ea56..b6e11dfc2e 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -1026,6 +1026,7 @@ #if LV_USE_PROFILER_BUILTIN /** Default profiler trace buffer size */ #define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /**< [bytes] */ + #define LV_PROFILER_BUILTIN_DEFAULT_ENABLE 1 #endif /** Header to include for profiler */ diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index f6f1bbf5fc..c50731bd8d 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -3247,6 +3247,17 @@ #define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /**< [bytes] */ #endif #endif + #ifndef LV_PROFILER_BUILTIN_DEFAULT_ENABLE + #ifdef LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_PROFILER_BUILTIN_DEFAULT_ENABLE + #define LV_PROFILER_BUILTIN_DEFAULT_ENABLE CONFIG_LV_PROFILER_BUILTIN_DEFAULT_ENABLE + #else + #define LV_PROFILER_BUILTIN_DEFAULT_ENABLE 0 + #endif + #else + #define LV_PROFILER_BUILTIN_DEFAULT_ENABLE 1 + #endif + #endif #endif /** Header to include for profiler */ diff --git a/src/misc/lv_profiler_builtin.c b/src/misc/lv_profiler_builtin.c index 95bef6a0ce..cb1483f55c 100644 --- a/src/misc/lv_profiler_builtin.c +++ b/src/misc/lv_profiler_builtin.c @@ -142,7 +142,7 @@ void lv_profiler_builtin_init(const lv_profiler_builtin_config_t * config) profiler_ctx->config.flush_cb("#\n"); } - lv_profiler_builtin_set_enable(true); + lv_profiler_builtin_set_enable(LV_PROFILER_BUILTIN_DEFAULT_ENABLE); LV_LOG_INFO("init OK, item_num = %d", (int)num); }