aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/qgroup.c4
-rw-r--r--fs/btrfs/super.c1
-rw-r--r--include/trace/events/btrfs.h56
3 files changed, 61 insertions, 0 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 2ce4ce7b47d8..1e4c6e95ab55 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1335,6 +1335,8 @@ int btrfs_qgroup_record_ref(struct btrfs_trans_handle *trans,
1335 INIT_LIST_HEAD(&oper->elem.list); 1335 INIT_LIST_HEAD(&oper->elem.list);
1336 oper->elem.seq = 0; 1336 oper->elem.seq = 0;
1337 1337
1338 trace_btrfs_qgroup_record_ref(oper);
1339
1338 if (type == BTRFS_QGROUP_OPER_SUB_SUBTREE) { 1340 if (type == BTRFS_QGROUP_OPER_SUB_SUBTREE) {
1339 /* 1341 /*
1340 * If any operation for this bytenr/ref_root combo 1342 * If any operation for this bytenr/ref_root combo
@@ -2077,6 +2079,8 @@ static int btrfs_qgroup_account(struct btrfs_trans_handle *trans,
2077 2079
2078 ASSERT(is_fstree(oper->ref_root)); 2080 ASSERT(is_fstree(oper->ref_root));
2079 2081
2082 trace_btrfs_qgroup_account(oper);
2083
2080 switch (oper->type) { 2084 switch (oper->type) {
2081 case BTRFS_QGROUP_OPER_ADD_EXCL: 2085 case BTRFS_QGROUP_OPER_ADD_EXCL:
2082 case BTRFS_QGROUP_OPER_SUB_EXCL: 2086 case BTRFS_QGROUP_OPER_SUB_EXCL:
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index d66fbd57f1b5..3f1f4e2dc78f 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -60,6 +60,7 @@
60#include "backref.h" 60#include "backref.h"
61#include "tests/btrfs-tests.h" 61#include "tests/btrfs-tests.h"
62 62
63#include "qgroup.h"
63#define CREATE_TRACE_POINTS 64#define CREATE_TRACE_POINTS
64#include <trace/events/btrfs.h> 65#include <trace/events/btrfs.h>
65 66
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 4ee4e30d26d9..b8774b3f88d7 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -23,6 +23,7 @@ struct map_lookup;
23struct extent_buffer; 23struct extent_buffer;
24struct btrfs_work; 24struct btrfs_work;
25struct __btrfs_workqueue; 25struct __btrfs_workqueue;
26struct btrfs_qgroup_operation;
26 27
27#define show_ref_type(type) \ 28#define show_ref_type(type) \
28 __print_symbolic(type, \ 29 __print_symbolic(type, \
@@ -1119,6 +1120,61 @@ DEFINE_EVENT(btrfs__workqueue_done, btrfs_workqueue_destroy,
1119 TP_ARGS(wq) 1120 TP_ARGS(wq)
1120); 1121);
1121 1122
1123#define show_oper_type(type) \
1124 __print_symbolic(type, \
1125 { BTRFS_QGROUP_OPER_ADD_EXCL, "OPER_ADD_EXCL" }, \
1126 { BTRFS_QGROUP_OPER_ADD_SHARED, "OPER_ADD_SHARED" }, \
1127 { BTRFS_QGROUP_OPER_SUB_EXCL, "OPER_SUB_EXCL" }, \
1128 { BTRFS_QGROUP_OPER_SUB_SHARED, "OPER_SUB_SHARED" })
1129
1130DECLARE_EVENT_CLASS(btrfs_qgroup_oper,
1131
1132 TP_PROTO(struct btrfs_qgroup_operation *oper),
1133
1134 TP_ARGS(oper),
1135
1136 TP_STRUCT__entry(
1137 __field( u64, ref_root )
1138 __field( u64, bytenr )
1139 __field( u64, num_bytes )
1140 __field( u64, seq )
1141 __field( int, type )
1142 __field( u64, elem_seq )
1143 ),
1144
1145 TP_fast_assign(
1146 __entry->ref_root = oper->ref_root;
1147 __entry->bytenr = oper->bytenr,
1148 __entry->num_bytes = oper->num_bytes;
1149 __entry->seq = oper->seq;
1150 __entry->type = oper->type;
1151 __entry->elem_seq = oper->elem.seq;
1152 ),
1153
1154 TP_printk("ref_root = %llu, bytenr = %llu, num_bytes = %llu, "
1155 "seq = %llu, elem.seq = %llu, type = %s",
1156 (unsigned long long)__entry->ref_root,
1157 (unsigned long long)__entry->bytenr,
1158 (unsigned long long)__entry->num_bytes,
1159 (unsigned long long)__entry->seq,
1160 (unsigned long long)__entry->elem_seq,
1161 show_oper_type(__entry->type))
1162);
1163
1164DEFINE_EVENT(btrfs_qgroup_oper, btrfs_qgroup_account,
1165
1166 TP_PROTO(struct btrfs_qgroup_operation *oper),
1167
1168 TP_ARGS(oper)
1169);
1170
1171DEFINE_EVENT(btrfs_qgroup_oper, btrfs_qgroup_record_ref,
1172
1173 TP_PROTO(struct btrfs_qgroup_operation *oper),
1174
1175 TP_ARGS(oper)
1176);
1177
1122#endif /* _TRACE_BTRFS_H */ 1178#endif /* _TRACE_BTRFS_H */
1123 1179
1124/* This part must be outside protection */ 1180/* This part must be outside protection */