1153323Srodrigc/*
2159451Srodrigc * Copyright (c) 2000,2005 Silicon Graphics, Inc.
3159451Srodrigc * All Rights Reserved.
4153323Srodrigc *
5159451Srodrigc * This program is free software; you can redistribute it and/or
6159451Srodrigc * modify it under the terms of the GNU General Public License as
7153323Srodrigc * published by the Free Software Foundation.
8153323Srodrigc *
9159451Srodrigc * This program is distributed in the hope that it would be useful,
10159451Srodrigc * but WITHOUT ANY WARRANTY; without even the implied warranty of
11159451Srodrigc * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12159451Srodrigc * GNU General Public License for more details.
13153323Srodrigc *
14159451Srodrigc * You should have received a copy of the GNU General Public License
15159451Srodrigc * along with this program; if not, write the Free Software Foundation,
16159451Srodrigc * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17153323Srodrigc */
18153323Srodrigc#ifndef __XFS_DIR2_TRACE_H__
19153323Srodrigc#define __XFS_DIR2_TRACE_H__
20153323Srodrigc
21153323Srodrigc/*
22153323Srodrigc * Tracing for xfs v2 directories.
23153323Srodrigc */
24153323Srodrigc
25153323Srodrigc#if defined(XFS_DIR2_TRACE)
26153323Srodrigc
27153323Srodrigcstruct ktrace;
28153323Srodrigcstruct xfs_dabuf;
29153323Srodrigcstruct xfs_da_args;
30153323Srodrigc
31153323Srodrigc#define	XFS_DIR2_GTRACE_SIZE		4096	/* global buffer */
32153323Srodrigc#define	XFS_DIR2_KTRACE_SIZE		32	/* per-inode buffer */
33153323Srodrigcextern struct ktrace *xfs_dir2_trace_buf;
34153323Srodrigc
35153323Srodrigc#define	XFS_DIR2_KTRACE_ARGS		1	/* args only */
36153323Srodrigc#define	XFS_DIR2_KTRACE_ARGS_B		2	/* args + buffer */
37153323Srodrigc#define	XFS_DIR2_KTRACE_ARGS_BB		3	/* args + 2 buffers */
38153323Srodrigc#define	XFS_DIR2_KTRACE_ARGS_DB		4	/* args, db, buffer */
39153323Srodrigc#define	XFS_DIR2_KTRACE_ARGS_I		5	/* args, inum */
40153323Srodrigc#define	XFS_DIR2_KTRACE_ARGS_S		6	/* args, int */
41153323Srodrigc#define	XFS_DIR2_KTRACE_ARGS_SB		7	/* args, int, buffer */
42153323Srodrigc#define	XFS_DIR2_KTRACE_ARGS_BIBII	8	/* args, buf/int/buf/int/int */
43153323Srodrigc
44153323Srodrigcvoid xfs_dir2_trace_args(char *where, struct xfs_da_args *args);
45153323Srodrigcvoid xfs_dir2_trace_args_b(char *where, struct xfs_da_args *args,
46153323Srodrigc			   struct xfs_dabuf *bp);
47153323Srodrigcvoid xfs_dir2_trace_args_bb(char *where, struct xfs_da_args *args,
48153323Srodrigc			    struct xfs_dabuf *lbp, struct xfs_dabuf *dbp);
49153323Srodrigcvoid xfs_dir2_trace_args_bibii(char *where, struct xfs_da_args *args,
50153323Srodrigc			       struct xfs_dabuf *bs, int ss,
51153323Srodrigc			       struct xfs_dabuf *bd, int sd, int c);
52153323Srodrigcvoid xfs_dir2_trace_args_db(char *where, struct xfs_da_args *args,
53153323Srodrigc			    xfs_dir2_db_t db, struct xfs_dabuf *bp);
54153323Srodrigcvoid xfs_dir2_trace_args_i(char *where, struct xfs_da_args *args, xfs_ino_t i);
55153323Srodrigcvoid xfs_dir2_trace_args_s(char *where, struct xfs_da_args *args, int s);
56153323Srodrigcvoid xfs_dir2_trace_args_sb(char *where, struct xfs_da_args *args, int s,
57153323Srodrigc			    struct xfs_dabuf *bp);
58153323Srodrigc
59153323Srodrigc#else	/* XFS_DIR2_TRACE */
60153323Srodrigc
61153323Srodrigc#define	xfs_dir2_trace_args(where, args)
62153323Srodrigc#define	xfs_dir2_trace_args_b(where, args, bp)
63153323Srodrigc#define	xfs_dir2_trace_args_bb(where, args, lbp, dbp)
64153323Srodrigc#define	xfs_dir2_trace_args_bibii(where, args, bs, ss, bd, sd, c)
65153323Srodrigc#define	xfs_dir2_trace_args_db(where, args, db, bp)
66153323Srodrigc#define	xfs_dir2_trace_args_i(where, args, i)
67153323Srodrigc#define	xfs_dir2_trace_args_s(where, args, s)
68153323Srodrigc#define	xfs_dir2_trace_args_sb(where, args, s, bp)
69153323Srodrigc
70153323Srodrigc#endif	/* XFS_DIR2_TRACE */
71153323Srodrigc
72153323Srodrigc#endif	/* __XFS_DIR2_TRACE_H__ */
73