From 7a6949f248d3f1139825451a672bc41d9efc6d52 Mon Sep 17 00:00:00 2001 From: "bernard.xiong@gmail.com" Date: Sat, 14 May 2011 00:12:49 +0000 Subject: [PATCH] cleanup trace log. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1404 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- src/scheduler.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/scheduler.c b/src/scheduler.c index 07e829e387..9b9c3b42d5 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -23,6 +23,7 @@ * 2010-07-13 Bernard fix the maximal number of rt_scheduler_lock_nest * issue found by kuronca * 2010-12-13 Bernard add defunct list initialization even if not use heap. + * 2011-05-10 Bernard clean scheduler debug log. */ #include @@ -30,7 +31,7 @@ #include "kservice.h" -/* #define SCHEDULER_DEBUG */ +/* #define RT_SCHEDULER_DEBUG */ static rt_int16_t rt_scheduler_lock_nest; extern volatile rt_uint8_t rt_interrupt_nest; @@ -133,6 +134,10 @@ void rt_system_scheduler_init(void) rt_scheduler_lock_nest = 0; +#ifdef RT_SCHEDULER_DEBUG + rt_kprintf("start scheduler: max priority 0x%02x\n", RT_THREAD_PRIORITY_MAX); +#endif + for (offset = 0; offset < RT_THREAD_PRIORITY_MAX; offset ++) { rt_list_init(&rt_thread_priority_table[offset]); @@ -276,7 +281,7 @@ void rt_schedule() #endif /* switch to new thread */ -#ifdef SCHEDULER_DEBUG +#ifdef RT_SCHEDULER_DEBUG rt_kprintf("[%d]switch to priority#%d thread:%s\n", rt_interrupt_nest, highest_ready_priority, to_thread->name); #endif @@ -290,7 +295,7 @@ void rt_schedule() } else { -#ifdef SCHEDULER_DEBUG +#ifdef RT_SCHEDULER_DEBUG rt_kprintf("switch in interrupt\n"); #endif rt_hw_context_switch_interrupt((rt_uint32_t)&from_thread->sp, @@ -327,11 +332,11 @@ void rt_schedule_insert_thread(struct rt_thread* thread) &(thread->tlist)); /* set priority mask */ -#ifdef SCHEDULER_DEBUG +#ifdef RT_SCHEDULER_DEBUG #if RT_THREAD_PRIORITY_MAX <= 32 - rt_kprintf("insert thread, the priority: %d\n", thread->current_priority); + rt_kprintf("insert thread[%s], the priority: %d\n", thread->name, thread->current_priority); #else - rt_kprintf("insert thread, the priority: %d 0x%x %d\n", thread->number, thread->number_mask, thread->high_mask); + rt_kprintf("insert thread[%s], the priority: %d 0x%x %d\n", thread->name, thread->number, thread->number_mask, thread->high_mask); #endif #endif @@ -360,11 +365,11 @@ void rt_schedule_remove_thread(struct rt_thread* thread) /* disable interrupt */ temp = rt_hw_interrupt_disable(); -#ifdef SCHEDULER_DEBUG +#ifdef RT_SCHEDULER_DEBUG #if RT_THREAD_PRIORITY_MAX <= 32 - rt_kprintf("remove thread, the priority: %d\n", thread->current_priority); + rt_kprintf("remove thread[%s], the priority: %d\n", thread->name, thread->current_priority); #else - rt_kprintf("remove thread, the priority: %d 0x%x %d\n", thread->number, + rt_kprintf("remove thread[%s], the priority: %d 0x%x %d\n", thread->name, thread->number, thread->number_mask, thread->high_mask); #endif #endif -- GitLab