[debug] remove RT_DEBUG_xxx
remove RT_DEBUG_THREAD RT_DEBUG_SCHEDULER RT_DEBUG_IPC RT_DEBUG_TIMER RT_DEBUG_IRQ RT_DEBUG_MEM RT_DEBUG_SLAB RT_DEBUG_MEMHEAP
This commit is contained in:
parent
3660db39a1
commit
237bbfd968
|
@ -34,13 +34,6 @@
|
||||||
/* SECTION: RT_DEBUG */
|
/* SECTION: RT_DEBUG */
|
||||||
#define RT_DEBUG
|
#define RT_DEBUG
|
||||||
#define RT_DEBUG_COLOR
|
#define RT_DEBUG_COLOR
|
||||||
//#define RT_DEBUG_MEM (1)
|
|
||||||
//#define RT_DEBUG_SCHEDULER (1)
|
|
||||||
//#define RT_DEBUG_IPC (1)
|
|
||||||
//#define THREAD_DEBUG
|
|
||||||
//#define IRQ_DEBUG
|
|
||||||
#define RT_USING_OVERFLOW_CHECK
|
|
||||||
//#define DFS_DEBUG
|
|
||||||
#define RT_LWIP_DEBUG
|
#define RT_LWIP_DEBUG
|
||||||
|
|
||||||
//#define RT_IRQHDL_DEBUG
|
//#define RT_IRQHDL_DEBUG
|
||||||
|
|
|
@ -25,10 +25,6 @@
|
||||||
#define RT_DEBUG_COLOR
|
#define RT_DEBUG_COLOR
|
||||||
// <bool name="RT_DEBUG_INIT" description="debug init enable" default=0 />
|
// <bool name="RT_DEBUG_INIT" description="debug init enable" default=0 />
|
||||||
#define RT_DEBUG_INIT 0
|
#define RT_DEBUG_INIT 0
|
||||||
//#define RT_DEBUG_SCHEDULER 1
|
|
||||||
// <bool name="RT_THREAD_DEBUG" description="Thread debug enable" default="false" />
|
|
||||||
// #define RT_THREAD_DEBUG
|
|
||||||
// <bool name="RT_USING_OVERFLOW_CHECK" description="Thread stack over flow detect" default="true" />
|
|
||||||
#define RT_USING_OVERFLOW_CHECK
|
#define RT_USING_OVERFLOW_CHECK
|
||||||
// </section>
|
// </section>
|
||||||
|
|
||||||
|
|
|
@ -2,17 +2,6 @@
|
||||||
#ifndef __RTTHREAD_CFG_H__
|
#ifndef __RTTHREAD_CFG_H__
|
||||||
#define __RTTHREAD_CFG_H__
|
#define __RTTHREAD_CFG_H__
|
||||||
|
|
||||||
/* #define RT_DEBUG_IRQ 1 */
|
|
||||||
/* #define RT_DEBUG_TIMER 1 */
|
|
||||||
|
|
||||||
/* #define RT_DEBUG_MEM 1 */
|
|
||||||
/* #define RT_DEBUG_MEMHEAP 1 */
|
|
||||||
/* #define RT_DEBUG_MODULE 1 */
|
|
||||||
/* #define RT_DEBUG_SCHEDULER 1 */
|
|
||||||
/* #define RT_DEBUG_SLAB 1 */
|
|
||||||
/* #define RT_DEBUG_THREAD 1 */
|
|
||||||
/* #define RT_DEBUG_IPC 1 */
|
|
||||||
|
|
||||||
/* RT_NAME_MAX*/
|
/* RT_NAME_MAX*/
|
||||||
#define RT_NAME_MAX 8
|
#define RT_NAME_MAX 8
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,11 @@
|
||||||
#include <rtm.h>
|
#include <rtm.h>
|
||||||
|
|
||||||
#ifdef RT_USING_MODULE
|
#ifdef RT_USING_MODULE
|
||||||
|
|
||||||
|
#define DBG_TAG "simulator.module.win32"
|
||||||
|
#define DBG_LVL DBG_INFO
|
||||||
|
#include <rtdbg.h>
|
||||||
|
|
||||||
void rt_module_init_object_container(struct rt_module *module)
|
void rt_module_init_object_container(struct rt_module *module)
|
||||||
{
|
{
|
||||||
RT_ASSERT(module != RT_NULL);
|
RT_ASSERT(module != RT_NULL);
|
||||||
|
@ -315,8 +320,7 @@ rt_module_t rt_module_open(const char *path)
|
||||||
(void(*)(void *))module->module_entry, RT_NULL,
|
(void(*)(void *))module->module_entry, RT_NULL,
|
||||||
2048, RT_THREAD_PRIORITY_MAX - 2, 10);
|
2048, RT_THREAD_PRIORITY_MAX - 2, 10);
|
||||||
|
|
||||||
RT_DEBUG_LOG(RT_DEBUG_MODULE, ("thread entry 0x%x\n",
|
LOG_D("thread entry %#x", module->module_entry);
|
||||||
module->module_entry));
|
|
||||||
|
|
||||||
/* set module id */
|
/* set module id */
|
||||||
module->module_thread->parent.module_id = (void *)module;
|
module->module_thread->parent.module_id = (void *)module;
|
||||||
|
|
|
@ -13,12 +13,8 @@
|
||||||
|
|
||||||
#ifdef __arm__
|
#ifdef __arm__
|
||||||
|
|
||||||
#define DBG_TAG "kernel.module"
|
#define DBG_TAG "posix.libdl.arch"
|
||||||
#ifdef RT_DEBUG_MODULE
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_MODULE) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
int dlmodule_relocate(struct rt_dlmodule *module, Elf32_Rel *rel, Elf32_Addr sym_val)
|
int dlmodule_relocate(struct rt_dlmodule *module, Elf32_Rel *rel, Elf32_Addr sym_val)
|
||||||
|
@ -126,4 +122,5 @@ int dlmodule_relocate(struct rt_dlmodule *module, Elf32_Rel *rel, Elf32_Addr sym
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
#endif /* __arm__ */
|
||||||
|
|
|
@ -26,12 +26,8 @@
|
||||||
#define R_RISCV_TLS_TPREL32 10
|
#define R_RISCV_TLS_TPREL32 10
|
||||||
#define R_RISCV_TLS_TPREL64 11
|
#define R_RISCV_TLS_TPREL64 11
|
||||||
|
|
||||||
#define DBG_TAG "kernel.module"
|
#define DBG_TAG "posix.libdl.arch"
|
||||||
#ifdef RT_DEBUG_MODULE
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_MODULE) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
int dlmodule_relocate(struct rt_dlmodule *module, Elf_Rel *rel, Elf_Addr sym_val)
|
int dlmodule_relocate(struct rt_dlmodule *module, Elf_Rel *rel, Elf_Addr sym_val)
|
||||||
|
|
|
@ -13,12 +13,8 @@
|
||||||
|
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
|
|
||||||
#define DBG_TAG "kernel.module"
|
#define DBG_TAG "posix.libdl.arch"
|
||||||
#ifdef RT_DEBUG_MODULE
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_MODULE) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */
|
#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */
|
||||||
|
@ -55,4 +51,5 @@ int dlmodule_relocate(struct rt_dlmodule *module, Elf32_Rel *rel, Elf32_Addr sym
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
#endif /* __i386__ */
|
||||||
|
|
|
@ -580,9 +580,6 @@ Configuration is mainly done by modifying the file under project directory - rtc
|
||||||
#define RT_DEBUG
|
#define RT_DEBUG
|
||||||
/* When debug mode is enabled: Define this macro to enable the print component initialization information, if not defined, close. */
|
/* When debug mode is enabled: Define this macro to enable the print component initialization information, if not defined, close. */
|
||||||
#define RT_DEBUG_INIT
|
#define RT_DEBUG_INIT
|
||||||
/* When debug mode is enabled: When the macro is defined as 0, the print thread switching information is turned off. When it is defined as 1, it is enabled. */
|
|
||||||
/* When debug mode is enabled: Define this macro to enable the print thread switching information. */
|
|
||||||
#define RT_DEBUG_THREAD
|
|
||||||
|
|
||||||
/* Defining this macro means the use of the hook function is started, if not defined, close. */
|
/* Defining this macro means the use of the hook function is started, if not defined, close. */
|
||||||
#define RT_USING_HOOK
|
#define RT_USING_HOOK
|
||||||
|
|
|
@ -13,12 +13,8 @@
|
||||||
|
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
|
|
||||||
#define DBG_TAG "kernel.irq"
|
#define DBG_TAG "cpu.ti.c28x"
|
||||||
#ifdef RT_DEBUG_IRQ
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_IRQ) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
extern volatile rt_uint8_t rt_interrupt_nest;
|
extern volatile rt_uint8_t rt_interrupt_nest;
|
||||||
|
|
36
src/Kconfig
36
src/Kconfig
|
@ -211,48 +211,12 @@ if RT_DEBUG
|
||||||
bool "Enable debugging of components initialization"
|
bool "Enable debugging of components initialization"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
config RT_DEBUG_THREAD
|
|
||||||
bool "Enable debugging of Thread State Changes"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config RT_DEBUG_SCHEDULER
|
|
||||||
bool "Enable debugging of Scheduler"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config RT_DEBUG_IPC
|
|
||||||
bool "Enable debugging of IPC"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config RT_DEBUG_TIMER
|
|
||||||
bool "Enable debugging of Timer"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config RT_DEBUG_IRQ
|
|
||||||
bool "Enable debugging of IRQ(Interrupt Request)"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config RT_DEBUG_MEM
|
|
||||||
bool "Enable debugging of Small Memory Algorithm"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config RT_DEBUG_SLAB
|
|
||||||
bool "Enable debugging of SLAB Memory Algorithm"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config RT_DEBUG_MEMHEAP
|
|
||||||
bool "Enable debugging of Memory Heap Algorithm"
|
|
||||||
default n
|
|
||||||
|
|
||||||
if ARCH_MM_MMU
|
if ARCH_MM_MMU
|
||||||
config RT_DEBUG_PAGE_LEAK
|
config RT_DEBUG_PAGE_LEAK
|
||||||
bool "Enable page leaking tracer"
|
bool "Enable page leaking tracer"
|
||||||
default n
|
default n
|
||||||
endif
|
endif
|
||||||
|
|
||||||
config RT_DEBUG_MODULE
|
|
||||||
bool "Enable debugging of Application Module"
|
|
||||||
default n
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
menu "Inter-Thread communication"
|
menu "Inter-Thread communication"
|
||||||
|
|
|
@ -51,11 +51,7 @@
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
|
|
||||||
#define DBG_TAG "kernel.ipc"
|
#define DBG_TAG "kernel.ipc"
|
||||||
#ifdef RT_DEBUG_IPC
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_IPC) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
#ifndef __on_rt_object_trytake_hook
|
#ifndef __on_rt_object_trytake_hook
|
||||||
|
|
|
@ -18,11 +18,7 @@
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
|
||||||
#define DBG_TAG "kernel.irq"
|
#define DBG_TAG "kernel.irq"
|
||||||
#ifdef RT_DEBUG_IRQ
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_IRQ) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
#ifndef __on_rt_interrupt_enter_hook
|
#ifndef __on_rt_interrupt_enter_hook
|
||||||
|
|
|
@ -51,16 +51,9 @@
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
|
||||||
#if defined (RT_USING_SMALL_MEM)
|
#if defined (RT_USING_SMALL_MEM)
|
||||||
/**
|
|
||||||
* memory item on the small mem
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define DBG_TAG "kernel.mem"
|
#define DBG_TAG "kernel.mem"
|
||||||
#ifdef RT_DEBUG_MEM
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_MEM) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
struct rt_small_mem_item
|
struct rt_small_mem_item
|
||||||
|
|
|
@ -27,11 +27,7 @@
|
||||||
#ifdef RT_USING_MEMHEAP
|
#ifdef RT_USING_MEMHEAP
|
||||||
|
|
||||||
#define DBG_TAG "kernel.memheap"
|
#define DBG_TAG "kernel.memheap"
|
||||||
#ifdef RT_DEBUG_MEMHEAP
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_MEM) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
/* dynamic pool magic and mask */
|
/* dynamic pool magic and mask */
|
||||||
|
|
|
@ -35,11 +35,7 @@
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
|
|
||||||
#define DBG_TAG "kernel.scheduler"
|
#define DBG_TAG "kernel.scheduler"
|
||||||
#ifdef RT_DEBUG_SCHEDULER
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_SCHEDULER) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
rt_list_t rt_thread_priority_table[RT_THREAD_PRIORITY_MAX];
|
rt_list_t rt_thread_priority_table[RT_THREAD_PRIORITY_MAX];
|
||||||
|
|
|
@ -35,11 +35,7 @@
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
|
|
||||||
#define DBG_TAG "kernel.scheduler"
|
#define DBG_TAG "kernel.scheduler"
|
||||||
#ifdef RT_DEBUG_SCHEDULER
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_SCHEDULER) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
rt_list_t rt_thread_priority_table[RT_THREAD_PRIORITY_MAX];
|
rt_list_t rt_thread_priority_table[RT_THREAD_PRIORITY_MAX];
|
||||||
|
|
14
src/slab.c
14
src/slab.c
|
@ -55,14 +55,10 @@
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
|
||||||
#if defined (RT_USING_SLAB)
|
#ifdef RT_USING_SLAB
|
||||||
|
|
||||||
#define DBG_TAG "kernel.slab"
|
#define DBG_TAG "kernel.slab"
|
||||||
#ifdef RT_DEBUG_SLAB
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_SLAB) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -751,7 +747,7 @@ void rt_slab_free(rt_slab_t m, void *ptr)
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
/* get memory usage */
|
/* get memory usage */
|
||||||
#ifdef RT_DEBUG_SLAB
|
#if (DBG_LVL == DBG_LOG)
|
||||||
{
|
{
|
||||||
rt_ubase_t addr = ((rt_ubase_t)ptr & ~RT_MM_PAGE_MASK);
|
rt_ubase_t addr = ((rt_ubase_t)ptr & ~RT_MM_PAGE_MASK);
|
||||||
LOG_D("free a memory 0x%x and align to 0x%x, kup index %d",
|
LOG_D("free a memory 0x%x and align to 0x%x, kup index %d",
|
||||||
|
@ -759,7 +755,7 @@ void rt_slab_free(rt_slab_t m, void *ptr)
|
||||||
(rt_ubase_t)addr,
|
(rt_ubase_t)addr,
|
||||||
((rt_ubase_t)(addr) - slab->heap_start) >> RT_MM_PAGE_BITS);
|
((rt_ubase_t)(addr) - slab->heap_start) >> RT_MM_PAGE_BITS);
|
||||||
}
|
}
|
||||||
#endif /* RT_DEBUG_SLAB */
|
#endif /* DBG_LVL == DBG_LOG */
|
||||||
|
|
||||||
kup = btokup((rt_ubase_t)ptr & ~RT_MM_PAGE_MASK);
|
kup = btokup((rt_ubase_t)ptr & ~RT_MM_PAGE_MASK);
|
||||||
/* release large allocation */
|
/* release large allocation */
|
||||||
|
@ -857,4 +853,4 @@ void rt_slab_free(rt_slab_t m, void *ptr)
|
||||||
}
|
}
|
||||||
RTM_EXPORT(rt_slab_free);
|
RTM_EXPORT(rt_slab_free);
|
||||||
|
|
||||||
#endif /* defined (RT_USING_SLAB) */
|
#endif /* RT_USING_SLAB */
|
||||||
|
|
|
@ -39,11 +39,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#define DBG_TAG "kernel.thread"
|
#define DBG_TAG "kernel.thread"
|
||||||
#ifdef RT_DEBUG_THREAD
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_THREAD) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
#ifndef __on_rt_thread_inited_hook
|
#ifndef __on_rt_thread_inited_hook
|
||||||
|
|
10
src/timer.c
10
src/timer.c
|
@ -25,11 +25,7 @@
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
|
|
||||||
#define DBG_TAG "kernel.timer"
|
#define DBG_TAG "kernel.timer"
|
||||||
#ifdef RT_DEBUG_TIMER
|
#define DBG_LVL DBG_INFO
|
||||||
#define DBG_LVL DBG_LOG
|
|
||||||
#else
|
|
||||||
#define DBG_LVL DBG_WARNING
|
|
||||||
#endif /* defined (RT_DEBUG_TIMER) */
|
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
/* hard timer list */
|
/* hard timer list */
|
||||||
|
@ -203,7 +199,7 @@ rt_inline void _timer_remove(rt_timer_t timer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RT_DEBUG_TIMER
|
#if (DBG_LVL == DBG_LOG)
|
||||||
/**
|
/**
|
||||||
* @brief The number of timer
|
* @brief The number of timer
|
||||||
*
|
*
|
||||||
|
@ -242,7 +238,7 @@ void rt_timer_dump(rt_list_t timer_heads[])
|
||||||
}
|
}
|
||||||
rt_kprintf("\n");
|
rt_kprintf("\n");
|
||||||
}
|
}
|
||||||
#endif /* RT_DEBUG_TIMER */
|
#endif /* (DBG_LVL == DBG_LOG) */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @addtogroup Clock
|
* @addtogroup Clock
|
||||||
|
|
Loading…
Reference in New Issue