diff options
| author | Shicheng Chu <[email protected]> | 2023-06-29 23:24:25 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-06-29 11:24:25 -0400 |
| commit | e2c031643c8dec7c9ea1581216e19bf19c8f73f0 (patch) | |
| tree | 926536732e7472c5e86ac5198b239d82f9f55da4 /src/scheduler_up.c | |
| parent | 148ae53cf8d3abc2c2e11c94c171b123b950b2fc (diff) | |
[include][dbg]update: no longer use RT_DEBUG_LOG in rtdebug.h (#7750)
Diffstat (limited to 'src/scheduler_up.c')
| -rw-r--r-- | src/scheduler_up.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/scheduler_up.c b/src/scheduler_up.c index 4c96089e34..ab4c0e977a 100644 --- a/src/scheduler_up.c +++ b/src/scheduler_up.c @@ -34,6 +34,14 @@ #include <rtthread.h> #include <rthw.h> +#define DBG_TAG "kernel.scheduler" +#ifdef RT_DEBUG_SCHEDULER +#define DBG_LVL DBG_LOG +#else +#define DBG_LVL DBG_WARNING +#endif /* defined (RT_DEBUG_SCHEDULER) */ +#include <rtdbg.h> + rt_list_t rt_thread_priority_table[RT_THREAD_PRIORITY_MAX]; rt_uint32_t rt_thread_ready_priority_group; #if RT_THREAD_PRIORITY_MAX > 32 @@ -170,8 +178,8 @@ void rt_system_scheduler_init(void) rt_base_t offset; rt_scheduler_lock_nest = 0; - RT_DEBUG_LOG(RT_DEBUG_SCHEDULER, ("start scheduler: max priority 0x%02x\n", - RT_THREAD_PRIORITY_MAX)); + LOG_D("start scheduler: max priority 0x%02x", + RT_THREAD_PRIORITY_MAX); for (offset = 0; offset < RT_THREAD_PRIORITY_MAX; offset ++) { @@ -277,13 +285,12 @@ void rt_schedule(void) to_thread->stat = RT_THREAD_RUNNING | (to_thread->stat & ~RT_THREAD_STAT_MASK); /* switch to new thread */ - RT_DEBUG_LOG(RT_DEBUG_SCHEDULER, - ("[%d]switch to priority#%d " + LOG_D("[%d]switch to priority#%d " "thread:%.*s(sp:0x%08x), " - "from thread:%.*s(sp: 0x%08x)\n", + "from thread:%.*s(sp: 0x%08x)", rt_interrupt_nest, highest_ready_priority, RT_NAME_MAX, to_thread->parent.name, to_thread->sp, - RT_NAME_MAX, from_thread->parent.name, from_thread->sp)); + RT_NAME_MAX, from_thread->parent.name, from_thread->sp); #ifdef RT_USING_OVERFLOW_CHECK _scheduler_stack_check(to_thread); @@ -324,7 +331,7 @@ void rt_schedule(void) } else { - RT_DEBUG_LOG(RT_DEBUG_SCHEDULER, ("switch in interrupt\n")); + LOG_D("switch in interrupt"); rt_hw_context_switch_interrupt((rt_ubase_t)&from_thread->sp, (rt_ubase_t)&to_thread->sp, from_thread, to_thread); @@ -384,8 +391,8 @@ void rt_schedule_insert_thread(struct rt_thread *thread) &(thread->tlist)); } - RT_DEBUG_LOG(RT_DEBUG_SCHEDULER, ("insert thread[%.*s], the priority: %d\n", - RT_NAME_MAX, thread->parent.name, thread->current_priority)); + LOG_D("insert thread[%.*s], the priority: %d", + RT_NAME_MAX, thread->parent.name, thread->current_priority); /* set priority mask */ #if RT_THREAD_PRIORITY_MAX > 32 @@ -414,9 +421,9 @@ void rt_schedule_remove_thread(struct rt_thread *thread) /* disable interrupt */ level = rt_hw_interrupt_disable(); - RT_DEBUG_LOG(RT_DEBUG_SCHEDULER, ("remove thread[%.*s], the priority: %d\n", - RT_NAME_MAX, thread->parent.name, - thread->current_priority)); + LOG_D("remove thread[%.*s], the priority: %d", + RT_NAME_MAX, thread->parent.name, + thread->current_priority); /* remove thread from ready list */ rt_list_remove(&(thread->tlist)); |
