1 |
1626 |
jcastillo |
#ifndef _TRACING_H
|
2 |
|
|
#define _TRACING_H
|
3 |
|
|
|
4 |
|
|
/*
|
5 |
|
|
* Copyright (C) 1994-1995 Bas Laarhoven.
|
6 |
|
|
|
7 |
|
|
This program is free software; you can redistribute it and/or modify
|
8 |
|
|
it under the terms of the GNU General Public License as published by
|
9 |
|
|
the Free Software Foundation; either version 2, or (at your option)
|
10 |
|
|
any later version.
|
11 |
|
|
|
12 |
|
|
This program is distributed in the hope that it will be useful,
|
13 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
|
|
GNU General Public License for more details.
|
16 |
|
|
|
17 |
|
|
You should have received a copy of the GNU General Public License
|
18 |
|
|
along with this program; see the file COPYING. If not, write to
|
19 |
|
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
20 |
|
|
|
21 |
|
|
*
|
22 |
|
|
$Source: /home/marcus/revision_ctrl_test/oc_cvs/cvs/or1k/rc203soc/sw/uClinux/drivers/char/ftape/tracing.h,v $
|
23 |
|
|
$Author: jcastillo $
|
24 |
|
|
*
|
25 |
|
|
$Revision: 1.1 $
|
26 |
|
|
$Date: 2005-12-20 10:16:53 $
|
27 |
|
|
$State: Exp $
|
28 |
|
|
*
|
29 |
|
|
* This file contains definitions that eases the debugging
|
30 |
|
|
* of the QIC-40/80 floppy-tape driver for Linux.
|
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 |
|
|
/* Global variables declared in tracing.c
|
86 |
|
|
*/
|
87 |
|
|
extern unsigned char trace_id;
|
88 |
|
|
extern int tracing; /* sets default level */
|
89 |
|
|
extern int function_nest_level;
|
90 |
|
|
|
91 |
|
|
/* Global functions declared in tracing.c
|
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 /* NO_TRACE_AT_ALL */
|
98 |
|
|
|
99 |
|
|
#endif
|