Subversion Repositories shark

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/*
2
 * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
3
 *
4
 * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
5
 *               Gerardo Lamastra <gerardo@sssup.it>
6
 *
7
 * Authors     : Massimiliano Giorgi <massy@hartik.sssup.it>
8
 * (see authors.txt for full list of hartik's authors)
9
 *
10
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
11
 *
12
 * http://www.sssup.it
13
 * http://retis.sssup.it
14
 * http://hartik.sssup.it
15
 */
16
 
17
/*
18
 * Copyright (C) 1999 Massimiliano Giorgi
19
 *
20
 * This program is free software; you can redistribute it and/or modify
21
 * it under the terms of the GNU General Public License as published by
22
 * the Free Software Foundation; either version 2 of the License, or
23
 * (at your option) any later version.
24
 *
25
 * This program is distributed in the hope that it will be useful,
26
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28
 * GNU General Public License for more details.
29
 *
30
 * You should have received a copy of the GNU General Public License
31
 * along with this program; if not, write to the Free Software
32
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
33
 *
34
 */
35
 
36
/*
37
 * CVS :        $Id: debug.h,v 1.1.1.1 2002-03-29 14:12:50 pj Exp $
38
 *
39
 * File:        $File$
40
 * Revision:    $Revision: 1.1.1.1 $
41
 * Last update: $Date: 2002-03-29 14:12:50 $
42
 */
43
 
44
/***
45
 Debugging flags that change the beaviour of most functions (causing functions to emit
46
 debugging informations).
47
 ***/
48
 
49
#ifndef __DEBUG_H
50
#define __DEBUG_H
51
 
52
#include <fs/util.h>
53
 
54
/* permit to start/stop debugging messages */
55
#define DEBUGSTARTSTOP 1
56
#undef DEBUGSTARTSTOP
57
 
58
/* the mutex are checked to discover bug (do not use! is dangerous)*/
59
#define FSMUTEXCHECK 1
60
#undef FSMUTEXCHECK
61
 
62
/**/
63
 
64
void debug_dump_buffer(char *buffer,int size);
65
 
66
/*
67
 * initialization
68
 */
69
 
70
/* main init function */
71
#define DEBUG_MAININIT KERN_DEBUG
72
#undef DEBUG_MAININIT
73
 
74
/* main init function */
75
#define DEBUG_MAINEND KERN_DEBUG
76
#undef DEBUG_MAINEND
77
 
78
/*
79
 * primitives
80
 */
81
 
82
/* debug open() */
83
#define DEBUG_OPEN KERN_DEBUG
84
#undef DEBUG_OPEN
85
 
86
/* debug opendir() */
87
#define DEBUG_OPENDIR KERN_DEBUG
88
#undef DEBUG_OPENDIR
89
 
90
/* debug readdir() */
91
#define DEBUG_READDIR KERN_DEBUG
92
#undef DEBUG_READDIR
93
/* if you want "dump" of directory entries */
94
#define DEBUG_READDIR_DUMP
95
#undef DEBUG_READDIR_DUMP
96
 
97
/* debug lseek() */
98
#define DEBUG_LSEEK KERN_DEBUG
99
#undef DEBUG_LSEEK
100
 
101
/* debug unlink() */
102
#define DEBUG_UNLINK KERN_DEBUG
103
#undef DEBUG_UNLINK
104
 
105
/* debug fstat() & stat() */
106
#define DEBUG_XSTAT KERN_DEBUG
107
#undef DEBUG_XSTAT
108
 
109
/* debug mount() & umount() */
110
#define DEBUG_MOUNT KERN_DEBUG
111
#undef DEBUG_MOUNT
112
/* extra debug for mount() & umount() (show childs purging) */
113
#define DEBUGPURGECHILD 1
114
#undef DEBUGPURGECHILD
115
 
116
#ifndef DEBUG_MOUNT
117
#undef DEBUGPURGECHILD
118
#endif
119
 
120
/*
121
 * directory scanning
122
 */
123
 
124
/* debug find (search for new directory on directory cache) */
125
#define DEBUG_FIND KERN_DEBUG
126
#undef DEBUG_FIND
127
/* extra debug for find (dump every entry found!) */
128
#define DEBUG_FIND_DUMP
129
#undef DEBUG_FIND_DUMP
130
 
131
/* debug lookup (searching for new directory entries on disk) */
132
/* normal debug */
133
#define DEBUG_LOOKUP KERN_DEBUG
134
#undef DEBUG_LOOKUP
135
/* extra debug (show all filenames found) */
136
#define DEBUG_LOOKUP_EXTRA KERN_DEBUG
137
#undef DEBUG_LOOKUP_EXTRA
138
 
