[REFACTOR] move and rename /un/register_us_page_probe()
[kernel/swap-modules.git] / driver / debug.h
1 ////////////////////////////////////////////////////////////////////////////////////
2 //
3 //      FILE:           debug.h
4 //
5 //      DESCRIPTION:
6 //      Debug functions for application
7 //      
8 //      SEE ALSO:       N/A
9 //      AUTHOR:         L.Komkov
10 //      COMPANY NAME:   Samsung Research Center in Moscow
11 //      DEPT NAME:      Advanced Software Group 
12 //      CREATED:        2008.02.15
13 //      VERSION:        1.0
14 //      REVISION DATE:  2008.12.02
15 //
16 ////////////////////////////////////////////////////////////////////////////////////
17
18 #if !defined(__DEBUG_H__)
19 #define __DEBUG_H__
20
21 #include <linux/kernel.h>
22 #include <linux/string.h>       // strrchr
23
24 #undef __DEBUG
25
26 #ifdef __DEBUG
27 #define DPRINTF(format, args...) do { \
28         char *f = __FILE__; \
29         char *n = strrchr(f, '/'); \
30         printk("DRIVER[%s:%u:%s] DEBUG: " format "\n" , (n) ? n+1 : f, __LINE__, __FUNCTION__, ##args); \
31     } while(0)
32 #else
33 #define DPRINTF(format, args...)
34 #endif
35
36 #define EPRINTF(format, args...) do { \
37         char *f = __FILE__; \
38         char *n = strrchr(f, '/'); \
39         printk("DRIVER[%s:%u:%s] ERROR: " format "\n" , (n) ? n+1 : f, __LINE__, __FUNCTION__, ##args); \
40     } while(0)
41
42
43 #endif /* !defined(__DEBUG_H__) */