From 84f8901ce986068369d4bca9376441bbae89401d Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sat, 5 Aug 2023 13:38:46 -0400 Subject: [PATCH] [debug] rename RT_DEBUGING_INIT -> RT_DEBUGING_PRE_INIT set default as n --- components/drivers/core/dm.c | 5 ++--- documentation/basic/basic.md | 2 +- include/rtdef.h | 4 ++-- libcpu/sim/win32/startup.c | 8 ++++---- src/Kconfig | 8 ++++---- src/components.c | 8 ++++---- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/components/drivers/core/dm.c b/components/drivers/core/dm.c index 20c2fca1d31..f867d235a36 100644 --- a/components/drivers/core/dm.c +++ b/components/drivers/core/dm.c @@ -9,7 +9,6 @@ */ #include - #include #ifdef RT_USING_SMP @@ -27,7 +26,7 @@ INIT_EXPORT(rti_secondary_cpu_end, "7.end"); void rt_dm_secondary_cpu_init(void) { -#if RT_DEBUGING_INIT +#if RT_DEBUGING_PRE_INIT int result; const struct rt_init_desc *desc; @@ -45,7 +44,7 @@ void rt_dm_secondary_cpu_init(void) { (*fn_ptr)(); } -#endif /* RT_DEBUGING_INIT */ +#endif /* RT_DEBUGING_PRE_INIT */ } #endif /* RT_USING_SMP */ diff --git a/documentation/basic/basic.md b/documentation/basic/basic.md index 8b5e930c8ab..96cede0e656 100644 --- a/documentation/basic/basic.md +++ b/documentation/basic/basic.md @@ -579,7 +579,7 @@ Configuration is mainly done by modifying the file under project directory - rtc /* Define this macro to enable debug mode, if not defined, close. */ #define RT_USING_DEBUG /* When debug mode is enabled: Define this macro to enable the print component initialization information, if not defined, close. */ -#define RT_DEBUGING_INIT +#define RT_DEBUGING_PRE_INIT /* Defining this macro means the use of the hook function is started, if not defined, close. */ #define RT_USING_HOOK diff --git a/include/rtdef.h b/include/rtdef.h index f0e975d725e..16bb680d0f6 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -271,7 +271,7 @@ typedef __gnuc_va_list va_list; typedef int (*init_fn_t)(void); #ifdef _MSC_VER #pragma section("rti_fn$f",read) - #ifdef RT_DEBUGING_INIT + #ifdef RT_DEBUGING_PRE_INIT struct rt_init_desc { const char* level; @@ -297,7 +297,7 @@ typedef int (*init_fn_t)(void); {__rti_level_##fn, fn }; #endif #else - #ifdef RT_DEBUGING_INIT + #ifdef RT_DEBUGING_PRE_INIT struct rt_init_desc { const char* fn_name; diff --git a/libcpu/sim/win32/startup.c b/libcpu/sim/win32/startup.c index ba2871eae65..e536b4a485d 100644 --- a/libcpu/sim/win32/startup.c +++ b/libcpu/sim/win32/startup.c @@ -81,7 +81,7 @@ struct rt_init_tag { const char *level; init_fn_t fn; -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_PRE_INIT const char *fn_name; #endif }; @@ -114,7 +114,7 @@ static int rt_init_objects_sort(void) { table->level = ((struct rt_init_desc *)ptr_begin)->level; table->fn = ((struct rt_init_desc *)ptr_begin)->fn; -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_PRE_INIT table->fn_name = ((struct rt_init_desc *)ptr_begin)->fn_name; #endif ptr_begin += sizeof(struct rt_init_desc) / sizeof(unsigned int); @@ -168,7 +168,7 @@ void rt_components_board_init(void) { break; } -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_PRE_INIT rt_kprintf("initialize %s", rt_init_table[index_i].fn_name); result = rt_init_table[index_i].fn(); rt_kprintf(":%d done\n", result); @@ -203,7 +203,7 @@ void rt_components_init(void) { break; } -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_PRE_INIT rt_kprintf("initialize %s", rt_init_table[index_i].fn_name); result = rt_init_table[index_i].fn(); rt_kprintf(":%d done\n", result); diff --git a/src/Kconfig b/src/Kconfig index 28e54fc7110..9eb27b76a83 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -203,6 +203,10 @@ menuconfig RT_USING_DEBUG default y if RT_USING_DEBUG + config RT_DEBUGING_PRE_INIT + bool "Enable debugging of components pre-initialization" + default n + config RT_DEBUGING_COLOR bool "Enable color debugging log" default y @@ -211,10 +215,6 @@ menuconfig RT_USING_DEBUG bool "Enable debugging of environment and context check" default y - config RT_DEBUGING_INIT - bool "Enable debugging of components initialization" - default y - config RT_DEBUGING_PAGE_LEAK bool "Enable page leaking tracer" depends on ARCH_MM_MMU diff --git a/src/components.c b/src/components.c index c9a25c76dc0..945ba493027 100644 --- a/src/components.c +++ b/src/components.c @@ -84,7 +84,7 @@ INIT_EXPORT(rti_end, "6.end"); */ void rt_components_board_init(void) { -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_PRE_INIT int result; const struct rt_init_desc *desc; for (desc = &__rt_init_desc_rti_board_start; desc < &__rt_init_desc_rti_board_end; desc ++) @@ -100,7 +100,7 @@ void rt_components_board_init(void) { (*fn_ptr)(); } -#endif /* RT_DEBUGING_INIT */ +#endif /* RT_DEBUGING_PRE_INIT */ } /** @@ -108,7 +108,7 @@ void rt_components_board_init(void) */ void rt_components_init(void) { -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_PRE_INIT int result; const struct rt_init_desc *desc; @@ -126,7 +126,7 @@ void rt_components_init(void) { (*fn_ptr)(); } -#endif /* RT_DEBUGING_INIT */ +#endif /* RT_DEBUGING_PRE_INIT */ } #endif /* RT_USING_COMPONENTS_INIT */