aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2011-02-21 19:22:33 -0500
committerTao Ma <boyu.mt@taobao.com>2011-02-21 19:22:33 -0500
commit2f73e135b83c5001dad84cbd1d445d23fd045b83 (patch)
treefc4cb2ad4987347c3b3264057a259e1016c87d1e /fs
parenta04733d8afad9cd0bfb8269173e30d28fb96088e (diff)
ocfs2: Remove mlog(0) from fs/ocfs2/suballoc.c
This is the 3rd step to remove the debug info of DISK_ALLOC. Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/ocfs2_trace.h212
-rw-r--r--fs/ocfs2/suballoc.c107
2 files changed, 265 insertions, 54 deletions
diff --git a/fs/ocfs2/ocfs2_trace.h b/fs/ocfs2/ocfs2_trace.h
index 5bba629766ca..11980ecba546 100644
--- a/fs/ocfs2/ocfs2_trace.h
+++ b/fs/ocfs2/ocfs2_trace.h
@@ -40,6 +40,23 @@ DEFINE_EVENT(ocfs2__uint, name, \
40 TP_PROTO(unsigned int num), \ 40 TP_PROTO(unsigned int num), \
41 TP_ARGS(num)) 41 TP_ARGS(num))
42 42
43DECLARE_EVENT_CLASS(ocfs2__ull,
44 TP_PROTO(unsigned long long blkno),
45 TP_ARGS(blkno),
46 TP_STRUCT__entry(
47 __field(unsigned long long, blkno)
48 ),
49 TP_fast_assign(
50 __entry->blkno = blkno;
51 ),
52 TP_printk("%llu", __entry->blkno)
53);
54
55#define DEFINE_OCFS2_ULL_EVENT(name) \
56DEFINE_EVENT(ocfs2__ull, name, \
57 TP_PROTO(unsigned long long num), \
58 TP_ARGS(num))
59
43DECLARE_EVENT_CLASS(ocfs2__int_int, 60DECLARE_EVENT_CLASS(ocfs2__int_int,
44 TP_PROTO(int value1, int value2), 61 TP_PROTO(int value1, int value2),
45 TP_ARGS(value1, value2), 62 TP_ARGS(value1, value2),
@@ -59,6 +76,25 @@ DEFINE_EVENT(ocfs2__int_int, name, \
59 TP_PROTO(int val1, int val2), \ 76 TP_PROTO(int val1, int val2), \
60 TP_ARGS(val1, val2)) 77 TP_ARGS(val1, val2))
61 78
79DECLARE_EVENT_CLASS(ocfs2__uint_uint,
80 TP_PROTO(unsigned int value1, unsigned int value2),
81 TP_ARGS(value1, value2),
82 TP_STRUCT__entry(
83 __field(unsigned int, value1)
84 __field(unsigned int, value2)
85 ),
86 TP_fast_assign(
87 __entry->value1 = value1;
88 __entry->value2 = value2;
89 ),
90 TP_printk("%u %u", __entry->value1, __entry->value2)
91);
92
93#define DEFINE_OCFS2_UINT_UINT_EVENT(name) \
94DEFINE_EVENT(ocfs2__uint_uint, name, \
95 TP_PROTO(unsigned int val1, unsigned int val2), \
96 TP_ARGS(val1, val2))
97
62DECLARE_EVENT_CLASS(ocfs2__ull_uint, 98DECLARE_EVENT_CLASS(ocfs2__ull_uint,
63 TP_PROTO(unsigned long long value1, unsigned int value2), 99 TP_PROTO(unsigned long long value1, unsigned int value2),
64 TP_ARGS(value1, value2), 100 TP_ARGS(value1, value2),
@@ -78,6 +114,49 @@ DEFINE_EVENT(ocfs2__ull_uint, name, \
78 TP_PROTO(unsigned long long val1, unsigned int val2), \ 114 TP_PROTO(unsigned long long val1, unsigned int val2), \
79 TP_ARGS(val1, val2)) 115 TP_ARGS(val1, val2))
80 116
117DECLARE_EVENT_CLASS(ocfs2__ull_ull,
118 TP_PROTO(unsigned long long value1, unsigned long long value2),
119 TP_ARGS(value1, value2),
120 TP_STRUCT__entry(
121 __field(unsigned long long, value1)
122 __field(unsigned long long, value2)
123 ),
124 TP_fast_assign(
125 __entry->value1 = value1;
126 __entry->value2 = value2;
127 ),
128 TP_printk("%llu %llu", __entry->value1, __entry->value2)
129);
130
131#define DEFINE_OCFS2_ULL_ULL_EVENT(name) \
132DEFINE_EVENT(ocfs2__ull_ull, name, \
133 TP_PROTO(unsigned long long val1, unsigned long long val2), \
134 TP_ARGS(val1, val2))
135
136DECLARE_EVENT_CLASS(ocfs2__ull_uint_uint,
137 TP_PROTO(unsigned long long value1,
138 unsigned int value2, unsigned int value3),
139 TP_ARGS(value1, value2, value3),
140 TP_STRUCT__entry(
141 __field(unsigned long long, value1)
142 __field(unsigned int, value2)
143 __field(unsigned int, value3)
144 ),
145 TP_fast_assign(
146 __entry->value1 = value1;
147 __entry->value2 = value2;
148 __entry->value3 = value3;
149 ),
150 TP_printk("%llu %u %u", __entry->value1,
151 __entry->value2, __entry->value3)
152);
153
154#define DEFINE_OCFS2_ULL_UINT_UINT_EVENT(name) \
155DEFINE_EVENT(ocfs2__ull_uint_uint, name, \
156 TP_PROTO(unsigned long long val1, \
157 unsigned int val2, unsigned int val3), \
158 TP_ARGS(val1, val2, val3))
159
81DECLARE_EVENT_CLASS(ocfs2__uint_uint_uint, 160DECLARE_EVENT_CLASS(ocfs2__uint_uint_uint,
82 TP_PROTO(unsigned int value1, unsigned int value2, 161 TP_PROTO(unsigned int value1, unsigned int value2,
83 unsigned int value3), 162 unsigned int value3),
@@ -127,6 +206,33 @@ DEFINE_EVENT(ocfs2__ull_int_int_int, name, \
127 int value2, int value3), \ 206 int value2, int value3), \
128 TP_ARGS(ull, value1, value2, value3)) 207 TP_ARGS(ull, value1, value2, value3))
129 208
209DECLARE_EVENT_CLASS(ocfs2__ull_uint_uint_uint,
210 TP_PROTO(unsigned long long ull, unsigned int value1,
211 unsigned int value2, unsigned int value3),
212 TP_ARGS(ull, value1, value2, value3),
213 TP_STRUCT__entry(
214 __field(unsigned long long, ull)
215 __field(unsigned int, value1)
216 __field(unsigned int, value2)
217 __field(unsigned int, value3)
218 ),
219 TP_fast_assign(
220 __entry->ull = ull;
221 __entry->value1 = value1;
222 __entry->value2 = value2;
223 __entry->value3 = value3;
224 ),
225 TP_printk("%llu %u %u %u",
226 __entry->ull, __entry->value1,
227 __entry->value2, __entry->value3)
228);
229
230#define DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(name) \
231DEFINE_EVENT(ocfs2__ull_uint_uint_uint, name, \
232 TP_PROTO(unsigned long long ull, unsigned int value1, \
233 unsigned int value2, unsigned int value3), \
234 TP_ARGS(ull, value1, value2, value3))
235
130/* Trace events for fs/ocfs2/alloc.c. */ 236/* Trace events for fs/ocfs2/alloc.c. */
131DECLARE_EVENT_CLASS(ocfs2__btree_ops, 237DECLARE_EVENT_CLASS(ocfs2__btree_ops,
132 TP_PROTO(unsigned long long owner,\ 238 TP_PROTO(unsigned long long owner,\
@@ -483,6 +589,112 @@ DEFINE_OCFS2_INT_INT_EVENT(ocfs2_local_alloc_new_window);
483DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_local_alloc_new_window_result); 589DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_local_alloc_new_window_result);
484 590
485/* End of trace events for fs/ocfs2/localalloc.c. */ 591/* End of trace events for fs/ocfs2/localalloc.c. */
592
593/* Trace events for fs/ocfs2/suballoc.c. */
594
595DEFINE_OCFS2_ULL_EVENT(ocfs2_validate_group_descriptor);
596
597DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_block_group_alloc_contig);
598
599DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_block_group_alloc_discontig);
600
601DEFINE_OCFS2_ULL_EVENT(ocfs2_block_group_alloc);
602
603DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_reserve_suballoc_bits_nospc);
604
605DEFINE_OCFS2_UINT_UINT_UINT_EVENT(ocfs2_reserve_suballoc_bits_no_new_group);
606
607DEFINE_OCFS2_ULL_EVENT(ocfs2_reserve_new_inode_new_group);
608
609DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_block_group_set_bits);
610
611TRACE_EVENT(ocfs2_relink_block_group,
612 TP_PROTO(unsigned long long i_blkno, unsigned int chain,
613 unsigned long long bg_blkno,
614 unsigned long long prev_blkno),
615 TP_ARGS(i_blkno, chain, bg_blkno, prev_blkno),
616 TP_STRUCT__entry(
617 __field(unsigned long long, i_blkno)
618 __field(unsigned int, chain)
619 __field(unsigned long long, bg_blkno)
620 __field(unsigned long long, prev_blkno)
621 ),
622 TP_fast_assign(
623 __entry->i_blkno = i_blkno;
624 __entry->chain = chain;
625 __entry->bg_blkno = bg_blkno;
626 __entry->prev_blkno = prev_blkno;
627 ),
628 TP_printk("%llu %u %llu %llu",
629 __entry->i_blkno, __entry->chain, __entry->bg_blkno,
630 __entry->prev_blkno)
631);
632
633DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_cluster_group_search_wrong_max_bits);
634
635DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_cluster_group_search_max_block);
636
637DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_block_group_search_max_block);
638
639DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_search_chain_begin);
640
641DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_search_chain_succ);
642
643DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_search_chain_end);
644
645DEFINE_OCFS2_UINT_EVENT(ocfs2_claim_suballoc_bits);
646
647DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_claim_new_inode_at_loc);
648
649DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_block_group_clear_bits);
650
651TRACE_EVENT(ocfs2_free_suballoc_bits,
652 TP_PROTO(unsigned long long inode, unsigned long long group,
653 unsigned int start_bit, unsigned int count),
654 TP_ARGS(inode, group, start_bit, count),
655 TP_STRUCT__entry(
656 __field(unsigned long long, inode)
657 __field(unsigned long long, group)
658 __field(unsigned int, start_bit)
659 __field(unsigned int, count)
660 ),
661 TP_fast_assign(
662 __entry->inode = inode;
663 __entry->group = group;
664 __entry->start_bit = start_bit;
665 __entry->count = count;
666 ),
667 TP_printk("%llu %llu %u %u", __entry->inode, __entry->group,
668 __entry->start_bit, __entry->count)
669);
670
671TRACE_EVENT(ocfs2_free_clusters,
672 TP_PROTO(unsigned long long bg_blkno, unsigned long long start_blk,
673 unsigned int start_bit, unsigned int count),
674 TP_ARGS(bg_blkno, start_blk, start_bit, count),
675 TP_STRUCT__entry(
676 __field(unsigned long long, bg_blkno)
677 __field(unsigned long long, start_blk)
678 __field(unsigned int, start_bit)
679 __field(unsigned int, count)
680 ),
681 TP_fast_assign(
682 __entry->bg_blkno = bg_blkno;
683 __entry->start_blk = start_blk;
684 __entry->start_bit = start_bit;
685 __entry->count = count;
686 ),
687 TP_printk("%llu %llu %u %u", __entry->bg_blkno, __entry->start_blk,
688 __entry->start_bit, __entry->count)
689);
690
691DEFINE_OCFS2_ULL_EVENT(ocfs2_get_suballoc_slot_bit);
692
693DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_test_suballoc_bit);
694
695DEFINE_OCFS2_ULL_EVENT(ocfs2_test_inode_bit);
696
697/* End of trace events for fs/ocfs2/suballoc.c. */
486#endif /* _TRACE_OCFS2_H */ 698#endif /* _TRACE_OCFS2_H */
487 699
488/* This part must be outside protection */ 700/* This part must be outside protection */
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index 2d722f1fbaa0..94342bd9800d 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -44,6 +44,7 @@
44#include "super.h" 44#include "super.h"
45#include "sysfile.h" 45#include "sysfile.h"
46#include "uptodate.h" 46#include "uptodate.h"
47#include "ocfs2_trace.h"
47 48
48#include "buffer_head_io.h" 49#include "buffer_head_io.h"
49 50
@@ -308,8 +309,8 @@ static int ocfs2_validate_group_descriptor(struct super_block *sb,
308 int rc; 309 int rc;
309 struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data; 310 struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;
310 311
311 mlog(0, "Validating group descriptor %llu\n", 312 trace_ocfs2_validate_group_descriptor(
312 (unsigned long long)bh->b_blocknr); 313 (unsigned long long)bh->b_blocknr);
313 314
314 BUG_ON(!buffer_uptodate(bh)); 315 BUG_ON(!buffer_uptodate(bh));
315 316
@@ -476,8 +477,8 @@ ocfs2_block_group_alloc_contig(struct ocfs2_super *osb, handle_t *handle,
476 477
477 /* setup the group */ 478 /* setup the group */
478 bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off); 479 bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off);
479 mlog(0, "new descriptor, record %u, at block %llu\n", 480 trace_ocfs2_block_group_alloc_contig(
480 alloc_rec, (unsigned long long)bg_blkno); 481 (unsigned long long)bg_blkno, alloc_rec);
481 482
482 bg_bh = sb_getblk(osb->sb, bg_blkno); 483 bg_bh = sb_getblk(osb->sb, bg_blkno);
483 if (!bg_bh) { 484 if (!bg_bh) {
@@ -656,8 +657,8 @@ ocfs2_block_group_alloc_discontig(handle_t *handle,
656 657
657 /* setup the group */ 658 /* setup the group */
658 bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off); 659 bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off);
659 mlog(0, "new descriptor, record %u, at block %llu\n", 660 trace_ocfs2_block_group_alloc_discontig(
660 alloc_rec, (unsigned long long)bg_blkno); 661 (unsigned long long)bg_blkno, alloc_rec);
661 662
662 bg_bh = sb_getblk(osb->sb, bg_blkno); 663 bg_bh = sb_getblk(osb->sb, bg_blkno);
663 if (!bg_bh) { 664 if (!bg_bh) {
@@ -727,8 +728,8 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb,
727 } 728 }
728 729
729 if (last_alloc_group && *last_alloc_group != 0) { 730 if (last_alloc_group && *last_alloc_group != 0) {
730 mlog(0, "use old allocation group %llu for block group alloc\n", 731 trace_ocfs2_block_group_alloc(
731 (unsigned long long)*last_alloc_group); 732 (unsigned long long)*last_alloc_group);
732 ac->ac_last_group = *last_alloc_group; 733 ac->ac_last_group = *last_alloc_group;
733 } 734 }
734 735
@@ -851,16 +852,15 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb,
851 if (bits_wanted > free_bits) { 852 if (bits_wanted > free_bits) {
852 /* cluster bitmap never grows */ 853 /* cluster bitmap never grows */
853 if (ocfs2_is_cluster_bitmap(alloc_inode)) { 854 if (ocfs2_is_cluster_bitmap(alloc_inode)) {
854 mlog(0, "Disk Full: wanted=%u, free_bits=%u\n", 855 trace_ocfs2_reserve_suballoc_bits_nospc(bits_wanted,
855 bits_wanted, free_bits); 856 free_bits);
856 status = -ENOSPC; 857 status = -ENOSPC;
857 goto bail; 858 goto bail;
858 } 859 }
859 860
860 if (!(flags & ALLOC_NEW_GROUP)) { 861 if (!(flags & ALLOC_NEW_GROUP)) {
861 mlog(0, "Alloc File %u Full: wanted=%u, free_bits=%u, " 862 trace_ocfs2_reserve_suballoc_bits_no_new_group(
862 "and we don't alloc a new group for it.\n", 863 slot, bits_wanted, free_bits);
863 slot, bits_wanted, free_bits);
864 status = -ENOSPC; 864 status = -ENOSPC;
865 goto bail; 865 goto bail;
866 } 866 }
@@ -1117,8 +1117,8 @@ int ocfs2_reserve_new_inode(struct ocfs2_super *osb,
1117 spin_lock(&osb->osb_lock); 1117 spin_lock(&osb->osb_lock);
1118 osb->osb_inode_alloc_group = alloc_group; 1118 osb->osb_inode_alloc_group = alloc_group;
1119 spin_unlock(&osb->osb_lock); 1119 spin_unlock(&osb->osb_lock);
1120 mlog(0, "after reservation, new allocation group is " 1120 trace_ocfs2_reserve_new_inode_new_group(
1121 "%llu\n", (unsigned long long)alloc_group); 1121 (unsigned long long)alloc_group);
1122 1122
1123 /* 1123 /*
1124 * Some inodes must be freed by us, so try to allocate 1124 * Some inodes must be freed by us, so try to allocate
@@ -1360,8 +1360,7 @@ static inline int ocfs2_block_group_set_bits(handle_t *handle,
1360 BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg)); 1360 BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg));
1361 BUG_ON(le16_to_cpu(bg->bg_free_bits_count) < num_bits); 1361 BUG_ON(le16_to_cpu(bg->bg_free_bits_count) < num_bits);
1362 1362
1363 mlog(0, "block_group_set_bits: off = %u, num = %u\n", bit_off, 1363 trace_ocfs2_block_group_set_bits(bit_off, num_bits);
1364 num_bits);
1365 1364
1366 if (ocfs2_is_cluster_bitmap(alloc_inode)) 1365 if (ocfs2_is_cluster_bitmap(alloc_inode))
1367 journal_type = OCFS2_JOURNAL_ACCESS_UNDO; 1366 journal_type = OCFS2_JOURNAL_ACCESS_UNDO;
@@ -1434,10 +1433,10 @@ static int ocfs2_relink_block_group(handle_t *handle,
1434 BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg)); 1433 BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg));
1435 BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(prev_bg)); 1434 BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(prev_bg));
1436 1435
1437 mlog(0, "Suballoc %llu, chain %u, move group %llu to top, prev = %llu\n", 1436 trace_ocfs2_relink_block_group(
1438 (unsigned long long)le64_to_cpu(fe->i_blkno), chain, 1437 (unsigned long long)le64_to_cpu(fe->i_blkno), chain,
1439 (unsigned long long)le64_to_cpu(bg->bg_blkno), 1438 (unsigned long long)le64_to_cpu(bg->bg_blkno),
1440 (unsigned long long)le64_to_cpu(prev_bg->bg_blkno)); 1439 (unsigned long long)le64_to_cpu(prev_bg->bg_blkno));
1441 1440
1442 fe_ptr = le64_to_cpu(fe->id2.i_chain.cl_recs[chain].c_blkno); 1441 fe_ptr = le64_to_cpu(fe->id2.i_chain.cl_recs[chain].c_blkno);
1443 bg_ptr = le64_to_cpu(bg->bg_next_group); 1442 bg_ptr = le64_to_cpu(bg->bg_next_group);
@@ -1523,10 +1522,10 @@ static int ocfs2_cluster_group_search(struct inode *inode,
1523 if ((gd_cluster_off + max_bits) > 1522 if ((gd_cluster_off + max_bits) >
1524 OCFS2_I(inode)->ip_clusters) { 1523 OCFS2_I(inode)->ip_clusters) {
1525 max_bits = OCFS2_I(inode)->ip_clusters - gd_cluster_off; 1524 max_bits = OCFS2_I(inode)->ip_clusters - gd_cluster_off;
1526 mlog(0, "Desc %llu, bg_bits %u, clusters %u, use %u\n", 1525 trace_ocfs2_cluster_group_search_wrong_max_bits(
1527 (unsigned long long)le64_to_cpu(gd->bg_blkno), 1526 (unsigned long long)le64_to_cpu(gd->bg_blkno),
1528 le16_to_cpu(gd->bg_bits), 1527 le16_to_cpu(gd->bg_bits),
1529 OCFS2_I(inode)->ip_clusters, max_bits); 1528 OCFS2_I(inode)->ip_clusters, max_bits);
1530 } 1529 }
1531 1530
1532 ret = ocfs2_block_group_find_clear_bits(OCFS2_SB(inode->i_sb), 1531 ret = ocfs2_block_group_find_clear_bits(OCFS2_SB(inode->i_sb),
@@ -1540,9 +1539,9 @@ static int ocfs2_cluster_group_search(struct inode *inode,
1540 gd_cluster_off + 1539 gd_cluster_off +
1541 res->sr_bit_offset + 1540 res->sr_bit_offset +
1542 res->sr_bits); 1541 res->sr_bits);
1543 mlog(0, "Checking %llu against %llu\n", 1542 trace_ocfs2_cluster_group_search_max_block(
1544 (unsigned long long)blkoff, 1543 (unsigned long long)blkoff,
1545 (unsigned long long)max_block); 1544 (unsigned long long)max_block);
1546 if (blkoff > max_block) 1545 if (blkoff > max_block)
1547 return -ENOSPC; 1546 return -ENOSPC;
1548 } 1547 }
@@ -1586,9 +1585,9 @@ static int ocfs2_block_group_search(struct inode *inode,
1586 if (!ret && max_block) { 1585 if (!ret && max_block) {
1587 blkoff = le64_to_cpu(bg->bg_blkno) + 1586 blkoff = le64_to_cpu(bg->bg_blkno) +
1588 res->sr_bit_offset + res->sr_bits; 1587 res->sr_bit_offset + res->sr_bits;
1589 mlog(0, "Checking %llu against %llu\n", 1588 trace_ocfs2_block_group_search_max_block(
1590 (unsigned long long)blkoff, 1589 (unsigned long long)blkoff,
1591 (unsigned long long)max_block); 1590 (unsigned long long)max_block);
1592 if (blkoff > max_block) 1591 if (blkoff > max_block)
1593 ret = -ENOSPC; 1592 ret = -ENOSPC;
1594 } 1593 }
@@ -1754,9 +1753,9 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
1754 struct ocfs2_group_desc *bg; 1753 struct ocfs2_group_desc *bg;
1755 1754
1756 chain = ac->ac_chain; 1755 chain = ac->ac_chain;
1757 mlog(0, "trying to alloc %u bits from chain %u, inode %llu\n", 1756 trace_ocfs2_search_chain_begin(
1758 bits_wanted, chain, 1757 (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno,
1759 (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno); 1758 bits_wanted, chain);
1760 1759
1761 status = ocfs2_read_group_descriptor(alloc_inode, fe, 1760 status = ocfs2_read_group_descriptor(alloc_inode, fe,
1762 le64_to_cpu(cl->cl_recs[chain].c_blkno), 1761 le64_to_cpu(cl->cl_recs[chain].c_blkno),
@@ -1797,8 +1796,8 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
1797 goto bail; 1796 goto bail;
1798 } 1797 }
1799 1798
1800 mlog(0, "alloc succeeds: we give %u bits from block group %llu\n", 1799 trace_ocfs2_search_chain_succ(
1801 res->sr_bits, (unsigned long long)le64_to_cpu(bg->bg_blkno)); 1800 (unsigned long long)le64_to_cpu(bg->bg_blkno), res->sr_bits);
1802 1801
1803 res->sr_bg_blkno = le64_to_cpu(bg->bg_blkno); 1802 res->sr_bg_blkno = le64_to_cpu(bg->bg_blkno);
1804 1803
@@ -1859,8 +1858,9 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
1859 goto bail; 1858 goto bail;
1860 } 1859 }
1861 1860
1862 mlog(0, "Allocated %u bits from suballocator %llu\n", res->sr_bits, 1861 trace_ocfs2_search_chain_end(
1863 (unsigned long long)le64_to_cpu(fe->i_blkno)); 1862 (unsigned long long)le64_to_cpu(fe->i_blkno),
1863 res->sr_bits);
1864 1864
1865out_loc_only: 1865out_loc_only:
1866 *bits_left = le16_to_cpu(bg->bg_free_bits_count); 1866 *bits_left = le16_to_cpu(bg->bg_free_bits_count);
@@ -1942,8 +1942,7 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *ac,
1942 goto bail; 1942 goto bail;
1943 } 1943 }
1944 1944
1945 mlog(0, "Search of victim chain %u came up with nothing, " 1945 trace_ocfs2_claim_suballoc_bits(victim);
1946 "trying all chains now.\n", victim);
1947 1946
1948 /* If we didn't pick a good victim, then just default to 1947 /* If we didn't pick a good victim, then just default to
1949 * searching each chain in order. Don't allow chain relinking 1948 * searching each chain in order. Don't allow chain relinking
@@ -2171,8 +2170,8 @@ int ocfs2_claim_new_inode_at_loc(handle_t *handle,
2171 goto out; 2170 goto out;
2172 } 2171 }
2173 2172
2174 mlog(0, "Allocated %u bits from suballocator %llu\n", res->sr_bits, 2173 trace_ocfs2_claim_new_inode_at_loc((unsigned long long)di_blkno,
2175 (unsigned long long)di_blkno); 2174 res->sr_bits);
2176 2175
2177 atomic_inc(&OCFS2_SB(ac->ac_inode->i_sb)->alloc_stats.bg_allocs); 2176 atomic_inc(&OCFS2_SB(ac->ac_inode->i_sb)->alloc_stats.bg_allocs);
2178 2177
@@ -2393,7 +2392,7 @@ static int ocfs2_block_group_clear_bits(handle_t *handle,
2393 * ocfs2_read_group_descriptor(). Any corruption is a code bug. */ 2392 * ocfs2_read_group_descriptor(). Any corruption is a code bug. */
2394 BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg)); 2393 BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg));
2395 2394
2396 mlog(0, "off = %u, num = %u\n", bit_off, num_bits); 2395 trace_ocfs2_block_group_clear_bits(bit_off, num_bits);
2397 2396
2398 BUG_ON(undo_fn && !ocfs2_is_cluster_bitmap(alloc_inode)); 2397 BUG_ON(undo_fn && !ocfs2_is_cluster_bitmap(alloc_inode));
2399 status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode), 2398 status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode),
@@ -2466,9 +2465,10 @@ static int _ocfs2_free_suballoc_bits(handle_t *handle,
2466 BUG_ON(!OCFS2_IS_VALID_DINODE(fe)); 2465 BUG_ON(!OCFS2_IS_VALID_DINODE(fe));
2467 BUG_ON((count + start_bit) > ocfs2_bits_per_group(cl)); 2466 BUG_ON((count + start_bit) > ocfs2_bits_per_group(cl));
2468 2467
2469 mlog(0, "%llu: freeing %u bits from group %llu, starting at %u\n", 2468 trace_ocfs2_free_suballoc_bits(
2470 (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno, count, 2469 (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno,
2471 (unsigned long long)bg_blkno, start_bit); 2470 (unsigned long long)bg_blkno,
2471 start_bit, count);
2472 2472
2473 status = ocfs2_read_group_descriptor(alloc_inode, fe, bg_blkno, 2473 status = ocfs2_read_group_descriptor(alloc_inode, fe, bg_blkno,
2474 &group_bh); 2474 &group_bh);
@@ -2560,10 +2560,9 @@ static int _ocfs2_free_clusters(handle_t *handle,
2560 ocfs2_block_to_cluster_group(bitmap_inode, start_blk, &bg_blkno, 2560 ocfs2_block_to_cluster_group(bitmap_inode, start_blk, &bg_blkno,
2561 &bg_start_bit); 2561 &bg_start_bit);
2562 2562
2563 mlog(0, "want to free %u clusters starting at block %llu\n", 2563 trace_ocfs2_free_clusters((unsigned long long)bg_blkno,
2564 num_clusters, (unsigned long long)start_blk); 2564 (unsigned long long)start_blk,
2565 mlog(0, "bg_blkno = %llu, bg_start_bit = %u\n", 2565 bg_start_bit, num_clusters);
2566 (unsigned long long)bg_blkno, bg_start_bit);
2567 2566
2568 status = _ocfs2_free_suballoc_bits(handle, bitmap_inode, bitmap_bh, 2567 status = _ocfs2_free_suballoc_bits(handle, bitmap_inode, bitmap_bh,
2569 bg_start_bit, bg_blkno, 2568 bg_start_bit, bg_blkno,
@@ -2748,7 +2747,7 @@ static int ocfs2_get_suballoc_slot_bit(struct ocfs2_super *osb, u64 blkno,
2748 struct buffer_head *inode_bh = NULL; 2747 struct buffer_head *inode_bh = NULL;
2749 struct ocfs2_dinode *inode_fe; 2748 struct ocfs2_dinode *inode_fe;
2750 2749
2751 mlog(0, "blkno: %llu\n", (unsigned long long)blkno); 2750 trace_ocfs2_get_suballoc_slot_bit((unsigned long long)blkno);
2752 2751
2753 /* dirty read disk */ 2752 /* dirty read disk */
2754 status = ocfs2_read_blocks_sync(osb, blkno, 1, &inode_bh); 2753 status = ocfs2_read_blocks_sync(osb, blkno, 1, &inode_bh);
@@ -2809,8 +2808,8 @@ static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb,
2809 u64 bg_blkno; 2808 u64 bg_blkno;
2810 int status; 2809 int status;
2811 2810
2812 mlog(0, "blkno: %llu bit: %u\n", (unsigned long long)blkno, 2811 trace_ocfs2_test_suballoc_bit((unsigned long long)blkno,
2813 (unsigned int)bit); 2812 (unsigned int)bit);
2814 2813
2815 alloc_di = (struct ocfs2_dinode *)alloc_bh->b_data; 2814 alloc_di = (struct ocfs2_dinode *)alloc_bh->b_data;
2816 if ((bit + 1) > ocfs2_bits_per_group(&alloc_di->id2.i_chain)) { 2815 if ((bit + 1) > ocfs2_bits_per_group(&alloc_di->id2.i_chain)) {
@@ -2863,7 +2862,7 @@ int ocfs2_test_inode_bit(struct ocfs2_super *osb, u64 blkno, int *res)
2863 struct inode *inode_alloc_inode; 2862 struct inode *inode_alloc_inode;
2864 struct buffer_head *alloc_bh = NULL; 2863 struct buffer_head *alloc_bh = NULL;
2865 2864
2866 mlog(0, "blkno: %llu", (unsigned long long)blkno); 2865 trace_ocfs2_test_inode_bit((unsigned long long)blkno);
2867 2866
2868 status = ocfs2_get_suballoc_slot_bit(osb, blkno, &suballoc_slot, 2867 status = ocfs2_get_suballoc_slot_bit(osb, blkno, &suballoc_slot,
2869 &group_blkno, &suballoc_bit); 2868 &group_blkno, &suballoc_bit);