Skip to content

Commit 198aac2

Browse files
committed
ocfs2: Remove masklog ML_REFCOUNT.
Change all the "mlog(0," in fs/ocfs2/refcounttree.c to trace events. And finally remove masklog ML_REFCOUNT. Signed-off-by: Tao Ma <boyu.mt@taobao.com>
1 parent 81bad69 commit 198aac2

4 files changed

Lines changed: 341 additions & 82 deletions

File tree

‎fs/ocfs2/cluster/masklog.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
108108
define_mask(EXPORT),
109109
define_mask(XATTR),
110110
define_mask(QUOTA),
111-
define_mask(REFCOUNT),
112111
define_mask(BASTS),
113112
define_mask(RESERVATIONS),
114113
define_mask(CLUSTER),

‎fs/ocfs2/cluster/masklog.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
#define ML_EXPORT 0x0000000010000000ULL /* ocfs2 export operations */
111111
#define ML_XATTR 0x0000000020000000ULL /* ocfs2 extended attributes */
112112
#define ML_QUOTA 0x0000000040000000ULL /* ocfs2 quota operations */
113-
#define ML_REFCOUNT 0x0000000080000000ULL /* refcount tree operations */
114113
#define ML_BASTS 0x0000000100000000ULL /* dlmglue asts and basts */
115114
#define ML_RESERVATIONS 0x0000000200000000ULL /* ocfs2 alloc reservations */
116115
#define ML_CLUSTER 0x0000000400000000ULL /* cluster stack */

‎fs/ocfs2/ocfs2_trace.h‎

Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,30 @@ DEFINE_EVENT(ocfs2__ull_ull, name, \
133133
TP_PROTO(unsigned long long val1, unsigned long long val2), \
134134
TP_ARGS(val1, val2))
135135

