This source file includes following definitions.
- trace_dummy
1 #ifndef _TRACING_H
2 #define _TRACING_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 #include <linux/kernel.h>
34
35 #ifdef NO_TRACE_AT_ALL
36 static inline void trace_dummy(void)
37 {
38 }
39
40 #define TRACE_FUN( level, name) int _trace_dummy
41 #define TRACE_EXIT _trace_dummy= 0
42 #define TRACE_(l,m) trace_dummy()
43 #define TRACE(l,m) trace_dummy()
44 #define TRACEi(l,m,i) trace_dummy()
45 #define TRACElx(l,m,i) trace_dummy()
46 #define TRACEx1(l,m,a) trace_dummy()
47 #define TRACEx2(l,m,a,b) trace_dummy()
48 #define TRACEx3(l,m,a,b,c) trace_dummy()
49 #define TRACEx4(l,m,a,b,c,d) trace_dummy()
50 #define TRACEx5(l,m,a,b,c,d,e) trace_dummy()
51 #define TRACEx6(l,m,a,b,c,d,e,f) trace_dummy()
52 #else
53 #ifdef NO_TRACE
54 #define TOP_LEVEL 2
55 #else
56 #define TOP_LEVEL 10
57 #endif
58
59 #define TRACE_FUN( level, name) \
60 char _trace_fun[] = name; \
61 int _function_nest_level = trace_call( level, __FILE__, _trace_fun); \
62 int _tracing = level
63
64 #define TRACE_EXIT \
65 function_nest_level = _function_nest_level; \
66 trace_exit( _tracing, __FILE__, _trace_fun)
67
68 #define TRACE_(l,m) \
69 { \
70 if (tracing >= (l) && (l) <= TOP_LEVEL) { \
71 trace_log( __FILE__, _trace_fun); \
72 m; \
73 } \
74 }
75 #define TRACE(l,m) TRACE_(l,printk(m".\n"))
76 #define TRACEi(l,m,i) TRACE_(l,printk(m" %d.\n",i))
77 #define TRACElx(l,m,i) TRACE_(l,printk(m" 0x%08lx.\n",i))
78 #define TRACEx1(l,m,a) TRACE_(l,printk(m".\n",a))
79 #define TRACEx2(l,m,a,b) TRACE_(l,printk(m".\n",a,b))
80 #define TRACEx3(l,m,a,b,c) TRACE_(l,printk(m".\n",a,b,c))
81 #define TRACEx4(l,m,a,b,c,d) TRACE_(l,printk(m".\n",a,b,c,d))
82 #define TRACEx5(l,m,a,b,c,d,e) TRACE_(l,printk(m".\n",a,b,c,d,e))
83 #define TRACEx6(l,m,a,b,c,d,e,f) TRACE_(l,printk(m".\n",a,b,c,d,e,f))
84
85
86
87 extern unsigned char trace_id;
88 extern int tracing;
89 extern int function_nest_level;
90
91
92
93 extern int trace_call(int level, char *file, char *name);
94 extern void trace_exit(int level, char *file, char *name);
95 extern void trace_log(char *file, char *name);
96
97 #endif
98
99 #endif