From 6d8753097226452987741100a113255f0088199b Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Wed, 2 Oct 2019 14:02:49 +0900 Subject: [PATCH] Make debug output from the scheduler depend on CONFIG_DEBUG_SCHED --- config.h | 4 +++- kernel/core/sched.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config.h b/config.h index c9df922..2688243 100644 --- a/config.h +++ b/config.h @@ -36,7 +36,9 @@ #define CONFIG_SMP_CPUS 1 #define CONFIG_POSIX 1 -#define CONFIG_DEBUG 0 + +#define CONFIG_DEBUG 0 +#define CONFIG_DEBUG_SCHED 0 /* sanity checks */ diff --git a/kernel/core/sched.c b/kernel/core/sched.c index 8fa6199..e0a6182 100644 --- a/kernel/core/sched.c +++ b/kernel/core/sched.c @@ -77,9 +77,13 @@ void sched_tick(void) cur_task = _dq(&_readyq); if(cur_task) { +#if FEATURE(DEBUG_SCHED) dbg_printf("Switch to task %p [%02x]\n", cur_task, cur_task->t_state); +#endif /* FEATURE(DEBUG_SCHED) */ task_switch(cur_task); +#if FEATURE(DEBUG_SCHED) dbg_printf("Returned to task %p\n", task_get_current()); +#endif /* FEATURE(DEBUG_SCHED) */ } else { dbg_printf("This should not have happened\n"); } -- 2.47.3