Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[debug] rename RT_DEBUGING_INIT -> RT_DEBUGING_PRE_INIT #7920

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions components/drivers/core/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/

#include <rtthread.h>

#include <drivers/core/dm.h>

#ifdef RT_USING_SMP
Expand All @@ -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;

Expand All @@ -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 */

Expand Down
2 changes: 1 addition & 1 deletion documentation/basic/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/rtdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions libcpu/sim/win32/startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加个pre怎么理解呢?预先初始化?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯 或者你看看什么名字比较合适?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我是感觉加个pre也没意义, 因为这个本身就是一个自动初始化的机制。

default n

config RT_DEBUGING_COLOR
bool "Enable color debugging log"
default y
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/components.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ++)
Expand All @@ -100,15 +100,15 @@ void rt_components_board_init(void)
{
(*fn_ptr)();
}
#endif /* RT_DEBUGING_INIT */
#endif /* RT_DEBUGING_PRE_INIT */
}

/**
* @brief RT-Thread Components Initialization.
*/
void rt_components_init(void)
{
#ifdef RT_DEBUGING_INIT
#ifdef RT_DEBUGING_PRE_INIT
int result;
const struct rt_init_desc *desc;

Expand All @@ -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 */

Expand Down