Debug
[Developer Documentation]


Detailed Description

Debug facilities.

Defines a set of macro to help debugging.


Kernel logs

#define liso_err(format, arg...)   printk(KERN_ERR "lisodsp: " format "\n" , ## arg)
 Kernel error level log.

#define liso_info(format, arg...)   printk(KERN_INFO "lisodsp: " format "\n" , ## arg)
 Kernel info level log.

#define liso_warn(format, arg...)   printk(KERN_WARNING "lisodsp: " format "\n" , ## arg)
 Kernel warning level log.

#define liso_dbg(format, arg...)
 Kernel debug level log.

#define liso_print   printk
 Kernel print.


Enter/Leave a function.

#define liso_enter()
 Enter a function.

#define liso_return(CODE)
 Leave a function with a value.

#define liso_return_void(CODE)
 Leave a function without return value.

#define liso_leave(CODE)   liso_return(CODE)
#define liso_leave_void()   liso_return_void()

Magic number test

#define liso_test_magic(OBJ)   (!OBJ || /* IS_ERR(OBJ) || */ OBJ->magic != OBJ)
 Test object magic value.

#define liso_test_magic_or_returns(OBJ, NAME)
 Test object magic value or exit with -EINVAL.


Defines

#define TABS_MSK   (sizeof(tabs_str)-1)

Variables

int debug
 Current debug level.

int tabs
 Current tabulation.

const char tabs_str [8]
 Tabulation string.


Define Documentation

#define liso_dbg format,
arg...   ) 
 

Value:

if (debug) {\ printk(KERN_DEBUG "%s(%04d) " format "\n",\ tabs_str+TABS_MSK-(tabs&TABS_MSK),\ /*__FUNCTION__,*/__LINE__, ## arg);\ } else
Kernel debug level log.

 
#define liso_enter  ) 
 

Value:

if (debug) {\ printk(KERN_DEBUG "%s%s:%d {\n",\ tabs_str+TABS_MSK-(tabs&TABS_MSK),\ __FUNCTION__,__LINE__);\ ++tabs;\ } else
Enter a function.

#define liso_return CODE   ) 
 

Value:

do {\ typeof(CODE) __rc=(CODE);\ if (debug) {\ --tabs;\ printk(KERN_DEBUG "%s} %s:%d (%d)\n",\ tabs_str+TABS_MSK-(tabs&TABS_MSK),\ __FUNCTION__,__LINE__,\ (int)__rc);\ }\ return __rc;\ } while(0)
Leave a function with a value.

#define liso_return_void CODE   ) 
 

Value:

do {\ if (debug) {\ --tabs;\ printk(KERN_DEBUG "%s} %s:%d\n",tabs_str+TABS_MSK-(tabs&TABS_MSK),\ __FUNCTION__,__LINE__);\ }\ return;\ } while(0)
Leave a function without return value.

#define liso_leave CODE   )     liso_return(CODE)
 

See also:
liso_return().

 
#define liso_leave_void  )     liso_return_void()
 

See also:
liso_return_void().

#define liso_test_magic_or_returns OBJ,
NAME   ) 
 

Value:

if (liso_test_magic(OBJ)) {\ liso_dbg("invalid " NAME " [%p,%p]",OBJ,OBJ->magic);\ liso_return(-EINVAL);\ } else
Test object magic value or exit with -EINVAL.


lisodsp logo lisodsp developer documentation
version 0.5.0
Generated on June 2004
by doxygen 1.3.7