2 * Copyright (c) 2008 Silicon Graphics, Inc.
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
19 #include "xfs_types.h"
21 #include "xfs_bmap_btree.h"
22 #include "xfs_alloc_btree.h"
23 #include "xfs_ialloc_btree.h"
24 #include "xfs_inode.h"
25 #include "xfs_btree.h"
26 #include "xfs_btree_trace.h"
30 struct xfs_btree_cur
*cur
,
31 union xfs_btree_ptr ptr
,
35 if (cur
->bc_flags
& XFS_BTREE_LONG_PTRS
) {
36 __u64 val
= be64_to_cpu(ptr
.l
);
41 *low
= be32_to_cpu(ptr
.s
);
46 * Add a trace buffer entry for arguments, for a buffer & 1 integer arg.
49 xfs_btree_trace_argbi(
51 struct xfs_btree_cur
*cur
,
56 cur
->bc_ops
->trace_enter(cur
, func
, XBT_ARGS
, XFS_BTREE_KTRACE_ARGBI
,
57 line
, (__psunsigned_t
)b
, i
, 0, 0, 0, 0, 0,
62 * Add a trace buffer entry for arguments, for a buffer & 2 integer args.
65 xfs_btree_trace_argbii(
67 struct xfs_btree_cur
*cur
,
73 cur
->bc_ops
->trace_enter(cur
, func
, XBT_ARGS
, XFS_BTREE_KTRACE_ARGBII
,
74 line
, (__psunsigned_t
)b
, i0
, i1
, 0, 0, 0, 0,
79 * Add a trace buffer entry for arguments, for 3 block-length args
83 xfs_btree_trace_argfffi(
85 struct xfs_btree_cur
*cur
,
92 cur
->bc_ops
->trace_enter(cur
, func
, XBT_ARGS
, XFS_BTREE_KTRACE_ARGFFFI
,
101 * Add a trace buffer entry for arguments, for one integer arg.
104 xfs_btree_trace_argi(
106 struct xfs_btree_cur
*cur
,
110 cur
->bc_ops
->trace_enter(cur
, func
, XBT_ARGS
, XFS_BTREE_KTRACE_ARGI
,
111 line
, i
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
115 * Add a trace buffer entry for arguments, for int, fsblock, key.
118 xfs_btree_trace_argipk(
120 struct xfs_btree_cur
*cur
,
122 union xfs_btree_ptr ptr
,
123 union xfs_btree_key
*key
,
126 __psunsigned_t high
, low
;
129 xfs_btree_trace_ptr(cur
, ptr
, &high
, &low
);
130 cur
->bc_ops
->trace_key(cur
, key
, &l0
, &l1
);
131 cur
->bc_ops
->trace_enter(cur
, func
, XBT_ARGS
, XFS_BTREE_KTRACE_ARGIPK
,
139 * Add a trace buffer entry for arguments, for int, fsblock, rec.
142 xfs_btree_trace_argipr(
144 struct xfs_btree_cur
*cur
,
146 union xfs_btree_ptr ptr
,
147 union xfs_btree_rec
*rec
,
150 __psunsigned_t high
, low
;
151 __uint64_t l0
, l1
, l2
;
153 xfs_btree_trace_ptr(cur
, ptr
, &high
, &low
);
154 cur
->bc_ops
->trace_record(cur
, rec
, &l0
, &l1
, &l2
);
155 cur
->bc_ops
->trace_enter(cur
, func
, XBT_ARGS
, XFS_BTREE_KTRACE_ARGIPR
,
165 * Add a trace buffer entry for arguments, for int, key.
168 xfs_btree_trace_argik(
170 struct xfs_btree_cur
*cur
,
172 union xfs_btree_key
*key
,
177 cur
->bc_ops
->trace_key(cur
, key
, &l0
, &l1
);
178 cur
->bc_ops
->trace_enter(cur
, func
, XBT_ARGS
, XFS_BTREE_KTRACE_ARGIK
,
186 * Add a trace buffer entry for arguments, for record.
189 xfs_btree_trace_argr(
191 struct xfs_btree_cur
*cur
,
192 union xfs_btree_rec
*rec
,
195 __uint64_t l0
, l1
, l2
;
197 cur
->bc_ops
->trace_record(cur
, rec
, &l0
, &l1
, &l2
);
198 cur
->bc_ops
->trace_enter(cur
, func
, XBT_ARGS
, XFS_BTREE_KTRACE_ARGR
,
207 * Add a trace buffer entry for the cursor/operation.
210 xfs_btree_trace_cursor(
212 struct xfs_btree_cur
*cur
,
238 cur
->bc_ops
->trace_cursor(cur
, &s0
, &l0
, &l1
);
239 cur
->bc_ops
->trace_enter(cur
, func
, s
, XFS_BTREE_KTRACE_CUR
, line
,
243 (__psunsigned_t
)cur
->bc_bufs
[0],
244 (__psunsigned_t
)cur
->bc_bufs
[1],
245 (__psunsigned_t
)cur
->bc_bufs
[2],
246 (__psunsigned_t
)cur
->bc_bufs
[3],
247 (cur
->bc_ptrs
[0] << 16) | cur
->bc_ptrs
[1],
248 (cur
->bc_ptrs
[2] << 16) | cur
->bc_ptrs
[3]);