139
/*
140
 * disk cache
141
 */
142
 
143
/* debug locking functions of dcache.c module */
144
#define DEBUG_DCACHE KERN_DEBUG
145
#undef DEBUG_DCACHE
146
 
147
/* debug dcache_purgedevice() (to sync hard-disk with cache)*/
148
#define DEBUG_DCACHE_PURGE KERN_DEBUG
149
#undef DEBUG_DCACHE_PURGE
150
 
151
/**/
152
/**/
153
/**/
154
 
155
#ifdef DEBUGSTARTSTOP
156
extern int debug_info;
157
extern void debug_info_show(int enable);
158
#else
159
#define debug_info 1
160
#define debug_info_show(x)
161
#endif
162
 
163
/**/
164
 
165
#ifdef DEBUG_OPEN
166
#define printk0(fmt,args...) \
167
        if (debug_info) printk(DEBUG_OPEN fmt,##args)
168
#else
169
#define printk0(fmt,args...)
170
#endif
171
 
172
#ifdef DEBUG_LOOKUP
173
#define printk1(fmt,args...) \
174
        if (debug_info) printk(DEBUG_LOOKUP fmt,##args)
175
#else
176
#define printk1(fmt,args...)
177
#endif
178
 
179
#ifdef DEBUG_LOOKUP_EXTRA
180
#define printk1e(fmt,args...) \
181
        if (debug_info) printk(DEBUG_LOOKUP_EXTRA fmt,##args)
182
#else
183
#define printk1e(fmt,args...)
184
#endif
185
 
186
#ifdef DEBUG_LSEEK
187
#define printk3(fmt,args...) \
188
        if (debug_info) printk(DEBUG_LSEEK fmt,##args)
189
#else
190
#define printk3(fmt,args...)
191
#endif
192
 
193
#ifdef DEBUG_OPENDIR
194
#define printk4(fmt,args...) \
195
        if (debug_info) printk(DEBUG_OPENDIR fmt,##args)
196
#else
197
#define printk4(fmt,args...)
198
#endif
199
 
200
#ifdef DEBUG_READDIR
201
#define printk5(fmt,args...) \
202
        if (debug_info) printk(DEBUG_READDIR fmt,##args)
203
#else
204
#define printk5(fmt,args...)
205
#endif
206
 
207
#ifdef DEBUG_XSTAT
208
#define printk6(fmt,args...) \
209
        if (debug_info) printk(DEBUG_XSTAT fmt,##args)
210
#else
211
#define printk6(fmt,args...)
212
#endif
213
 
214
#ifdef DEBUG_FIND
215
#define printk7(fmt,args...) \
216
        if (debug_info) printk(DEBUG_FIND fmt,##args)
217
#else
218
#define printk7(fmt,args...)
219
#endif
220
 
221
#ifdef DEBUG_DCACHE
222
#define printk8(fmt,args...) \
223
        if (debug_info) printk(DEBUG_DCACHE fmt,##args)
224
#else
225
#define printk8(fmt,args...)
226
#endif
227
 
228
#ifdef DEBUG_MOUNT
229
#define printk9(fmt,args...) \
230
        if (debug_info) printk(DEBUG_MOUNT fmt,##args)
231
#else
232
#define printk9(fmt,args...)
233
#endif
234
 
235
#ifdef DEBUG_DCACHE_PURGE     
236
#define printka(fmt,args...) \
237
        if (debug_info) printk(DEBUG_DCACHE_PURGE fmt,##args)
238
#else
239
#define printka(fmt,args...)
240
#endif
241
 
242
#ifdef DEBUG_MAININIT
243
#define printkb(fmt,args...) \
244
        if (debug_info) printk(DEBUG_MAININIT fmt,##args)
245
#else
246
#define printkb(fmt,args...)
247
#endif
248
 
249
#ifdef DEBUG_MAINEND
250
#define printkc(fmt,args...) \
251
        if (debug_info) printk(DEBUG_MAINEND fmt,##args)
252
#else
253
#define printkc(fmt,args...)
254
#endif
255
 
256
#ifdef DEBUG_UNLINK
257
#define printkd(fmt,args...) \
258
        if (debug_info) printk(DEBUG_UNLINK fmt,##args)
259
#else
260
#define printkd(fmt,args...)
261
#endif
262
 
263
#endif
264