Linux 2.6.35-rc2
[linux/fpc-iii.git] / fs / xfs / xfs_btree_trace.h
blob2d8a309873ea619c2fa616639d2e43ab215490b4
1 /*
2 * Copyright (c) 2008 Silicon Graphics, Inc.
3 * All Rights Reserved.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef __XFS_BTREE_TRACE_H__
19 #define __XFS_BTREE_TRACE_H__
21 struct xfs_btree_cur;
22 struct xfs_buf;
26 * Trace hooks.
27 * i,j = integer (32 bit)
28 * b = btree block buffer (xfs_buf_t)
29 * p = btree ptr
30 * r = btree record
31 * k = btree key
34 #ifdef XFS_BTREE_TRACE
37 * Trace buffer entry types.
39 #define XFS_BTREE_KTRACE_ARGBI 1
40 #define XFS_BTREE_KTRACE_ARGBII 2
41 #define XFS_BTREE_KTRACE_ARGFFFI 3
42 #define XFS_BTREE_KTRACE_ARGI 4
43 #define XFS_BTREE_KTRACE_ARGIPK 5
44 #define XFS_BTREE_KTRACE_ARGIPR 6
45 #define XFS_BTREE_KTRACE_ARGIK 7
46 #define XFS_BTREE_KTRACE_ARGR 8
47 #define XFS_BTREE_KTRACE_CUR 9
50 * Sub-types for cursor traces.
52 #define XBT_ARGS 0
53 #define XBT_ENTRY 1
54 #define XBT_ERROR 2
55 #define XBT_EXIT 3
57 void xfs_btree_trace_argbi(const char *, struct xfs_btree_cur *,
58 struct xfs_buf *, int, int);
59 void xfs_btree_trace_argbii(const char *, struct xfs_btree_cur *,
60 struct xfs_buf *, int, int, int);
61 void xfs_btree_trace_argi(const char *, struct xfs_btree_cur *, int, int);
62 void xfs_btree_trace_argipk(const char *, struct xfs_btree_cur *, int,
63 union xfs_btree_ptr, union xfs_btree_key *, int);
64 void xfs_btree_trace_argipr(const char *, struct xfs_btree_cur *, int,
65 union xfs_btree_ptr, union xfs_btree_rec *, int);
66 void xfs_btree_trace_argik(const char *, struct xfs_btree_cur *, int,
67 union xfs_btree_key *, int);
68 void xfs_btree_trace_argr(const char *, struct xfs_btree_cur *,
69 union xfs_btree_rec *, int);
70 void xfs_btree_trace_cursor(const char *, struct xfs_btree_cur *, int, int);
72 #define XFS_BTREE_TRACE_ARGBI(c, b, i) \
73 xfs_btree_trace_argbi(__func__, c, b, i, __LINE__)
74 #define XFS_BTREE_TRACE_ARGBII(c, b, i, j) \
75 xfs_btree_trace_argbii(__func__, c, b, i, j, __LINE__)
76 #define XFS_BTREE_TRACE_ARGI(c, i) \
77 xfs_btree_trace_argi(__func__, c, i, __LINE__)
78 #define XFS_BTREE_TRACE_ARGIPK(c, i, p, k) \
79 xfs_btree_trace_argipk(__func__, c, i, p, k, __LINE__)
80 #define XFS_BTREE_TRACE_ARGIPR(c, i, p, r) \
81 xfs_btree_trace_argipr(__func__, c, i, p, r, __LINE__)
82 #define XFS_BTREE_TRACE_ARGIK(c, i, k) \
83 xfs_btree_trace_argik(__func__, c, i, k, __LINE__)
84 #define XFS_BTREE_TRACE_ARGR(c, r) \
85 xfs_btree_trace_argr(__func__, c, r, __LINE__)
86 #define XFS_BTREE_TRACE_CURSOR(c, t) \
87 xfs_btree_trace_cursor(__func__, c, t, __LINE__)
88 #else
89 #define XFS_BTREE_TRACE_ARGBI(c, b, i)
90 #define XFS_BTREE_TRACE_ARGBII(c, b, i, j)
91 #define XFS_BTREE_TRACE_ARGI(c, i)
92 #define XFS_BTREE_TRACE_ARGIPK(c, i, p, s)
93 #define XFS_BTREE_TRACE_ARGIPR(c, i, p, r)
94 #define XFS_BTREE_TRACE_ARGIK(c, i, k)
95 #define XFS_BTREE_TRACE_ARGR(c, r)
96 #define XFS_BTREE_TRACE_CURSOR(c, t)
97 #endif /* XFS_BTREE_TRACE */
99 #endif /* __XFS_BTREE_TRACE_H__ */