Commit c84470dda7a1165d90f55c2025c4c8ca403d485e
1 parent
ea15ab3cdd
Exists in
master
and in
4 other branches
xfs: remove leftovers of the old btree tracing code
Remove various bits left over from the old kdb-only btree tracing code, but leave the actual trace point stubs in place to ease adding new event based btree tracing. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Showing 11 changed files with 19 additions and 621 deletions Side-by-side Diff
fs/xfs/Makefile
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/xfs_alloc_btree.c
... | ... | @@ -31,7 +31,6 @@ |
31 | 31 | #include "xfs_dinode.h" |
32 | 32 | #include "xfs_inode.h" |
33 | 33 | #include "xfs_btree.h" |
34 | -#include "xfs_btree_trace.h" | |
35 | 34 | #include "xfs_alloc.h" |
36 | 35 | #include "xfs_error.h" |
37 | 36 | #include "xfs_trace.h" |
... | ... | @@ -311,72 +310,6 @@ |
311 | 310 | } |
312 | 311 | #endif /* DEBUG */ |
313 | 312 | |
314 | -#ifdef XFS_BTREE_TRACE | |
315 | -ktrace_t *xfs_allocbt_trace_buf; | |
316 | - | |
317 | -STATIC void | |
318 | -xfs_allocbt_trace_enter( | |
319 | - struct xfs_btree_cur *cur, | |
320 | - const char *func, | |
321 | - char *s, | |
322 | - int type, | |
323 | - int line, | |
324 | - __psunsigned_t a0, | |
325 | - __psunsigned_t a1, | |
326 | - __psunsigned_t a2, | |
327 | - __psunsigned_t a3, | |
328 | - __psunsigned_t a4, | |
329 | - __psunsigned_t a5, | |
330 | - __psunsigned_t a6, | |
331 | - __psunsigned_t a7, | |
332 | - __psunsigned_t a8, | |
333 | - __psunsigned_t a9, | |
334 | - __psunsigned_t a10) | |
335 | -{ | |
336 | - ktrace_enter(xfs_allocbt_trace_buf, (void *)(__psint_t)type, | |
337 | - (void *)func, (void *)s, NULL, (void *)cur, | |
338 | - (void *)a0, (void *)a1, (void *)a2, (void *)a3, | |
339 | - (void *)a4, (void *)a5, (void *)a6, (void *)a7, | |
340 | - (void *)a8, (void *)a9, (void *)a10); | |
341 | -} | |
342 | - | |
343 | -STATIC void | |
344 | -xfs_allocbt_trace_cursor( | |
345 | - struct xfs_btree_cur *cur, | |
346 | - __uint32_t *s0, | |
347 | - __uint64_t *l0, | |
348 | - __uint64_t *l1) | |
349 | -{ | |
350 | - *s0 = cur->bc_private.a.agno; | |
351 | - *l0 = cur->bc_rec.a.ar_startblock; | |
352 | - *l1 = cur->bc_rec.a.ar_blockcount; | |
353 | -} | |
354 | - | |
355 | -STATIC void | |
356 | -xfs_allocbt_trace_key( | |
357 | - struct xfs_btree_cur *cur, | |
358 | - union xfs_btree_key *key, | |
359 | - __uint64_t *l0, | |
360 | - __uint64_t *l1) | |
361 | -{ | |
362 | - *l0 = be32_to_cpu(key->alloc.ar_startblock); | |
363 | - *l1 = be32_to_cpu(key->alloc.ar_blockcount); | |
364 | -} | |
365 | - | |
366 | -STATIC void | |
367 | -xfs_allocbt_trace_record( | |
368 | - struct xfs_btree_cur *cur, | |
369 | - union xfs_btree_rec *rec, | |
370 | - __uint64_t *l0, | |
371 | - __uint64_t *l1, | |
372 | - __uint64_t *l2) | |
373 | -{ | |
374 | - *l0 = be32_to_cpu(rec->alloc.ar_startblock); | |
375 | - *l1 = be32_to_cpu(rec->alloc.ar_blockcount); | |
376 | - *l2 = 0; | |
377 | -} | |
378 | -#endif /* XFS_BTREE_TRACE */ | |
379 | - | |
380 | 313 | static const struct xfs_btree_ops xfs_allocbt_ops = { |
381 | 314 | .rec_len = sizeof(xfs_alloc_rec_t), |
382 | 315 | .key_len = sizeof(xfs_alloc_key_t), |
383 | 316 | |
... | ... | @@ -393,17 +326,9 @@ |
393 | 326 | .init_rec_from_cur = xfs_allocbt_init_rec_from_cur, |
394 | 327 | .init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur, |
395 | 328 | .key_diff = xfs_allocbt_key_diff, |
396 | - | |
397 | 329 | #ifdef DEBUG |
398 | 330 | .keys_inorder = xfs_allocbt_keys_inorder, |
399 | 331 | .recs_inorder = xfs_allocbt_recs_inorder, |
400 | -#endif | |
401 | - | |
402 | -#ifdef XFS_BTREE_TRACE | |
403 | - .trace_enter = xfs_allocbt_trace_enter, | |
404 | - .trace_cursor = xfs_allocbt_trace_cursor, | |
405 | - .trace_key = xfs_allocbt_trace_key, | |
406 | - .trace_record = xfs_allocbt_trace_record, | |
407 | 332 | #endif |
408 | 333 | }; |
409 | 334 |
fs/xfs/xfs_bmap_btree.c
... | ... | @@ -33,7 +33,6 @@ |
33 | 33 | #include "xfs_inode_item.h" |
34 | 34 | #include "xfs_alloc.h" |
35 | 35 | #include "xfs_btree.h" |
36 | -#include "xfs_btree_trace.h" | |
37 | 36 | #include "xfs_itable.h" |
38 | 37 | #include "xfs_bmap.h" |
39 | 38 | #include "xfs_error.h" |
... | ... | @@ -732,95 +731,6 @@ |
732 | 731 | } |
733 | 732 | #endif /* DEBUG */ |
734 | 733 | |
735 | -#ifdef XFS_BTREE_TRACE | |
736 | -ktrace_t *xfs_bmbt_trace_buf; | |
737 | - | |
738 | -STATIC void | |
739 | -xfs_bmbt_trace_enter( | |
740 | - struct xfs_btree_cur *cur, | |
741 | - const char *func, | |
742 | - char *s, | |
743 | - int type, | |
744 | - int line, | |
745 | - __psunsigned_t a0, | |
746 | - __psunsigned_t a1, | |
747 | - __psunsigned_t a2, | |
748 | - __psunsigned_t a3, | |
749 | - __psunsigned_t a4, | |
750 | - __psunsigned_t a5, | |
751 | - __psunsigned_t a6, | |
752 | - __psunsigned_t a7, | |
753 | - __psunsigned_t a8, | |
754 | - __psunsigned_t a9, | |
755 | - __psunsigned_t a10) | |
756 | -{ | |
757 | - struct xfs_inode *ip = cur->bc_private.b.ip; | |
758 | - int whichfork = cur->bc_private.b.whichfork; | |
759 | - | |
760 | - ktrace_enter(xfs_bmbt_trace_buf, | |
761 | - (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), | |
762 | - (void *)func, (void *)s, (void *)ip, (void *)cur, | |
763 | - (void *)a0, (void *)a1, (void *)a2, (void *)a3, | |
764 | - (void *)a4, (void *)a5, (void *)a6, (void *)a7, | |
765 | - (void *)a8, (void *)a9, (void *)a10); | |
766 | -} | |
767 | - | |
768 | -STATIC void | |
769 | -xfs_bmbt_trace_cursor( | |
770 | - struct xfs_btree_cur *cur, | |
771 | - __uint32_t *s0, | |
772 | - __uint64_t *l0, | |
773 | - __uint64_t *l1) | |
774 | -{ | |
775 | - struct xfs_bmbt_rec_host r; | |
776 | - | |
777 | - xfs_bmbt_set_all(&r, &cur->bc_rec.b); | |
778 | - | |
779 | - *s0 = (cur->bc_nlevels << 24) | | |
780 | - (cur->bc_private.b.flags << 16) | | |
781 | - cur->bc_private.b.allocated; | |
782 | - *l0 = r.l0; | |
783 | - *l1 = r.l1; | |
784 | -} | |
785 | - | |
786 | -STATIC void | |
787 | -xfs_bmbt_trace_key( | |
788 | - struct xfs_btree_cur *cur, | |
789 | - union xfs_btree_key *key, | |
790 | - __uint64_t *l0, | |
791 | - __uint64_t *l1) | |
792 | -{ | |
793 | - *l0 = be64_to_cpu(key->bmbt.br_startoff); | |
794 | - *l1 = 0; | |
795 | -} | |
796 | - | |
797 | -/* Endian flipping versions of the bmbt extraction functions */ | |
798 | -STATIC void | |
799 | -xfs_bmbt_disk_get_all( | |
800 | - xfs_bmbt_rec_t *r, | |
801 | - xfs_bmbt_irec_t *s) | |
802 | -{ | |
803 | - __xfs_bmbt_get_all(get_unaligned_be64(&r->l0), | |
804 | - get_unaligned_be64(&r->l1), s); | |
805 | -} | |
806 | - | |
807 | -STATIC void | |
808 | -xfs_bmbt_trace_record( | |
809 | - struct xfs_btree_cur *cur, | |
810 | - union xfs_btree_rec *rec, | |
811 | - __uint64_t *l0, | |
812 | - __uint64_t *l1, | |
813 | - __uint64_t *l2) | |
814 | -{ | |
815 | - struct xfs_bmbt_irec irec; | |
816 | - | |
817 | - xfs_bmbt_disk_get_all(&rec->bmbt, &irec); | |
818 | - *l0 = irec.br_startoff; | |
819 | - *l1 = irec.br_startblock; | |
820 | - *l2 = irec.br_blockcount; | |
821 | -} | |
822 | -#endif /* XFS_BTREE_TRACE */ | |
823 | - | |
824 | 734 | static const struct xfs_btree_ops xfs_bmbt_ops = { |
825 | 735 | .rec_len = sizeof(xfs_bmbt_rec_t), |
826 | 736 | .key_len = sizeof(xfs_bmbt_key_t), |
827 | 737 | |
... | ... | @@ -837,17 +747,9 @@ |
837 | 747 | .init_rec_from_cur = xfs_bmbt_init_rec_from_cur, |
838 | 748 | .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, |
839 | 749 | .key_diff = xfs_bmbt_key_diff, |
840 | - | |
841 | 750 | #ifdef DEBUG |
842 | 751 | .keys_inorder = xfs_bmbt_keys_inorder, |
843 | 752 | .recs_inorder = xfs_bmbt_recs_inorder, |
844 | -#endif | |
845 | - | |
846 | -#ifdef XFS_BTREE_TRACE | |
847 | - .trace_enter = xfs_bmbt_trace_enter, | |
848 | - .trace_cursor = xfs_bmbt_trace_cursor, | |
849 | - .trace_key = xfs_bmbt_trace_key, | |
850 | - .trace_record = xfs_bmbt_trace_record, | |
851 | 753 | #endif |
852 | 754 | }; |
853 | 755 |
fs/xfs/xfs_btree.c
fs/xfs/xfs_btree.h
... | ... | @@ -199,25 +199,6 @@ |
199 | 199 | union xfs_btree_rec *r1, |
200 | 200 | union xfs_btree_rec *r2); |
201 | 201 | #endif |
202 | - | |
203 | - /* btree tracing */ | |
204 | -#ifdef XFS_BTREE_TRACE | |
205 | - void (*trace_enter)(struct xfs_btree_cur *, const char *, | |
206 | - char *, int, int, __psunsigned_t, | |
207 | - __psunsigned_t, __psunsigned_t, | |
208 | - __psunsigned_t, __psunsigned_t, | |
209 | - __psunsigned_t, __psunsigned_t, | |
210 | - __psunsigned_t, __psunsigned_t, | |
211 | - __psunsigned_t, __psunsigned_t); | |
212 | - void (*trace_cursor)(struct xfs_btree_cur *, __uint32_t *, | |
213 | - __uint64_t *, __uint64_t *); | |
214 | - void (*trace_key)(struct xfs_btree_cur *, | |
215 | - union xfs_btree_key *, __uint64_t *, | |
216 | - __uint64_t *); | |
217 | - void (*trace_record)(struct xfs_btree_cur *, | |
218 | - union xfs_btree_rec *, __uint64_t *, | |
219 | - __uint64_t *, __uint64_t *); | |
220 | -#endif | |
221 | 202 | }; |
222 | 203 | |
223 | 204 | /* |
... | ... | @@ -451,6 +432,25 @@ |
451 | 432 | #define XFS_FSB_SANITY_CHECK(mp,fsb) \ |
452 | 433 | (XFS_FSB_TO_AGNO(mp, fsb) < mp->m_sb.sb_agcount && \ |
453 | 434 | XFS_FSB_TO_AGBNO(mp, fsb) < mp->m_sb.sb_agblocks) |
435 | + | |
436 | +/* | |
437 | + * Trace hooks. Currently not implemented as they need to be ported | |
438 | + * over to the generic tracing functionality, which is some effort. | |
439 | + * | |
440 | + * i,j = integer (32 bit) | |
441 | + * b = btree block buffer (xfs_buf_t) | |
442 | + * p = btree ptr | |
443 | + * r = btree record | |
444 | + * k = btree key | |
445 | + */ | |
446 | +#define XFS_BTREE_TRACE_ARGBI(c, b, i) | |
447 | +#define XFS_BTREE_TRACE_ARGBII(c, b, i, j) | |
448 | +#define XFS_BTREE_TRACE_ARGI(c, i) | |
449 | +#define XFS_BTREE_TRACE_ARGIPK(c, i, p, s) | |
450 | +#define XFS_BTREE_TRACE_ARGIPR(c, i, p, r) | |
451 | +#define XFS_BTREE_TRACE_ARGIK(c, i, k) | |
452 | +#define XFS_BTREE_TRACE_ARGR(c, r) | |
453 | +#define XFS_BTREE_TRACE_CURSOR(c, t) | |
454 | 454 | |
455 | 455 | #endif /* __XFS_BTREE_H__ */ |
fs/xfs/xfs_btree_trace.c
1 | -/* | |
2 | - * Copyright (c) 2008 Silicon Graphics, Inc. | |
3 | - * All Rights Reserved. | |
4 | - * | |
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. | |
8 | - * | |
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. | |
13 | - * | |
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 | |
17 | - */ | |
18 | -#include "xfs.h" | |
19 | -#include "xfs_types.h" | |
20 | -#include "xfs_inum.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" | |
27 | - | |
28 | -STATIC void | |
29 | -xfs_btree_trace_ptr( | |
30 | - struct xfs_btree_cur *cur, | |
31 | - union xfs_btree_ptr ptr, | |
32 | - __psunsigned_t *high, | |
33 | - __psunsigned_t *low) | |
34 | -{ | |
35 | - if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { | |
36 | - __u64 val = be64_to_cpu(ptr.l); | |
37 | - *high = val >> 32; | |
38 | - *low = (int)val; | |
39 | - } else { | |
40 | - *high = 0; | |
41 | - *low = be32_to_cpu(ptr.s); | |
42 | - } | |
43 | -} | |
44 | - | |
45 | -/* | |
46 | - * Add a trace buffer entry for arguments, for a buffer & 1 integer arg. | |
47 | - */ | |
48 | -void | |
49 | -xfs_btree_trace_argbi( | |
50 | - const char *func, | |
51 | - struct xfs_btree_cur *cur, | |
52 | - struct xfs_buf *b, | |
53 | - int i, | |
54 | - int line) | |
55 | -{ | |
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, | |
58 | - 0, 0, 0, 0); | |
59 | -} | |
60 | - | |
61 | -/* | |
62 | - * Add a trace buffer entry for arguments, for a buffer & 2 integer args. | |
63 | - */ | |
64 | -void | |
65 | -xfs_btree_trace_argbii( | |
66 | - const char *func, | |
67 | - struct xfs_btree_cur *cur, | |
68 | - struct xfs_buf *b, | |
69 | - int i0, | |
70 | - int i1, | |
71 | - int line) | |
72 | -{ | |
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, | |
75 | - 0, 0, 0, 0); | |
76 | -} | |
77 | - | |
78 | -/* | |
79 | - * Add a trace buffer entry for arguments, for 3 block-length args | |
80 | - * and an integer arg. | |
81 | - */ | |
82 | -void | |
83 | -xfs_btree_trace_argfffi( | |
84 | - const char *func, | |
85 | - struct xfs_btree_cur *cur, | |
86 | - xfs_dfiloff_t o, | |
87 | - xfs_dfsbno_t b, | |
88 | - xfs_dfilblks_t i, | |
89 | - int j, | |
90 | - int line) | |
91 | -{ | |
92 | - cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGFFFI, | |
93 | - line, | |
94 | - o >> 32, (int)o, | |
95 | - b >> 32, (int)b, | |
96 | - i >> 32, (int)i, | |
97 | - (int)j, 0, 0, 0, 0); | |
98 | -} | |
99 | - | |
100 | -/* | |
101 | - * Add a trace buffer entry for arguments, for one integer arg. | |
102 | - */ | |
103 | -void | |
104 | -xfs_btree_trace_argi( | |
105 | - const char *func, | |
106 | - struct xfs_btree_cur *cur, | |
107 | - int i, | |
108 | - int line) | |
109 | -{ | |
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); | |
112 | -} | |
113 | - | |
114 | -/* | |
115 | - * Add a trace buffer entry for arguments, for int, fsblock, key. | |
116 | - */ | |
117 | -void | |
118 | -xfs_btree_trace_argipk( | |
119 | - const char *func, | |
120 | - struct xfs_btree_cur *cur, | |
121 | - int i, | |
122 | - union xfs_btree_ptr ptr, | |
123 | - union xfs_btree_key *key, | |
124 | - int line) | |
125 | -{ | |
126 | - __psunsigned_t high, low; | |
127 | - __uint64_t l0, l1; | |
128 | - | |
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, | |
132 | - line, i, high, low, | |
133 | - l0 >> 32, (int)l0, | |
134 | - l1 >> 32, (int)l1, | |
135 | - 0, 0, 0, 0); | |
136 | -} | |
137 | - | |
138 | -/* | |
139 | - * Add a trace buffer entry for arguments, for int, fsblock, rec. | |
140 | - */ | |
141 | -void | |
142 | -xfs_btree_trace_argipr( | |
143 | - const char *func, | |
144 | - struct xfs_btree_cur *cur, | |
145 | - int i, | |
146 | - union xfs_btree_ptr ptr, | |
147 | - union xfs_btree_rec *rec, | |
148 | - int line) | |
149 | -{ | |
150 | - __psunsigned_t high, low; | |
151 | - __uint64_t l0, l1, l2; | |
152 | - | |
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, | |
156 | - line, i, | |
157 | - high, low, | |
158 | - l0 >> 32, (int)l0, | |
159 | - l1 >> 32, (int)l1, | |
160 | - l2 >> 32, (int)l2, | |
161 | - 0, 0); | |
162 | -} | |
163 | - | |
164 | -/* | |
165 | - * Add a trace buffer entry for arguments, for int, key. | |
166 | - */ | |
167 | -void | |
168 | -xfs_btree_trace_argik( | |
169 | - const char *func, | |
170 | - struct xfs_btree_cur *cur, | |
171 | - int i, | |
172 | - union xfs_btree_key *key, | |
173 | - int line) | |
174 | -{ | |
175 | - __uint64_t l0, l1; | |
176 | - | |
177 | - cur->bc_ops->trace_key(cur, key, &l0, &l1); | |
178 | - cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGIK, | |
179 | - line, i, | |
180 | - l0 >> 32, (int)l0, | |
181 | - l1 >> 32, (int)l1, | |
182 | - 0, 0, 0, 0, 0, 0); | |
183 | -} | |
184 | - | |
185 | -/* | |
186 | - * Add a trace buffer entry for arguments, for record. | |
187 | - */ | |
188 | -void | |
189 | -xfs_btree_trace_argr( | |
190 | - const char *func, | |
191 | - struct xfs_btree_cur *cur, | |
192 | - union xfs_btree_rec *rec, | |
193 | - int line) | |
194 | -{ | |
195 | - __uint64_t l0, l1, l2; | |
196 | - | |
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, | |
199 | - line, | |
200 | - l0 >> 32, (int)l0, | |
201 | - l1 >> 32, (int)l1, | |
202 | - l2 >> 32, (int)l2, | |
203 | - 0, 0, 0, 0, 0); | |
204 | -} | |
205 | - | |
206 | -/* | |
207 | - * Add a trace buffer entry for the cursor/operation. | |
208 | - */ | |
209 | -void | |
210 | -xfs_btree_trace_cursor( | |
211 | - const char *func, | |
212 | - struct xfs_btree_cur *cur, | |
213 | - int type, | |
214 | - int line) | |
215 | -{ | |
216 | - __uint32_t s0; | |
217 | - __uint64_t l0, l1; | |
218 | - char *s; | |
219 | - | |
220 | - switch (type) { | |
221 | - case XBT_ARGS: | |
222 | - s = "args"; | |
223 | - break; | |
224 | - case XBT_ENTRY: | |
225 | - s = "entry"; | |
226 | - break; | |
227 | - case XBT_ERROR: | |
228 | - s = "error"; | |
229 | - break; | |
230 | - case XBT_EXIT: | |
231 | - s = "exit"; | |
232 | - break; | |
233 | - default: | |
234 | - s = "unknown"; | |
235 | - break; | |
236 | - } | |
237 | - | |
238 | - cur->bc_ops->trace_cursor(cur, &s0, &l0, &l1); | |
239 | - cur->bc_ops->trace_enter(cur, func, s, XFS_BTREE_KTRACE_CUR, line, | |
240 | - s0, | |
241 | - l0 >> 32, (int)l0, | |
242 | - l1 >> 32, (int)l1, | |
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]); | |
249 | -} |
fs/xfs/xfs_btree_trace.h
1 | -/* | |
2 | - * Copyright (c) 2008 Silicon Graphics, Inc. | |
3 | - * All Rights Reserved. | |
4 | - * | |
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. | |
8 | - * | |
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. | |
13 | - * | |
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 | |
17 | - */ | |
18 | -#ifndef __XFS_BTREE_TRACE_H__ | |
19 | -#define __XFS_BTREE_TRACE_H__ | |
20 | - | |
21 | -struct xfs_btree_cur; | |
22 | -struct xfs_buf; | |
23 | - | |
24 | - | |
25 | -/* | |
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 | |
32 | - */ | |
33 | - | |
34 | -#ifdef XFS_BTREE_TRACE | |
35 | - | |
36 | -/* | |
37 | - * Trace buffer entry types. | |
38 | - */ | |
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 | |
48 | - | |
49 | -/* | |
50 | - * Sub-types for cursor traces. | |
51 | - */ | |
52 | -#define XBT_ARGS 0 | |
53 | -#define XBT_ENTRY 1 | |
54 | -#define XBT_ERROR 2 | |
55 | -#define XBT_EXIT 3 | |
56 | - | |
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); | |
71 | - | |
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 */ | |
98 | - | |
99 | -#endif /* __XFS_BTREE_TRACE_H__ */ |
fs/xfs/xfs_ialloc_btree.c
... | ... | @@ -31,7 +31,6 @@ |
31 | 31 | #include "xfs_dinode.h" |
32 | 32 | #include "xfs_inode.h" |
33 | 33 | #include "xfs_btree.h" |
34 | -#include "xfs_btree_trace.h" | |
35 | 34 | #include "xfs_ialloc.h" |
36 | 35 | #include "xfs_alloc.h" |
37 | 36 | #include "xfs_error.h" |
... | ... | @@ -205,72 +204,6 @@ |
205 | 204 | } |
206 | 205 | #endif /* DEBUG */ |
207 | 206 | |
208 | -#ifdef XFS_BTREE_TRACE | |
209 | -ktrace_t *xfs_inobt_trace_buf; | |
210 | - | |
211 | -STATIC void | |
212 | -xfs_inobt_trace_enter( | |
213 | - struct xfs_btree_cur *cur, | |
214 | - const char *func, | |
215 | - char *s, | |
216 | - int type, | |
217 | - int line, | |
218 | - __psunsigned_t a0, | |
219 | - __psunsigned_t a1, | |
220 | - __psunsigned_t a2, | |
221 | - __psunsigned_t a3, | |
222 | - __psunsigned_t a4, | |
223 | - __psunsigned_t a5, | |
224 | - __psunsigned_t a6, | |
225 | - __psunsigned_t a7, | |
226 | - __psunsigned_t a8, | |
227 | - __psunsigned_t a9, | |
228 | - __psunsigned_t a10) | |
229 | -{ | |
230 | - ktrace_enter(xfs_inobt_trace_buf, (void *)(__psint_t)type, | |
231 | - (void *)func, (void *)s, NULL, (void *)cur, | |
232 | - (void *)a0, (void *)a1, (void *)a2, (void *)a3, | |
233 | - (void *)a4, (void *)a5, (void *)a6, (void *)a7, | |
234 | - (void *)a8, (void *)a9, (void *)a10); | |
235 | -} | |
236 | - | |
237 | -STATIC void | |
238 | -xfs_inobt_trace_cursor( | |
239 | - struct xfs_btree_cur *cur, | |
240 | - __uint32_t *s0, | |
241 | - __uint64_t *l0, | |
242 | - __uint64_t *l1) | |
243 | -{ | |
244 | - *s0 = cur->bc_private.a.agno; | |
245 | - *l0 = cur->bc_rec.i.ir_startino; | |
246 | - *l1 = cur->bc_rec.i.ir_free; | |
247 | -} | |
248 | - | |
249 | -STATIC void | |
250 | -xfs_inobt_trace_key( | |
251 | - struct xfs_btree_cur *cur, | |
252 | - union xfs_btree_key *key, | |
253 | - __uint64_t *l0, | |
254 | - __uint64_t *l1) | |
255 | -{ | |
256 | - *l0 = be32_to_cpu(key->inobt.ir_startino); | |
257 | - *l1 = 0; | |
258 | -} | |
259 | - | |
260 | -STATIC void | |
261 | -xfs_inobt_trace_record( | |
262 | - struct xfs_btree_cur *cur, | |
263 | - union xfs_btree_rec *rec, | |
264 | - __uint64_t *l0, | |
265 | - __uint64_t *l1, | |
266 | - __uint64_t *l2) | |
267 | -{ | |
268 | - *l0 = be32_to_cpu(rec->inobt.ir_startino); | |
269 | - *l1 = be32_to_cpu(rec->inobt.ir_freecount); | |
270 | - *l2 = be64_to_cpu(rec->inobt.ir_free); | |
271 | -} | |
272 | -#endif /* XFS_BTREE_TRACE */ | |
273 | - | |
274 | 207 | static const struct xfs_btree_ops xfs_inobt_ops = { |
275 | 208 | .rec_len = sizeof(xfs_inobt_rec_t), |
276 | 209 | .key_len = sizeof(xfs_inobt_key_t), |
277 | 210 | |
... | ... | @@ -286,17 +219,9 @@ |
286 | 219 | .init_rec_from_cur = xfs_inobt_init_rec_from_cur, |
287 | 220 | .init_ptr_from_cur = xfs_inobt_init_ptr_from_cur, |
288 | 221 | .key_diff = xfs_inobt_key_diff, |
289 | - | |
290 | 222 | #ifdef DEBUG |
291 | 223 | .keys_inorder = xfs_inobt_keys_inorder, |
292 | 224 | .recs_inorder = xfs_inobt_recs_inorder, |
293 | -#endif | |
294 | - | |
295 | -#ifdef XFS_BTREE_TRACE | |
296 | - .trace_enter = xfs_inobt_trace_enter, | |
297 | - .trace_cursor = xfs_inobt_trace_cursor, | |
298 | - .trace_key = xfs_inobt_trace_key, | |
299 | - .trace_record = xfs_inobt_trace_record, | |
300 | 225 | #endif |
301 | 226 | }; |
302 | 227 |
fs/xfs/xfs_iget.c