136+
DECLARE_EVENT_CLASS(ocfs2__ull_ull_uint,
137+
TP_PROTO(unsigned long long value1,
138+
unsigned long long value2, unsigned int value3),
139+
TP_ARGS(value1, value2, value3),
140+
TP_STRUCT__entry(
141+
__field(unsigned long long, value1)
142+
__field(unsigned long long, 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 %llu %u",
151+
__entry->value1, __entry->value2, __entry->value3)
152+
);
153+
154+
#define DEFINE_OCFS2_ULL_ULL_UINT_EVENT(name) \
155+
DEFINE_EVENT(ocfs2__ull_ull_uint, name, \
156+
TP_PROTO(unsigned long long val1, \
157+
unsigned long long val2, unsigned int val3), \
158+
TP_ARGS(val1, val2, val3))
159+
136160
DECLARE_EVENT_CLASS(ocfs2__ull_uint_uint,
137161
TP_PROTO(unsigned long long value1,
138162
unsigned int value2, unsigned int value3),
@@ -705,6 +729,245 @@ DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_test_suballoc_bit);
705729
DEFINE_OCFS2_ULL_EVENT(ocfs2_test_inode_bit);
706730

707731
/* End of trace events for fs/ocfs2/suballoc.c. */
732+
733+
/* Trace events for fs/ocfs2/refcounttree.c. */
734+
735+
DEFINE_OCFS2_ULL_EVENT(ocfs2_validate_refcount_block);
736+
737+
DEFINE_OCFS2_ULL_EVENT(ocfs2_purge_refcount_trees);
738+
739+
DEFINE_OCFS2_ULL_EVENT(ocfs2_create_refcount_tree);
740+
741+
DEFINE_OCFS2_ULL_EVENT(ocfs2_create_refcount_tree_blkno);
742+
743+
DEFINE_OCFS2_ULL_INT_INT_INT_EVENT(ocfs2_change_refcount_rec);
744+
745+
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_expand_inline_ref_root);
746+
747+
DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_divide_leaf_refcount_block);
748+
749+
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_new_leaf_refcount_block);
750+
751+
DECLARE_EVENT_CLASS(ocfs2__refcount_tree_ops,
752+
TP_PROTO(unsigned long long blkno, int index,
753+
unsigned long long cpos,
754+
unsigned int clusters, unsigned int refcount),
755+
TP_ARGS(blkno, index, cpos, clusters, refcount),
756+
TP_STRUCT__entry(
757+
__field(unsigned long long, blkno)
758+
__field(int, index)
759+
__field(unsigned long long, cpos)
760+
__field(unsigned int, clusters)
761+
__field(unsigned int, refcount)
762+
),
763+
TP_fast_assign(
764+
__entry->blkno = blkno;
765+
__entry->index = index;
766+
__entry->cpos = cpos;
767+
__entry->clusters = clusters;
768+
__entry->refcount = refcount;
769+
),
770+
TP_printk("%llu %d %llu %u %u", __entry->blkno, __entry->index,
771+
__entry->cpos, __entry->clusters, __entry->refcount)
772+
);
773+
774+
#define DEFINE_OCFS2_REFCOUNT_TREE_OPS_EVENT(name) \
775+
DEFINE_EVENT(ocfs2__refcount_tree_ops, name, \
776+
TP_PROTO(unsigned long long blkno, int index, \
777+
unsigned long long cpos, \
778+
unsigned int count, unsigned int refcount), \
779+
TP_ARGS(blkno, index, cpos, count, refcount))
780+
781+
DEFINE_OCFS2_REFCOUNT_TREE_OPS_EVENT(ocfs2_insert_refcount_rec);
782+
783+
TRACE_EVENT(ocfs2_split_refcount_rec,
784+
TP_PROTO(unsigned long long cpos,
785+
unsigned int clusters, unsigned int refcount,
786+
unsigned long long split_cpos,
787+
unsigned int split_clusters, unsigned int split_refcount),
788+
TP_ARGS(cpos, clusters, refcount,
789+
split_cpos, split_clusters, split_refcount),
790+
TP_STRUCT__entry(
791+
__field(unsigned long long, cpos)
792+
__field(unsigned int, clusters)
793+
__field(unsigned int, refcount)
794+
__field(unsigned long long, split_cpos)
795+
__field(unsigned int, split_clusters)
796+
__field(unsigned int, split_refcount)
797+
),
798+
TP_fast_assign(
799+
__entry->cpos = cpos;
800+
__entry->clusters = clusters;
801+
__entry->refcount = refcount;
802+
__entry->split_cpos = split_cpos;
803+
__entry->split_clusters = split_clusters;
804+
__entry->split_refcount = split_refcount;
805+
),
806+
TP_printk("%llu %u %u %llu %u %u",
807+
__entry->cpos, __entry->clusters, __entry->refcount,
808+
__entry->split_cpos, __entry->split_clusters,
809+
__entry->split_refcount)
810+
);
811+
812+
DEFINE_OCFS2_REFCOUNT_TREE_OPS_EVENT(ocfs2_split_refcount_rec_insert);
813+
814+
DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_increase_refcount_begin);
815+
816+
DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_increase_refcount_change);
817+
818+
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_increase_refcount_insert);
819+
820+
DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_increase_refcount_split);
821+
822+
DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_remove_refcount_extent);
823+
824+
DEFINE_OCFS2_ULL_EVENT(ocfs2_restore_refcount_block);
825+
826+
DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_decrease_refcount_rec);
827+
828+
TRACE_EVENT(ocfs2_decrease_refcount,
829+
TP_PROTO(unsigned long long owner,
830+
unsigned long long cpos,
831+
unsigned int len, int delete),
832+
TP_ARGS(owner, cpos, len, delete),
833+
TP_STRUCT__entry(
834+
__field(unsigned long long, owner)
835+
__field(unsigned long long, cpos)
836+
__field(unsigned int, len)
837+
__field(int, delete)
838+
),
839+
TP_fast_assign(
840+
__entry->owner = owner;
841+
__entry->cpos = cpos;
842+
__entry->len = len;
843+
__entry->delete = delete;
844+
),
845+
TP_printk("%llu %llu %u %d",
846+
__entry->owner, __entry->cpos, __entry->len, __entry->delete)
847+
);
848+
849+
DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_mark_extent_refcounted);
850+
851+
DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_calc_refcount_meta_credits);
852+
853+
TRACE_EVENT(ocfs2_calc_refcount_meta_credits_iterate,
854+
TP_PROTO(int recs_add, unsigned long long cpos,
855+
unsigned int clusters, unsigned long long r_cpos,
856+
unsigned int r_clusters, unsigned int refcount, int index),
857+
TP_ARGS(recs_add, cpos, clusters, r_cpos, r_clusters, refcount, index),
858+
TP_STRUCT__entry(
859+
__field(int, recs_add)
860+
__field(unsigned long long, cpos)
861+
__field(unsigned int, clusters)
862+
__field(unsigned long long, r_cpos)
863+
__field(unsigned int, r_clusters)
864+
__field(unsigned int, refcount)
865+
__field(int, index)
866+
),
867+
TP_fast_assign(
868+
__entry->recs_add = recs_add;
869+
__entry->cpos = cpos;
870+
__entry->clusters = clusters;
871+
__entry->r_cpos = r_cpos;
872+
__entry->r_clusters = r_clusters;
873+
__entry->refcount = refcount;
874+
__entry->index = index;
875+
),
876+
TP_printk("%d %llu %u %llu %u %u %d",
877+
__entry->recs_add, __entry->cpos, __entry->clusters,
878+
__entry->r_cpos, __entry->r_clusters,
879+
__entry->refcount, __entry->index)
880+
);
881+
882+
DEFINE_OCFS2_INT_INT_EVENT(ocfs2_add_refcount_flag);
883+
884+
DEFINE_OCFS2_INT_INT_EVENT(ocfs2_prepare_refcount_change_for_del);
885+
886+
DEFINE_OCFS2_INT_INT_EVENT(ocfs2_lock_refcount_allocators);
887+
888+
DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_duplicate_clusters_by_page);
889+
890+
DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_duplicate_clusters_by_jbd);
891+
892+
TRACE_EVENT(ocfs2_clear_ext_refcount,
893+
TP_PROTO(unsigned long long ino, unsigned int cpos,
894+
unsigned int len, unsigned int p_cluster,
895+
unsigned int ext_flags),
896+
TP_ARGS(ino, cpos, len, p_cluster, ext_flags),
897+
TP_STRUCT__entry(
898+
__field(unsigned long long, ino)
899+
__field(unsigned int, cpos)
900+
__field(unsigned int, len)
901+
__field(unsigned int, p_cluster)
902+
__field(unsigned int, ext_flags)
903+
),
904+
TP_fast_assign(
905+
__entry->ino = ino;
906+
__entry->cpos = cpos;
907+
__entry->len = len;
908+
__entry->p_cluster = p_cluster;
909+
__entry->ext_flags = ext_flags;
910+
),
911+
TP_printk("%llu %u %u %u %u",
912+
__entry->ino, __entry->cpos, __entry->len,
913+
__entry->p_cluster, __entry->ext_flags)
914+
);
915+
916+
TRACE_EVENT(ocfs2_replace_clusters,
917+
TP_PROTO(unsigned long long ino, unsigned int cpos,
918+
unsigned int old, unsigned int new, unsigned int len,
919+
unsigned int ext_flags),
920+
TP_ARGS(ino, cpos, old, new, len, ext_flags),
921+
TP_STRUCT__entry(
922+
__field(unsigned long long, ino)
923+
__field(unsigned int, cpos)
924+
__field(unsigned int, old)
925+
__field(unsigned int, new)
926+
__field(unsigned int, len)
927+
__field(unsigned int, ext_flags)
928+
),
929+
TP_fast_assign(
930+
__entry->ino = ino;
931+
__entry->cpos = cpos;
932+
__entry->old = old;
933+
__entry->new = new;
934+
__entry->len = len;
935+
__entry->ext_flags = ext_flags;
936+
),
937+
TP_printk("%llu %u %u %u %u %u",
938+
__entry->ino, __entry->cpos, __entry->old, __entry->new,
939+
__entry->len, __entry->ext_flags)
940+
);
941+
942+
DEFINE_OCFS2_ULL_UINT_UINT_UINT_EVENT(ocfs2_make_clusters_writable);
943+
944+
TRACE_EVENT(ocfs2_refcount_cow_hunk,
945+
TP_PROTO(unsigned long long ino, unsigned int cpos,
946+
unsigned int write_len, unsigned int max_cpos,
947+
unsigned int cow_start, unsigned int cow_len),
948+
TP_ARGS(ino, cpos, write_len, max_cpos, cow_start, cow_len),
949+
TP_STRUCT__entry(
950+
__field(unsigned long long, ino)
951+
__field(unsigned int, cpos)
952+
__field(unsigned int, write_len)
953+
__field(unsigned int, max_cpos)
954+
__field(unsigned int, cow_start)
955+
__field(unsigned int, cow_len)
956+
),
957+
TP_fast_assign(
958+
__entry->ino = ino;
959+
__entry->cpos = cpos;
960+
__entry->write_len = write_len;
961+
__entry->max_cpos = max_cpos;
962+
__entry->cow_start = cow_start;
963+
__entry->cow_len = cow_len;
964+
),
965+
TP_printk("%llu %u %u %u %u %u",
966+
__entry->ino, __entry->cpos, __entry->write_len,
967+
__entry->max_cpos, __entry->cow_start, __entry->cow_len)
968+
);
969+
970+
/* End of trace events for fs/ocfs2/refcounttree.c. */
708971
#endif /* _TRACE_OCFS2_H */
709972

710973
/* This part must be outside protection */

0 commit comments

Comments
 (0)