]>
Commit | Line | Data |
---|---|---|
0b1b213f CH |
1 | /* |
2 | * Copyright (c) 2009, Christoph Hellwig | |
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 | #undef TRACE_SYSTEM | |
19 | #define TRACE_SYSTEM xfs | |
20 | ||
21 | #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ) | |
22 | #define _TRACE_XFS_H | |
23 | ||
24 | #include <linux/tracepoint.h> | |
25 | ||
26 | struct xfs_agf; | |
27 | struct xfs_alloc_arg; | |
28 | struct xfs_attr_list_context; | |
29 | struct xfs_buf_log_item; | |
30 | struct xfs_da_args; | |
31 | struct xfs_da_node_entry; | |
32 | struct xfs_dquot; | |
9e4c109a | 33 | struct xfs_log_item; |
ad223e60 | 34 | struct xlog; |
750b9c90 | 35 | struct xlog_ticket; |
9abbc539 DC |
36 | struct xlog_recover; |
37 | struct xlog_recover_item; | |
38 | struct xfs_buf_log_format; | |
39 | struct xfs_inode_log_format; | |
1ed845df | 40 | struct xfs_bmbt_irec; |
2c813ad6 | 41 | struct xfs_btree_cur; |
1946b91c | 42 | struct xfs_refcount_irec; |
e89c0413 DW |
43 | struct xfs_fsmap; |
44 | struct xfs_rmap_irec; | |
0b1b213f | 45 | |
ea9a4888 CH |
46 | DECLARE_EVENT_CLASS(xfs_attr_list_class, |
47 | TP_PROTO(struct xfs_attr_list_context *ctx), | |
48 | TP_ARGS(ctx), | |
49 | TP_STRUCT__entry( | |
50 | __field(dev_t, dev) | |
51 | __field(xfs_ino_t, ino) | |
52 | __field(u32, hashval) | |
53 | __field(u32, blkno) | |
54 | __field(u32, offset) | |
55 | __field(void *, alist) | |
56 | __field(int, bufsize) | |
57 | __field(int, count) | |
58 | __field(int, firstu) | |
59 | __field(int, dupcnt) | |
60 | __field(int, flags) | |
61 | ), | |
62 | TP_fast_assign( | |
63 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; | |
64 | __entry->ino = ctx->dp->i_ino; | |
65 | __entry->hashval = ctx->cursor->hashval; | |
66 | __entry->blkno = ctx->cursor->blkno; | |
67 | __entry->offset = ctx->cursor->offset; | |
68 | __entry->alist = ctx->alist; | |
69 | __entry->bufsize = ctx->bufsize; | |
70 | __entry->count = ctx->count; | |
71 | __entry->firstu = ctx->firstu; | |
72 | __entry->flags = ctx->flags; | |
73 | ), | |
74 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " | |
75 | "alist 0x%p size %u count %u firstu %u flags %d %s", | |
76 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
77 | __entry->ino, | |
78 | __entry->hashval, | |
79 | __entry->blkno, | |
80 | __entry->offset, | |
81 | __entry->dupcnt, | |
82 | __entry->alist, | |
83 | __entry->bufsize, | |
84 | __entry->count, | |
85 | __entry->firstu, | |
86 | __entry->flags, | |
87 | __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS) | |
88 | ) | |
89 | ) | |
90 | ||
0b1b213f | 91 | #define DEFINE_ATTR_LIST_EVENT(name) \ |
ea9a4888 | 92 | DEFINE_EVENT(xfs_attr_list_class, name, \ |
0b1b213f | 93 | TP_PROTO(struct xfs_attr_list_context *ctx), \ |
ea9a4888 | 94 | TP_ARGS(ctx)) |
0b1b213f CH |
95 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf); |
96 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all); | |
97 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf); | |
98 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end); | |
99 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full); | |
100 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add); | |
101 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk); | |
102 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound); | |
ee73259b DC |
103 | DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list); |
104 | DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list); | |
0b1b213f | 105 | |
f8adb4d5 LZ |
106 | DECLARE_EVENT_CLASS(xfs_perag_class, |
107 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, | |
108 | unsigned long caller_ip), | |
109 | TP_ARGS(mp, agno, refcount, caller_ip), | |
110 | TP_STRUCT__entry( | |
111 | __field(dev_t, dev) | |
112 | __field(xfs_agnumber_t, agno) | |
113 | __field(int, refcount) | |
114 | __field(unsigned long, caller_ip) | |
115 | ), | |
116 | TP_fast_assign( | |
117 | __entry->dev = mp->m_super->s_dev; | |
118 | __entry->agno = agno; | |
119 | __entry->refcount = refcount; | |
120 | __entry->caller_ip = caller_ip; | |
121 | ), | |
65dd297a | 122 | TP_printk("dev %d:%d agno %u refcount %d caller %ps", |
f8adb4d5 LZ |
123 | MAJOR(__entry->dev), MINOR(__entry->dev), |
124 | __entry->agno, | |
125 | __entry->refcount, | |
126 | (char *)__entry->caller_ip) | |
127 | ); | |
128 | ||
129 | #define DEFINE_PERAG_REF_EVENT(name) \ | |
130 | DEFINE_EVENT(xfs_perag_class, name, \ | |
131 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \ | |
132 | unsigned long caller_ip), \ | |
133 | TP_ARGS(mp, agno, refcount, caller_ip)) | |
134 | DEFINE_PERAG_REF_EVENT(xfs_perag_get); | |
65d0f205 | 135 | DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag); |
f8adb4d5 | 136 | DEFINE_PERAG_REF_EVENT(xfs_perag_put); |
16fd5367 DC |
137 | DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim); |
138 | DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim); | |
27b52867 BF |
139 | DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks); |
140 | DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks); | |
83104d44 DW |
141 | DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks); |
142 | DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks); | |
f8adb4d5 | 143 | |
d123031a DC |
144 | DECLARE_EVENT_CLASS(xfs_ag_class, |
145 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), | |
146 | TP_ARGS(mp, agno), | |
147 | TP_STRUCT__entry( | |
148 | __field(dev_t, dev) | |
149 | __field(xfs_agnumber_t, agno) | |
150 | ), | |
151 | TP_fast_assign( | |
152 | __entry->dev = mp->m_super->s_dev; | |
153 | __entry->agno = agno; | |
154 | ), | |
155 | TP_printk("dev %d:%d agno %u", | |
156 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
157 | __entry->agno) | |
158 | ); | |
159 | #define DEFINE_AG_EVENT(name) \ | |
160 | DEFINE_EVENT(xfs_ag_class, name, \ | |
161 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \ | |
162 | TP_ARGS(mp, agno)) | |
163 | ||
164 | DEFINE_AG_EVENT(xfs_read_agf); | |
165 | DEFINE_AG_EVENT(xfs_alloc_read_agf); | |
166 | DEFINE_AG_EVENT(xfs_read_agi); | |
167 | DEFINE_AG_EVENT(xfs_ialloc_read_agi); | |
168 | ||
0b1b213f CH |
169 | TRACE_EVENT(xfs_attr_list_node_descend, |
170 | TP_PROTO(struct xfs_attr_list_context *ctx, | |
171 | struct xfs_da_node_entry *btree), | |
172 | TP_ARGS(ctx, btree), | |
173 | TP_STRUCT__entry( | |
174 | __field(dev_t, dev) | |
175 | __field(xfs_ino_t, ino) | |
176 | __field(u32, hashval) | |
177 | __field(u32, blkno) | |
178 | __field(u32, offset) | |
179 | __field(void *, alist) | |
180 | __field(int, bufsize) | |
181 | __field(int, count) | |
182 | __field(int, firstu) | |
183 | __field(int, dupcnt) | |
184 | __field(int, flags) | |
185 | __field(u32, bt_hashval) | |
186 | __field(u32, bt_before) | |
187 | ), | |
188 | TP_fast_assign( | |
189 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; | |
190 | __entry->ino = ctx->dp->i_ino; | |
191 | __entry->hashval = ctx->cursor->hashval; | |
192 | __entry->blkno = ctx->cursor->blkno; | |
193 | __entry->offset = ctx->cursor->offset; | |
194 | __entry->alist = ctx->alist; | |
195 | __entry->bufsize = ctx->bufsize; | |
196 | __entry->count = ctx->count; | |
197 | __entry->firstu = ctx->firstu; | |
198 | __entry->flags = ctx->flags; | |
199 | __entry->bt_hashval = be32_to_cpu(btree->hashval); | |
200 | __entry->bt_before = be32_to_cpu(btree->before); | |
201 | ), | |
202 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " | |
203 | "alist 0x%p size %u count %u firstu %u flags %d %s " | |
204 | "node hashval %u, node before %u", | |
205 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
206 | __entry->ino, | |
207 | __entry->hashval, | |
208 | __entry->blkno, | |
209 | __entry->offset, | |
210 | __entry->dupcnt, | |
211 | __entry->alist, | |
212 | __entry->bufsize, | |
213 | __entry->count, | |
214 | __entry->firstu, | |
215 | __entry->flags, | |
216 | __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS), | |
217 | __entry->bt_hashval, | |
218 | __entry->bt_before) | |
219 | ); | |
220 | ||
221 | TRACE_EVENT(xfs_iext_insert, | |
222 | TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, | |
223 | struct xfs_bmbt_irec *r, int state, unsigned long caller_ip), | |
224 | TP_ARGS(ip, idx, r, state, caller_ip), | |
225 | TP_STRUCT__entry( | |
226 | __field(dev_t, dev) | |
227 | __field(xfs_ino_t, ino) | |
228 | __field(xfs_extnum_t, idx) | |
229 | __field(xfs_fileoff_t, startoff) | |
230 | __field(xfs_fsblock_t, startblock) | |
231 | __field(xfs_filblks_t, blockcount) | |
232 | __field(xfs_exntst_t, state) | |
233 | __field(int, bmap_state) | |
234 | __field(unsigned long, caller_ip) | |
235 | ), | |
236 | TP_fast_assign( | |
237 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
238 | __entry->ino = ip->i_ino; | |
239 | __entry->idx = idx; | |
240 | __entry->startoff = r->br_startoff; | |
241 | __entry->startblock = r->br_startblock; | |
242 | __entry->blockcount = r->br_blockcount; | |
243 | __entry->state = r->br_state; | |
244 | __entry->bmap_state = state; | |
245 | __entry->caller_ip = caller_ip; | |
246 | ), | |
247 | TP_printk("dev %d:%d ino 0x%llx state %s idx %ld " | |
65dd297a | 248 | "offset %lld block %lld count %lld flag %d caller %ps", |
0b1b213f CH |
249 | MAJOR(__entry->dev), MINOR(__entry->dev), |
250 | __entry->ino, | |
251 | __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), | |
252 | (long)__entry->idx, | |
253 | __entry->startoff, | |
c8ce540d | 254 | (int64_t)__entry->startblock, |
0b1b213f CH |
255 | __entry->blockcount, |
256 | __entry->state, | |
257 | (char *)__entry->caller_ip) | |
258 | ); | |
259 | ||
ea9a4888 CH |
260 | DECLARE_EVENT_CLASS(xfs_bmap_class, |
261 | TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, | |
262 | unsigned long caller_ip), | |
263 | TP_ARGS(ip, idx, state, caller_ip), | |
264 | TP_STRUCT__entry( | |
265 | __field(dev_t, dev) | |
266 | __field(xfs_ino_t, ino) | |
267 | __field(xfs_extnum_t, idx) | |
268 | __field(xfs_fileoff_t, startoff) | |
269 | __field(xfs_fsblock_t, startblock) | |
270 | __field(xfs_filblks_t, blockcount) | |
271 | __field(xfs_exntst_t, state) | |
272 | __field(int, bmap_state) | |
273 | __field(unsigned long, caller_ip) | |
274 | ), | |
275 | TP_fast_assign( | |
3993baeb | 276 | struct xfs_ifork *ifp; |
ea9a4888 CH |
277 | struct xfs_bmbt_irec r; |
278 | ||
3993baeb | 279 | ifp = xfs_iext_state_to_fork(ip, state); |
ea9a4888 CH |
280 | xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r); |
281 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
282 | __entry->ino = ip->i_ino; | |
283 | __entry->idx = idx; | |
284 | __entry->startoff = r.br_startoff; | |
285 | __entry->startblock = r.br_startblock; | |
286 | __entry->blockcount = r.br_blockcount; | |
287 | __entry->state = r.br_state; | |
288 | __entry->bmap_state = state; | |
289 | __entry->caller_ip = caller_ip; | |
290 | ), | |
291 | TP_printk("dev %d:%d ino 0x%llx state %s idx %ld " | |
65dd297a | 292 | "offset %lld block %lld count %lld flag %d caller %ps", |
ea9a4888 CH |
293 | MAJOR(__entry->dev), MINOR(__entry->dev), |
294 | __entry->ino, | |
295 | __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), | |
296 | (long)__entry->idx, | |
297 | __entry->startoff, | |
c8ce540d | 298 | (int64_t)__entry->startblock, |
ea9a4888 CH |
299 | __entry->blockcount, |
300 | __entry->state, | |
301 | (char *)__entry->caller_ip) | |
302 | ) | |
303 | ||
0b1b213f | 304 | #define DEFINE_BMAP_EVENT(name) \ |
ea9a4888 | 305 | DEFINE_EVENT(xfs_bmap_class, name, \ |
0b1b213f CH |
306 | TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \ |
307 | unsigned long caller_ip), \ | |
ea9a4888 | 308 | TP_ARGS(ip, idx, state, caller_ip)) |
0b1b213f CH |
309 | DEFINE_BMAP_EVENT(xfs_iext_remove); |
310 | DEFINE_BMAP_EVENT(xfs_bmap_pre_update); | |
311 | DEFINE_BMAP_EVENT(xfs_bmap_post_update); | |
312 | DEFINE_BMAP_EVENT(xfs_extlist); | |
313 | ||
ea9a4888 CH |
314 | DECLARE_EVENT_CLASS(xfs_buf_class, |
315 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), | |
316 | TP_ARGS(bp, caller_ip), | |
317 | TP_STRUCT__entry( | |
318 | __field(dev_t, dev) | |
319 | __field(xfs_daddr_t, bno) | |
4e94b71b | 320 | __field(int, nblks) |
ea9a4888 CH |
321 | __field(int, hold) |
322 | __field(int, pincount) | |
323 | __field(unsigned, lockval) | |
324 | __field(unsigned, flags) | |
325 | __field(unsigned long, caller_ip) | |
326 | ), | |
327 | TP_fast_assign( | |
328 | __entry->dev = bp->b_target->bt_dev; | |
329 | __entry->bno = bp->b_bn; | |
4e94b71b | 330 | __entry->nblks = bp->b_length; |
ea9a4888 CH |
331 | __entry->hold = atomic_read(&bp->b_hold); |
332 | __entry->pincount = atomic_read(&bp->b_pin_count); | |
0c842ad4 | 333 | __entry->lockval = bp->b_sema.count; |
ea9a4888 CH |
334 | __entry->flags = bp->b_flags; |
335 | __entry->caller_ip = caller_ip; | |
336 | ), | |
4e94b71b | 337 | TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d " |
65dd297a | 338 | "lock %d flags %s caller %ps", |
ea9a4888 CH |
339 | MAJOR(__entry->dev), MINOR(__entry->dev), |
340 | (unsigned long long)__entry->bno, | |
4e94b71b | 341 | __entry->nblks, |
ea9a4888 CH |
342 | __entry->hold, |
343 | __entry->pincount, | |
344 | __entry->lockval, | |
345 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), | |
346 | (void *)__entry->caller_ip) | |
0b1b213f | 347 | ) |
ea9a4888 CH |
348 | |
349 | #define DEFINE_BUF_EVENT(name) \ | |
350 | DEFINE_EVENT(xfs_buf_class, name, \ | |
351 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \ | |
352 | TP_ARGS(bp, caller_ip)) | |
0b1b213f CH |
353 | DEFINE_BUF_EVENT(xfs_buf_init); |
354 | DEFINE_BUF_EVENT(xfs_buf_free); | |
355 | DEFINE_BUF_EVENT(xfs_buf_hold); | |
356 | DEFINE_BUF_EVENT(xfs_buf_rele); | |
0b1b213f | 357 | DEFINE_BUF_EVENT(xfs_buf_iodone); |
595bff75 DC |
358 | DEFINE_BUF_EVENT(xfs_buf_submit); |
359 | DEFINE_BUF_EVENT(xfs_buf_submit_wait); | |
0b1b213f CH |
360 | DEFINE_BUF_EVENT(xfs_buf_lock); |
361 | DEFINE_BUF_EVENT(xfs_buf_lock_done); | |
479c6412 | 362 | DEFINE_BUF_EVENT(xfs_buf_trylock_fail); |
0c842ad4 | 363 | DEFINE_BUF_EVENT(xfs_buf_trylock); |
0b1b213f | 364 | DEFINE_BUF_EVENT(xfs_buf_unlock); |
0b1b213f CH |
365 | DEFINE_BUF_EVENT(xfs_buf_iowait); |
366 | DEFINE_BUF_EVENT(xfs_buf_iowait_done); | |
367 | DEFINE_BUF_EVENT(xfs_buf_delwri_queue); | |
43ff2122 | 368 | DEFINE_BUF_EVENT(xfs_buf_delwri_queued); |
0b1b213f | 369 | DEFINE_BUF_EVENT(xfs_buf_delwri_split); |
7912e7fe | 370 | DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf); |
686865f7 | 371 | DEFINE_BUF_EVENT(xfs_buf_get_uncached); |
0b1b213f | 372 | DEFINE_BUF_EVENT(xfs_buf_item_relse); |
0b1b213f CH |
373 | DEFINE_BUF_EVENT(xfs_buf_item_iodone_async); |
374 | DEFINE_BUF_EVENT(xfs_buf_error_relse); | |
9f87832a | 375 | DEFINE_BUF_EVENT(xfs_buf_wait_buftarg); |
0b1b213f CH |
376 | DEFINE_BUF_EVENT(xfs_trans_read_buf_shut); |
377 | ||
378 | /* not really buffer traces, but the buf provides useful information */ | |
379 | DEFINE_BUF_EVENT(xfs_btree_corrupt); | |
0b1b213f | 380 | DEFINE_BUF_EVENT(xfs_reset_dqcounts); |
0b1b213f CH |
381 | |
382 | /* pass flags explicitly */ | |
ea9a4888 CH |
383 | DECLARE_EVENT_CLASS(xfs_buf_flags_class, |
384 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), | |
385 | TP_ARGS(bp, flags, caller_ip), | |
386 | TP_STRUCT__entry( | |
387 | __field(dev_t, dev) | |
388 | __field(xfs_daddr_t, bno) | |
389 | __field(size_t, buffer_length) | |
390 | __field(int, hold) | |
391 | __field(int, pincount) | |
392 | __field(unsigned, lockval) | |
393 | __field(unsigned, flags) | |
394 | __field(unsigned long, caller_ip) | |
395 | ), | |
396 | TP_fast_assign( | |
397 | __entry->dev = bp->b_target->bt_dev; | |
398 | __entry->bno = bp->b_bn; | |
4e94b71b | 399 | __entry->buffer_length = BBTOB(bp->b_length); |
ea9a4888 CH |
400 | __entry->flags = flags; |
401 | __entry->hold = atomic_read(&bp->b_hold); | |
402 | __entry->pincount = atomic_read(&bp->b_pin_count); | |
0c842ad4 | 403 | __entry->lockval = bp->b_sema.count; |
ea9a4888 CH |
404 | __entry->caller_ip = caller_ip; |
405 | ), | |
406 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " | |
65dd297a | 407 | "lock %d flags %s caller %ps", |
ea9a4888 CH |
408 | MAJOR(__entry->dev), MINOR(__entry->dev), |
409 | (unsigned long long)__entry->bno, | |
410 | __entry->buffer_length, | |
411 | __entry->hold, | |
412 | __entry->pincount, | |
413 | __entry->lockval, | |
414 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), | |
415 | (void *)__entry->caller_ip) | |
0b1b213f | 416 | ) |
ea9a4888 CH |
417 | |
418 | #define DEFINE_BUF_FLAGS_EVENT(name) \ | |
419 | DEFINE_EVENT(xfs_buf_flags_class, name, \ | |
420 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \ | |
421 | TP_ARGS(bp, flags, caller_ip)) | |
0b1b213f CH |
422 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_find); |
423 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_get); | |
424 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_read); | |
425 | ||
426 | TRACE_EVENT(xfs_buf_ioerror, | |
427 | TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip), | |
428 | TP_ARGS(bp, error, caller_ip), | |
429 | TP_STRUCT__entry( | |
430 | __field(dev_t, dev) | |
431 | __field(xfs_daddr_t, bno) | |
432 | __field(size_t, buffer_length) | |
433 | __field(unsigned, flags) | |
434 | __field(int, hold) | |
435 | __field(int, pincount) | |
436 | __field(unsigned, lockval) | |
437 | __field(int, error) | |
438 | __field(unsigned long, caller_ip) | |
439 | ), | |
440 | TP_fast_assign( | |
441 | __entry->dev = bp->b_target->bt_dev; | |
442 | __entry->bno = bp->b_bn; | |
4e94b71b | 443 | __entry->buffer_length = BBTOB(bp->b_length); |
0b1b213f CH |
444 | __entry->hold = atomic_read(&bp->b_hold); |
445 | __entry->pincount = atomic_read(&bp->b_pin_count); | |
0c842ad4 | 446 | __entry->lockval = bp->b_sema.count; |
0b1b213f CH |
447 | __entry->error = error; |
448 | __entry->flags = bp->b_flags; | |
449 | __entry->caller_ip = caller_ip; | |
450 | ), | |
451 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " | |
65dd297a | 452 | "lock %d error %d flags %s caller %ps", |
0b1b213f CH |
453 | MAJOR(__entry->dev), MINOR(__entry->dev), |
454 | (unsigned long long)__entry->bno, | |
455 | __entry->buffer_length, | |
456 | __entry->hold, | |
457 | __entry->pincount, | |
458 | __entry->lockval, | |
459 | __entry->error, | |
460 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), | |
461 | (void *)__entry->caller_ip) | |
462 | ); | |
463 | ||
ea9a4888 CH |
464 | DECLARE_EVENT_CLASS(xfs_buf_item_class, |
465 | TP_PROTO(struct xfs_buf_log_item *bip), | |
466 | TP_ARGS(bip), | |
467 | TP_STRUCT__entry( | |
468 | __field(dev_t, dev) | |
469 | __field(xfs_daddr_t, buf_bno) | |
470 | __field(size_t, buf_len) | |
471 | __field(int, buf_hold) | |
472 | __field(int, buf_pincount) | |
473 | __field(int, buf_lockval) | |
474 | __field(unsigned, buf_flags) | |
475 | __field(unsigned, bli_recur) | |
476 | __field(int, bli_refcount) | |
477 | __field(unsigned, bli_flags) | |
478 | __field(void *, li_desc) | |
479 | __field(unsigned, li_flags) | |
480 | ), | |
481 | TP_fast_assign( | |
482 | __entry->dev = bip->bli_buf->b_target->bt_dev; | |
483 | __entry->bli_flags = bip->bli_flags; | |
484 | __entry->bli_recur = bip->bli_recur; | |
485 | __entry->bli_refcount = atomic_read(&bip->bli_refcount); | |
486 | __entry->buf_bno = bip->bli_buf->b_bn; | |
4e94b71b | 487 | __entry->buf_len = BBTOB(bip->bli_buf->b_length); |
ea9a4888 CH |
488 | __entry->buf_flags = bip->bli_buf->b_flags; |
489 | __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold); | |
490 | __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count); | |
0c842ad4 | 491 | __entry->buf_lockval = bip->bli_buf->b_sema.count; |
ea9a4888 CH |
492 | __entry->li_desc = bip->bli_item.li_desc; |
493 | __entry->li_flags = bip->bli_item.li_flags; | |
494 | ), | |
495 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " | |
496 | "lock %d flags %s recur %d refcount %d bliflags %s " | |
497 | "lidesc 0x%p liflags %s", | |
498 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
499 | (unsigned long long)__entry->buf_bno, | |
500 | __entry->buf_len, | |
501 | __entry->buf_hold, | |
502 | __entry->buf_pincount, | |
503 | __entry->buf_lockval, | |
504 | __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS), | |
505 | __entry->bli_recur, | |
506 | __entry->bli_refcount, | |
507 | __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS), | |
508 | __entry->li_desc, | |
509 | __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS)) | |
0b1b213f | 510 | ) |
ea9a4888 CH |
511 | |
512 | #define DEFINE_BUF_ITEM_EVENT(name) \ | |
513 | DEFINE_EVENT(xfs_buf_item_class, name, \ | |
514 | TP_PROTO(struct xfs_buf_log_item *bip), \ | |
515 | TP_ARGS(bip)) | |
0b1b213f | 516 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size); |
5f6bed76 | 517 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered); |
0b1b213f CH |
518 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale); |
519 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format); | |
5f6bed76 | 520 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered); |
0b1b213f | 521 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale); |
5f6bed76 | 522 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered); |
0b1b213f CH |
523 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin); |
524 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin); | |
525 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale); | |
0b1b213f CH |
526 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock); |
527 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale); | |
528 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed); | |
529 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push); | |
530 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf); | |
531 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur); | |
532 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb); | |
533 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur); | |
534 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf); | |
535 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur); | |
536 | DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf); | |
537 | DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse); | |
538 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin); | |
539 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold); | |
540 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release); | |
541 | DEFINE_BUF_ITEM_EVENT(xfs_trans_binval); | |
542 | ||
b94acd47 CH |
543 | DECLARE_EVENT_CLASS(xfs_filestream_class, |
544 | TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), | |
545 | TP_ARGS(ip, agno), | |
546 | TP_STRUCT__entry( | |
547 | __field(dev_t, dev) | |
548 | __field(xfs_ino_t, ino) | |
549 | __field(xfs_agnumber_t, agno) | |
550 | __field(int, streams) | |
551 | ), | |
552 | TP_fast_assign( | |
553 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
554 | __entry->ino = ip->i_ino; | |
555 | __entry->agno = agno; | |
556 | __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno); | |
557 | ), | |
558 | TP_printk("dev %d:%d ino 0x%llx agno %u streams %d", | |
559 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
560 | __entry->ino, | |
561 | __entry->agno, | |
562 | __entry->streams) | |
563 | ) | |
564 | #define DEFINE_FILESTREAM_EVENT(name) \ | |
565 | DEFINE_EVENT(xfs_filestream_class, name, \ | |
566 | TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \ | |
567 | TP_ARGS(ip, agno)) | |
568 | DEFINE_FILESTREAM_EVENT(xfs_filestream_free); | |
569 | DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup); | |
570 | DEFINE_FILESTREAM_EVENT(xfs_filestream_scan); | |
571 | ||
572 | TRACE_EVENT(xfs_filestream_pick, | |
573 | TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno, | |
574 | xfs_extlen_t free, int nscan), | |
575 | TP_ARGS(ip, agno, free, nscan), | |
576 | TP_STRUCT__entry( | |
577 | __field(dev_t, dev) | |
578 | __field(xfs_ino_t, ino) | |
579 | __field(xfs_agnumber_t, agno) | |
580 | __field(int, streams) | |
581 | __field(xfs_extlen_t, free) | |
582 | __field(int, nscan) | |
583 | ), | |
584 | TP_fast_assign( | |
585 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
586 | __entry->ino = ip->i_ino; | |
587 | __entry->agno = agno; | |
588 | __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno); | |
589 | __entry->free = free; | |
590 | __entry->nscan = nscan; | |
591 | ), | |
592 | TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d", | |
593 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
594 | __entry->ino, | |
595 | __entry->agno, | |
596 | __entry->streams, | |
597 | __entry->free, | |
598 | __entry->nscan) | |
599 | ); | |
600 | ||
ea9a4888 CH |
601 | DECLARE_EVENT_CLASS(xfs_lock_class, |
602 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, | |
603 | unsigned long caller_ip), | |
604 | TP_ARGS(ip, lock_flags, caller_ip), | |
605 | TP_STRUCT__entry( | |
606 | __field(dev_t, dev) | |
607 | __field(xfs_ino_t, ino) | |
608 | __field(int, lock_flags) | |
609 | __field(unsigned long, caller_ip) | |
610 | ), | |
611 | TP_fast_assign( | |
612 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
613 | __entry->ino = ip->i_ino; | |
614 | __entry->lock_flags = lock_flags; | |
615 | __entry->caller_ip = caller_ip; | |
616 | ), | |
65dd297a | 617 | TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps", |
ea9a4888 CH |
618 | MAJOR(__entry->dev), MINOR(__entry->dev), |
619 | __entry->ino, | |
620 | __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS), | |
621 | (void *)__entry->caller_ip) | |
622 | ) | |
623 | ||
0b1b213f | 624 | #define DEFINE_LOCK_EVENT(name) \ |
ea9a4888 | 625 | DEFINE_EVENT(xfs_lock_class, name, \ |
0b1b213f CH |
626 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \ |
627 | unsigned long caller_ip), \ | |
ea9a4888 | 628 | TP_ARGS(ip, lock_flags, caller_ip)) |
0b1b213f CH |
629 | DEFINE_LOCK_EVENT(xfs_ilock); |
630 | DEFINE_LOCK_EVENT(xfs_ilock_nowait); | |
631 | DEFINE_LOCK_EVENT(xfs_ilock_demote); | |
632 | DEFINE_LOCK_EVENT(xfs_iunlock); | |
633 | ||
cca28fb8 | 634 | DECLARE_EVENT_CLASS(xfs_inode_class, |
ea9a4888 CH |
635 | TP_PROTO(struct xfs_inode *ip), |
636 | TP_ARGS(ip), | |
637 | TP_STRUCT__entry( | |
638 | __field(dev_t, dev) | |
639 | __field(xfs_ino_t, ino) | |
640 | ), | |
641 | TP_fast_assign( | |
642 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
643 | __entry->ino = ip->i_ino; | |
644 | ), | |
645 | TP_printk("dev %d:%d ino 0x%llx", | |
646 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
647 | __entry->ino) | |
648 | ) | |
649 | ||
cca28fb8 CH |
650 | #define DEFINE_INODE_EVENT(name) \ |
651 | DEFINE_EVENT(xfs_inode_class, name, \ | |
0b1b213f | 652 | TP_PROTO(struct xfs_inode *ip), \ |
ea9a4888 | 653 | TP_ARGS(ip)) |
cca28fb8 CH |
654 | DEFINE_INODE_EVENT(xfs_iget_skip); |
655 | DEFINE_INODE_EVENT(xfs_iget_reclaim); | |
656 | DEFINE_INODE_EVENT(xfs_iget_reclaim_fail); | |
657 | DEFINE_INODE_EVENT(xfs_iget_hit); | |
658 | DEFINE_INODE_EVENT(xfs_iget_miss); | |
0b1b213f | 659 | |
cca28fb8 CH |
660 | DEFINE_INODE_EVENT(xfs_getattr); |
661 | DEFINE_INODE_EVENT(xfs_setattr); | |
662 | DEFINE_INODE_EVENT(xfs_readlink); | |
725eb1eb | 663 | DEFINE_INODE_EVENT(xfs_inactive_symlink); |
cca28fb8 CH |
664 | DEFINE_INODE_EVENT(xfs_alloc_file_space); |
665 | DEFINE_INODE_EVENT(xfs_free_file_space); | |
897b73b6 | 666 | DEFINE_INODE_EVENT(xfs_zero_file_space); |
e1d8fb88 | 667 | DEFINE_INODE_EVENT(xfs_collapse_file_space); |
a904b1ca | 668 | DEFINE_INODE_EVENT(xfs_insert_file_space); |
cca28fb8 | 669 | DEFINE_INODE_EVENT(xfs_readdir); |
0f1a932f | 670 | #ifdef CONFIG_XFS_POSIX_ACL |
4e34e719 | 671 | DEFINE_INODE_EVENT(xfs_get_acl); |
0f1a932f | 672 | #endif |
cca28fb8 CH |
673 | DEFINE_INODE_EVENT(xfs_vm_bmap); |
674 | DEFINE_INODE_EVENT(xfs_file_ioctl); | |
675 | DEFINE_INODE_EVENT(xfs_file_compat_ioctl); | |
676 | DEFINE_INODE_EVENT(xfs_ioctl_setattr); | |
1da2f2db | 677 | DEFINE_INODE_EVENT(xfs_dir_fsync); |
cca28fb8 CH |
678 | DEFINE_INODE_EVENT(xfs_file_fsync); |
679 | DEFINE_INODE_EVENT(xfs_destroy_inode); | |
69ff2826 | 680 | DEFINE_INODE_EVENT(xfs_update_time); |
cca28fb8 CH |
681 | |
682 | DEFINE_INODE_EVENT(xfs_dquot_dqalloc); | |
683 | DEFINE_INODE_EVENT(xfs_dquot_dqdetach); | |
684 | ||
27b52867 BF |
685 | DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag); |
686 | DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag); | |
41176a68 | 687 | DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid); |
83104d44 DW |
688 | DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag); |
689 | DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag); | |
690 | DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid); | |
27b52867 | 691 | |
de0e8c20 | 692 | DEFINE_INODE_EVENT(xfs_filemap_fault); |
a2d58167 | 693 | DEFINE_INODE_EVENT(xfs_filemap_huge_fault); |
075a924d | 694 | DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite); |
3af49285 | 695 | DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite); |
de0e8c20 | 696 | |
cca28fb8 | 697 | DECLARE_EVENT_CLASS(xfs_iref_class, |
ea9a4888 CH |
698 | TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), |
699 | TP_ARGS(ip, caller_ip), | |
700 | TP_STRUCT__entry( | |
701 | __field(dev_t, dev) | |
702 | __field(xfs_ino_t, ino) | |
703 | __field(int, count) | |
4aaf15d1 | 704 | __field(int, pincount) |
ea9a4888 CH |
705 | __field(unsigned long, caller_ip) |
706 | ), | |
707 | TP_fast_assign( | |
708 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
709 | __entry->ino = ip->i_ino; | |
710 | __entry->count = atomic_read(&VFS_I(ip)->i_count); | |
4aaf15d1 | 711 | __entry->pincount = atomic_read(&ip->i_pincount); |
ea9a4888 CH |
712 | __entry->caller_ip = caller_ip; |
713 | ), | |
65dd297a | 714 | TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps", |
ea9a4888 CH |
715 | MAJOR(__entry->dev), MINOR(__entry->dev), |
716 | __entry->ino, | |
717 | __entry->count, | |
4aaf15d1 | 718 | __entry->pincount, |
ea9a4888 | 719 | (char *)__entry->caller_ip) |
19cb7e38 BF |
720 | ) |
721 | ||
722 | TRACE_EVENT(xfs_iomap_prealloc_size, | |
723 | TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift, | |
724 | unsigned int writeio_blocks), | |
725 | TP_ARGS(ip, blocks, shift, writeio_blocks), | |
726 | TP_STRUCT__entry( | |
727 | __field(dev_t, dev) | |
728 | __field(xfs_ino_t, ino) | |
729 | __field(xfs_fsblock_t, blocks) | |
730 | __field(int, shift) | |
731 | __field(unsigned int, writeio_blocks) | |
732 | ), | |
733 | TP_fast_assign( | |
734 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
735 | __entry->ino = ip->i_ino; | |
736 | __entry->blocks = blocks; | |
737 | __entry->shift = shift; | |
738 | __entry->writeio_blocks = writeio_blocks; | |
739 | ), | |
740 | TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d " | |
741 | "m_writeio_blocks %u", | |
742 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, | |
743 | __entry->blocks, __entry->shift, __entry->writeio_blocks) | |
ea9a4888 CH |
744 | ) |
745 | ||
56d1115c BF |
746 | TRACE_EVENT(xfs_irec_merge_pre, |
747 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino, | |
748 | uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask), | |
749 | TP_ARGS(mp, agno, agino, holemask, nagino, nholemask), | |
750 | TP_STRUCT__entry( | |
751 | __field(dev_t, dev) | |
752 | __field(xfs_agnumber_t, agno) | |
753 | __field(xfs_agino_t, agino) | |
754 | __field(uint16_t, holemask) | |
755 | __field(xfs_agino_t, nagino) | |
756 | __field(uint16_t, nholemask) | |
757 | ), | |
758 | TP_fast_assign( | |
759 | __entry->dev = mp->m_super->s_dev; | |
760 | __entry->agno = agno; | |
761 | __entry->agino = agino; | |
762 | __entry->holemask = holemask; | |
763 | __entry->nagino = nagino; | |
764 | __entry->nholemask = holemask; | |
765 | ), | |
766 | TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)", | |
767 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno, | |
768 | __entry->agino, __entry->holemask, __entry->nagino, | |
769 | __entry->nholemask) | |
770 | ) | |
771 | ||
772 | TRACE_EVENT(xfs_irec_merge_post, | |
773 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino, | |
774 | uint16_t holemask), | |
775 | TP_ARGS(mp, agno, agino, holemask), | |
776 | TP_STRUCT__entry( | |
777 | __field(dev_t, dev) | |
778 | __field(xfs_agnumber_t, agno) | |
779 | __field(xfs_agino_t, agino) | |
780 | __field(uint16_t, holemask) | |
781 | ), | |
782 | TP_fast_assign( | |
783 | __entry->dev = mp->m_super->s_dev; | |
784 | __entry->agno = agno; | |
785 | __entry->agino = agino; | |
786 | __entry->holemask = holemask; | |
787 | ), | |
788 | TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev), | |
789 | MINOR(__entry->dev), __entry->agno, __entry->agino, | |
790 | __entry->holemask) | |
791 | ) | |
792 | ||
cca28fb8 CH |
793 | #define DEFINE_IREF_EVENT(name) \ |
794 | DEFINE_EVENT(xfs_iref_class, name, \ | |
0b1b213f | 795 | TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \ |
ea9a4888 | 796 | TP_ARGS(ip, caller_ip)) |
cca28fb8 CH |
797 | DEFINE_IREF_EVENT(xfs_irele); |
798 | DEFINE_IREF_EVENT(xfs_inode_pin); | |
799 | DEFINE_IREF_EVENT(xfs_inode_unpin); | |
800 | DEFINE_IREF_EVENT(xfs_inode_unpin_nowait); | |
801 | ||
802 | DECLARE_EVENT_CLASS(xfs_namespace_class, | |
803 | TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), | |
804 | TP_ARGS(dp, name), | |
805 | TP_STRUCT__entry( | |
806 | __field(dev_t, dev) | |
807 | __field(xfs_ino_t, dp_ino) | |
f6161375 | 808 | __field(int, namelen) |
cca28fb8 CH |
809 | __dynamic_array(char, name, name->len) |
810 | ), | |
811 | TP_fast_assign( | |
812 | __entry->dev = VFS_I(dp)->i_sb->s_dev; | |
813 | __entry->dp_ino = dp->i_ino; | |
f6161375 | 814 | __entry->namelen = name->len; |
cca28fb8 CH |
815 | memcpy(__get_str(name), name->name, name->len); |
816 | ), | |
f6161375 | 817 | TP_printk("dev %d:%d dp ino 0x%llx name %.*s", |
cca28fb8 CH |
818 | MAJOR(__entry->dev), MINOR(__entry->dev), |
819 | __entry->dp_ino, | |
f6161375 | 820 | __entry->namelen, |
cca28fb8 CH |
821 | __get_str(name)) |
822 | ) | |
823 | ||
824 | #define DEFINE_NAMESPACE_EVENT(name) \ | |
825 | DEFINE_EVENT(xfs_namespace_class, name, \ | |
826 | TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \ | |
827 | TP_ARGS(dp, name)) | |
828 | DEFINE_NAMESPACE_EVENT(xfs_remove); | |
829 | DEFINE_NAMESPACE_EVENT(xfs_link); | |
830 | DEFINE_NAMESPACE_EVENT(xfs_lookup); | |
831 | DEFINE_NAMESPACE_EVENT(xfs_create); | |
832 | DEFINE_NAMESPACE_EVENT(xfs_symlink); | |
4aaf15d1 | 833 | |
cca28fb8 CH |
834 | TRACE_EVENT(xfs_rename, |
835 | TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp, | |
836 | struct xfs_name *src_name, struct xfs_name *target_name), | |
837 | TP_ARGS(src_dp, target_dp, src_name, target_name), | |
838 | TP_STRUCT__entry( | |
839 | __field(dev_t, dev) | |
840 | __field(xfs_ino_t, src_dp_ino) | |
841 | __field(xfs_ino_t, target_dp_ino) | |
f6161375 CH |
842 | __field(int, src_namelen) |
843 | __field(int, target_namelen) | |
cca28fb8 CH |
844 | __dynamic_array(char, src_name, src_name->len) |
845 | __dynamic_array(char, target_name, target_name->len) | |
846 | ), | |
847 | TP_fast_assign( | |
848 | __entry->dev = VFS_I(src_dp)->i_sb->s_dev; | |
849 | __entry->src_dp_ino = src_dp->i_ino; | |
850 | __entry->target_dp_ino = target_dp->i_ino; | |
f6161375 CH |
851 | __entry->src_namelen = src_name->len; |
852 | __entry->target_namelen = target_name->len; | |
cca28fb8 | 853 | memcpy(__get_str(src_name), src_name->name, src_name->len); |
f6161375 CH |
854 | memcpy(__get_str(target_name), target_name->name, |
855 | target_name->len); | |
cca28fb8 CH |
856 | ), |
857 | TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx" | |
f6161375 | 858 | " src name %.*s target name %.*s", |
cca28fb8 CH |
859 | MAJOR(__entry->dev), MINOR(__entry->dev), |
860 | __entry->src_dp_ino, | |
861 | __entry->target_dp_ino, | |
f6161375 | 862 | __entry->src_namelen, |
cca28fb8 | 863 | __get_str(src_name), |
f6161375 | 864 | __entry->target_namelen, |
cca28fb8 CH |
865 | __get_str(target_name)) |
866 | ) | |
0b1b213f | 867 | |
ea9a4888 CH |
868 | DECLARE_EVENT_CLASS(xfs_dquot_class, |
869 | TP_PROTO(struct xfs_dquot *dqp), | |
870 | TP_ARGS(dqp), | |
871 | TP_STRUCT__entry( | |
872 | __field(dev_t, dev) | |
b262e5df | 873 | __field(u32, id) |
ea9a4888 CH |
874 | __field(unsigned, flags) |
875 | __field(unsigned, nrefs) | |
876 | __field(unsigned long long, res_bcount) | |
877 | __field(unsigned long long, bcount) | |
878 | __field(unsigned long long, icount) | |
879 | __field(unsigned long long, blk_hardlimit) | |
880 | __field(unsigned long long, blk_softlimit) | |
881 | __field(unsigned long long, ino_hardlimit) | |
882 | __field(unsigned long long, ino_softlimit) | |
0b1b213f | 883 | ), \ |
ea9a4888 CH |
884 | TP_fast_assign( |
885 | __entry->dev = dqp->q_mount->m_super->s_dev; | |
b262e5df | 886 | __entry->id = be32_to_cpu(dqp->q_core.d_id); |
ea9a4888 CH |
887 | __entry->flags = dqp->dq_flags; |
888 | __entry->nrefs = dqp->q_nrefs; | |
889 | __entry->res_bcount = dqp->q_res_bcount; | |
890 | __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount); | |
891 | __entry->icount = be64_to_cpu(dqp->q_core.d_icount); | |
892 | __entry->blk_hardlimit = | |
893 | be64_to_cpu(dqp->q_core.d_blk_hardlimit); | |
894 | __entry->blk_softlimit = | |
895 | be64_to_cpu(dqp->q_core.d_blk_softlimit); | |
896 | __entry->ino_hardlimit = | |
897 | be64_to_cpu(dqp->q_core.d_ino_hardlimit); | |
898 | __entry->ino_softlimit = | |
899 | be64_to_cpu(dqp->q_core.d_ino_softlimit); | |
900 | ), | |
901 | TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx " | |
b262e5df CH |
902 | "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx " |
903 | "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]", | |
ea9a4888 | 904 | MAJOR(__entry->dev), MINOR(__entry->dev), |
b262e5df | 905 | __entry->id, |
ea9a4888 CH |
906 | __print_flags(__entry->flags, "|", XFS_DQ_FLAGS), |
907 | __entry->nrefs, | |
908 | __entry->res_bcount, | |
909 | __entry->bcount, | |
910 | __entry->blk_hardlimit, | |
911 | __entry->blk_softlimit, | |
912 | __entry->icount, | |
913 | __entry->ino_hardlimit, | |
914 | __entry->ino_softlimit) | |
0b1b213f | 915 | ) |
ea9a4888 CH |
916 | |
917 | #define DEFINE_DQUOT_EVENT(name) \ | |
918 | DEFINE_EVENT(xfs_dquot_class, name, \ | |
919 | TP_PROTO(struct xfs_dquot *dqp), \ | |
920 | TP_ARGS(dqp)) | |
0b1b213f | 921 | DEFINE_DQUOT_EVENT(xfs_dqadjust); |
0b1b213f CH |
922 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_want); |
923 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty); | |
92b2e5b3 CH |
924 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy); |
925 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_done); | |
0b1b213f CH |
926 | DEFINE_DQUOT_EVENT(xfs_dqattach_found); |
927 | DEFINE_DQUOT_EVENT(xfs_dqattach_get); | |
0b1b213f CH |
928 | DEFINE_DQUOT_EVENT(xfs_dqalloc); |
929 | DEFINE_DQUOT_EVENT(xfs_dqtobp_read); | |
930 | DEFINE_DQUOT_EVENT(xfs_dqread); | |
931 | DEFINE_DQUOT_EVENT(xfs_dqread_fail); | |
0b1b213f CH |
932 | DEFINE_DQUOT_EVENT(xfs_dqget_hit); |
933 | DEFINE_DQUOT_EVENT(xfs_dqget_miss); | |
9f920f11 CH |
934 | DEFINE_DQUOT_EVENT(xfs_dqget_freeing); |
935 | DEFINE_DQUOT_EVENT(xfs_dqget_dup); | |
0b1b213f | 936 | DEFINE_DQUOT_EVENT(xfs_dqput); |
0b1b213f CH |
937 | DEFINE_DQUOT_EVENT(xfs_dqput_free); |
938 | DEFINE_DQUOT_EVENT(xfs_dqrele); | |
939 | DEFINE_DQUOT_EVENT(xfs_dqflush); | |
940 | DEFINE_DQUOT_EVENT(xfs_dqflush_force); | |
941 | DEFINE_DQUOT_EVENT(xfs_dqflush_done); | |
0b1b213f | 942 | |
ea9a4888 | 943 | DECLARE_EVENT_CLASS(xfs_loggrant_class, |
ad223e60 | 944 | TP_PROTO(struct xlog *log, struct xlog_ticket *tic), |
ea9a4888 CH |
945 | TP_ARGS(log, tic), |
946 | TP_STRUCT__entry( | |
947 | __field(dev_t, dev) | |
ea9a4888 CH |
948 | __field(char, ocnt) |
949 | __field(char, cnt) | |
950 | __field(int, curr_res) | |
951 | __field(int, unit_res) | |
952 | __field(unsigned int, flags) | |
10547941 DC |
953 | __field(int, reserveq) |
954 | __field(int, writeq) | |
ea9a4888 CH |
955 | __field(int, grant_reserve_cycle) |
956 | __field(int, grant_reserve_bytes) | |
957 | __field(int, grant_write_cycle) | |
958 | __field(int, grant_write_bytes) | |
959 | __field(int, curr_cycle) | |
960 | __field(int, curr_block) | |
961 | __field(xfs_lsn_t, tail_lsn) | |
962 | ), | |
963 | TP_fast_assign( | |
964 | __entry->dev = log->l_mp->m_super->s_dev; | |
ea9a4888 CH |
965 | __entry->ocnt = tic->t_ocnt; |
966 | __entry->cnt = tic->t_cnt; | |
967 | __entry->curr_res = tic->t_curr_res; | |
968 | __entry->unit_res = tic->t_unit_res; | |
969 | __entry->flags = tic->t_flags; | |
28496968 CH |
970 | __entry->reserveq = list_empty(&log->l_reserve_head.waiters); |
971 | __entry->writeq = list_empty(&log->l_write_head.waiters); | |
972 | xlog_crack_grant_head(&log->l_reserve_head.grant, | |
a69ed03c DC |
973 | &__entry->grant_reserve_cycle, |
974 | &__entry->grant_reserve_bytes); | |
28496968 | 975 | xlog_crack_grant_head(&log->l_write_head.grant, |
a69ed03c DC |
976 | &__entry->grant_write_cycle, |
977 | &__entry->grant_write_bytes); | |
ea9a4888 CH |
978 | __entry->curr_cycle = log->l_curr_cycle; |
979 | __entry->curr_block = log->l_curr_block; | |
1c3cb9ec | 980 | __entry->tail_lsn = atomic64_read(&log->l_tail_lsn); |
ea9a4888 | 981 | ), |
710b1e2c | 982 | TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u " |
10547941 DC |
983 | "t_unit_res %u t_flags %s reserveq %s " |
984 | "writeq %s grant_reserve_cycle %d " | |
ea9a4888 CH |
985 | "grant_reserve_bytes %d grant_write_cycle %d " |
986 | "grant_write_bytes %d curr_cycle %d curr_block %d " | |
987 | "tail_cycle %d tail_block %d", | |
988 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
ea9a4888 CH |
989 | __entry->ocnt, |
990 | __entry->cnt, | |
991 | __entry->curr_res, | |
992 | __entry->unit_res, | |
993 | __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS), | |
10547941 DC |
994 | __entry->reserveq ? "empty" : "active", |
995 | __entry->writeq ? "empty" : "active", | |
ea9a4888 CH |
996 | __entry->grant_reserve_cycle, |
997 | __entry->grant_reserve_bytes, | |
998 | __entry->grant_write_cycle, | |
999 | __entry->grant_write_bytes, | |
1000 | __entry->curr_cycle, | |
1001 | __entry->curr_block, | |
1002 | CYCLE_LSN(__entry->tail_lsn), | |
1003 | BLOCK_LSN(__entry->tail_lsn) | |
1004 | ) | |
1005 | ) | |
0b1b213f | 1006 | |
ea9a4888 CH |
1007 | #define DEFINE_LOGGRANT_EVENT(name) \ |
1008 | DEFINE_EVENT(xfs_loggrant_class, name, \ | |
ad223e60 | 1009 | TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \ |
ea9a4888 | 1010 | TP_ARGS(log, tic)) |
0b1b213f CH |
1011 | DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm); |
1012 | DEFINE_LOGGRANT_EVENT(xfs_log_done_perm); | |
0b1b213f | 1013 | DEFINE_LOGGRANT_EVENT(xfs_log_umount_write); |
9f9c19ec CH |
1014 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep); |
1015 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake); | |
3f16b985 | 1016 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up); |
9006fb91 CH |
1017 | DEFINE_LOGGRANT_EVENT(xfs_log_reserve); |
1018 | DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit); | |
1019 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant); | |
1020 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit); | |
0b1b213f CH |
1021 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter); |
1022 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit); | |
1023 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub); | |
1024 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter); | |
1025 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit); | |
1026 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub); | |
1027 | ||
9e4c109a CH |
1028 | DECLARE_EVENT_CLASS(xfs_log_item_class, |
1029 | TP_PROTO(struct xfs_log_item *lip), | |
1030 | TP_ARGS(lip), | |
1031 | TP_STRUCT__entry( | |
1032 | __field(dev_t, dev) | |
1033 | __field(void *, lip) | |
1034 | __field(uint, type) | |
1035 | __field(uint, flags) | |
1036 | __field(xfs_lsn_t, lsn) | |
1037 | ), | |
1038 | TP_fast_assign( | |
1039 | __entry->dev = lip->li_mountp->m_super->s_dev; | |
1040 | __entry->lip = lip; | |
1041 | __entry->type = lip->li_type; | |
1042 | __entry->flags = lip->li_flags; | |
1043 | __entry->lsn = lip->li_lsn; | |
1044 | ), | |
1045 | TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s", | |
1046 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1047 | __entry->lip, | |
1048 | CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn), | |
1049 | __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), | |
1050 | __print_flags(__entry->flags, "|", XFS_LI_FLAGS)) | |
1051 | ) | |
1052 | ||
14c26c6a | 1053 | TRACE_EVENT(xfs_log_force, |
9f27889f CM |
1054 | TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip), |
1055 | TP_ARGS(mp, lsn, caller_ip), | |
14c26c6a DC |
1056 | TP_STRUCT__entry( |
1057 | __field(dev_t, dev) | |
1058 | __field(xfs_lsn_t, lsn) | |
9f27889f | 1059 | __field(unsigned long, caller_ip) |
14c26c6a DC |
1060 | ), |
1061 | TP_fast_assign( | |
1062 | __entry->dev = mp->m_super->s_dev; | |
1063 | __entry->lsn = lsn; | |
9f27889f | 1064 | __entry->caller_ip = caller_ip; |
14c26c6a | 1065 | ), |
9f27889f | 1066 | TP_printk("dev %d:%d lsn 0x%llx caller %ps", |
14c26c6a | 1067 | MAJOR(__entry->dev), MINOR(__entry->dev), |
9f27889f | 1068 | __entry->lsn, (void *)__entry->caller_ip) |
14c26c6a DC |
1069 | ) |
1070 | ||
9e4c109a CH |
1071 | #define DEFINE_LOG_ITEM_EVENT(name) \ |
1072 | DEFINE_EVENT(xfs_log_item_class, name, \ | |
1073 | TP_PROTO(struct xfs_log_item *lip), \ | |
1074 | TP_ARGS(lip)) | |
1075 | DEFINE_LOG_ITEM_EVENT(xfs_ail_push); | |
9e4c109a CH |
1076 | DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned); |
1077 | DEFINE_LOG_ITEM_EVENT(xfs_ail_locked); | |
43ff2122 | 1078 | DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing); |
9e4c109a | 1079 | |
750b9c90 DC |
1080 | DECLARE_EVENT_CLASS(xfs_ail_class, |
1081 | TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), | |
1082 | TP_ARGS(lip, old_lsn, new_lsn), | |
1083 | TP_STRUCT__entry( | |
1084 | __field(dev_t, dev) | |
1085 | __field(void *, lip) | |
1086 | __field(uint, type) | |
1087 | __field(uint, flags) | |
1088 | __field(xfs_lsn_t, old_lsn) | |
1089 | __field(xfs_lsn_t, new_lsn) | |
1090 | ), | |
1091 | TP_fast_assign( | |
1092 | __entry->dev = lip->li_mountp->m_super->s_dev; | |
1093 | __entry->lip = lip; | |
1094 | __entry->type = lip->li_type; | |
1095 | __entry->flags = lip->li_flags; | |
1096 | __entry->old_lsn = old_lsn; | |
1097 | __entry->new_lsn = new_lsn; | |
1098 | ), | |
1099 | TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s", | |
1100 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1101 | __entry->lip, | |
1102 | CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn), | |
1103 | CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn), | |
1104 | __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), | |
1105 | __print_flags(__entry->flags, "|", XFS_LI_FLAGS)) | |
1106 | ) | |
1107 | ||
1108 | #define DEFINE_AIL_EVENT(name) \ | |
1109 | DEFINE_EVENT(xfs_ail_class, name, \ | |
1110 | TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \ | |
1111 | TP_ARGS(lip, old_lsn, new_lsn)) | |
1112 | DEFINE_AIL_EVENT(xfs_ail_insert); | |
1113 | DEFINE_AIL_EVENT(xfs_ail_move); | |
1114 | DEFINE_AIL_EVENT(xfs_ail_delete); | |
1115 | ||
1116 | TRACE_EVENT(xfs_log_assign_tail_lsn, | |
1117 | TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn), | |
1118 | TP_ARGS(log, new_lsn), | |
1119 | TP_STRUCT__entry( | |
1120 | __field(dev_t, dev) | |
1121 | __field(xfs_lsn_t, new_lsn) | |
1122 | __field(xfs_lsn_t, old_lsn) | |
1123 | __field(xfs_lsn_t, last_sync_lsn) | |
1124 | ), | |
1125 | TP_fast_assign( | |
1126 | __entry->dev = log->l_mp->m_super->s_dev; | |
1127 | __entry->new_lsn = new_lsn; | |
1128 | __entry->old_lsn = atomic64_read(&log->l_tail_lsn); | |
1129 | __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn); | |
1130 | ), | |
1131 | TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d", | |
1132 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1133 | CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn), | |
1134 | CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn), | |
1135 | CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn)) | |
1136 | ) | |
9e4c109a | 1137 | |
f8adb4d5 | 1138 | DECLARE_EVENT_CLASS(xfs_file_class, |
3176c3e0 CH |
1139 | TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), |
1140 | TP_ARGS(ip, count, offset), | |
f8adb4d5 LZ |
1141 | TP_STRUCT__entry( |
1142 | __field(dev_t, dev) | |
1143 | __field(xfs_ino_t, ino) | |
1144 | __field(xfs_fsize_t, size) | |
f8adb4d5 LZ |
1145 | __field(loff_t, offset) |
1146 | __field(size_t, count) | |
f8adb4d5 LZ |
1147 | ), |
1148 | TP_fast_assign( | |
1149 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1150 | __entry->ino = ip->i_ino; | |
1151 | __entry->size = ip->i_d.di_size; | |
f8adb4d5 LZ |
1152 | __entry->offset = offset; |
1153 | __entry->count = count; | |
f8adb4d5 | 1154 | ), |
3176c3e0 | 1155 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx", |
f8adb4d5 LZ |
1156 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1157 | __entry->ino, | |
1158 | __entry->size, | |
f8adb4d5 | 1159 | __entry->offset, |
3176c3e0 | 1160 | __entry->count) |
0b1b213f | 1161 | ) |
f8adb4d5 LZ |
1162 | |
1163 | #define DEFINE_RW_EVENT(name) \ | |
1164 | DEFINE_EVENT(xfs_file_class, name, \ | |
3176c3e0 CH |
1165 | TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \ |
1166 | TP_ARGS(ip, count, offset)) | |
1167 | DEFINE_RW_EVENT(xfs_file_buffered_read); | |
1168 | DEFINE_RW_EVENT(xfs_file_direct_read); | |
16d4d435 | 1169 | DEFINE_RW_EVENT(xfs_file_dax_read); |
0b1b213f CH |
1170 | DEFINE_RW_EVENT(xfs_file_buffered_write); |
1171 | DEFINE_RW_EVENT(xfs_file_direct_write); | |
16d4d435 | 1172 | DEFINE_RW_EVENT(xfs_file_dax_write); |
0b1b213f | 1173 | |
f8adb4d5 | 1174 | DECLARE_EVENT_CLASS(xfs_page_class, |
34097dfe LC |
1175 | TP_PROTO(struct inode *inode, struct page *page, unsigned long off, |
1176 | unsigned int len), | |
1177 | TP_ARGS(inode, page, off, len), | |
f8adb4d5 LZ |
1178 | TP_STRUCT__entry( |
1179 | __field(dev_t, dev) | |
1180 | __field(xfs_ino_t, ino) | |
1181 | __field(pgoff_t, pgoff) | |
1182 | __field(loff_t, size) | |
1183 | __field(unsigned long, offset) | |
34097dfe | 1184 | __field(unsigned int, length) |
f8adb4d5 | 1185 | __field(int, delalloc) |
f8adb4d5 LZ |
1186 | __field(int, unwritten) |
1187 | ), | |
1188 | TP_fast_assign( | |
20cb52eb | 1189 | int delalloc = -1, unwritten = -1; |
f8adb4d5 LZ |
1190 | |
1191 | if (page_has_buffers(page)) | |
20cb52eb | 1192 | xfs_count_page_state(page, &delalloc, &unwritten); |
f8adb4d5 LZ |
1193 | __entry->dev = inode->i_sb->s_dev; |
1194 | __entry->ino = XFS_I(inode)->i_ino; | |
1195 | __entry->pgoff = page_offset(page); | |
1196 | __entry->size = i_size_read(inode); | |
1197 | __entry->offset = off; | |
34097dfe | 1198 | __entry->length = len; |
f8adb4d5 | 1199 | __entry->delalloc = delalloc; |
f8adb4d5 LZ |
1200 | __entry->unwritten = unwritten; |
1201 | ), | |
1202 | TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx " | |
34097dfe | 1203 | "length %x delalloc %d unwritten %d", |
f8adb4d5 LZ |
1204 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1205 | __entry->ino, | |
1206 | __entry->pgoff, | |
1207 | __entry->size, | |
1208 | __entry->offset, | |
34097dfe | 1209 | __entry->length, |
f8adb4d5 | 1210 | __entry->delalloc, |
f8adb4d5 | 1211 | __entry->unwritten) |
0b1b213f | 1212 | ) |
f8adb4d5 LZ |
1213 | |
1214 | #define DEFINE_PAGE_EVENT(name) \ | |
1215 | DEFINE_EVENT(xfs_page_class, name, \ | |
34097dfe LC |
1216 | TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \ |
1217 | unsigned int len), \ | |
1218 | TP_ARGS(inode, page, off, len)) | |
0b1b213f CH |
1219 | DEFINE_PAGE_EVENT(xfs_writepage); |
1220 | DEFINE_PAGE_EVENT(xfs_releasepage); | |
1221 | DEFINE_PAGE_EVENT(xfs_invalidatepage); | |
1222 | ||
121e213e DC |
1223 | DECLARE_EVENT_CLASS(xfs_readpage_class, |
1224 | TP_PROTO(struct inode *inode, int nr_pages), | |
1225 | TP_ARGS(inode, nr_pages), | |
1226 | TP_STRUCT__entry( | |
1227 | __field(dev_t, dev) | |
1228 | __field(xfs_ino_t, ino) | |
1229 | __field(int, nr_pages) | |
1230 | ), | |
1231 | TP_fast_assign( | |
1232 | __entry->dev = inode->i_sb->s_dev; | |
1233 | __entry->ino = inode->i_ino; | |
1234 | __entry->nr_pages = nr_pages; | |
1235 | ), | |
1236 | TP_printk("dev %d:%d ino 0x%llx nr_pages %d", | |
1237 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1238 | __entry->ino, | |
1239 | __entry->nr_pages) | |
1240 | ) | |
1241 | ||
1242 | #define DEFINE_READPAGE_EVENT(name) \ | |
1243 | DEFINE_EVENT(xfs_readpage_class, name, \ | |
1244 | TP_PROTO(struct inode *inode, int nr_pages), \ | |
1245 | TP_ARGS(inode, nr_pages)) | |
1246 | DEFINE_READPAGE_EVENT(xfs_vm_readpage); | |
1247 | DEFINE_READPAGE_EVENT(xfs_vm_readpages); | |
1248 | ||
a206c817 | 1249 | DECLARE_EVENT_CLASS(xfs_imap_class, |
f8adb4d5 | 1250 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, |
a206c817 CH |
1251 | int type, struct xfs_bmbt_irec *irec), |
1252 | TP_ARGS(ip, offset, count, type, irec), | |
f8adb4d5 LZ |
1253 | TP_STRUCT__entry( |
1254 | __field(dev_t, dev) | |
1255 | __field(xfs_ino_t, ino) | |
1256 | __field(loff_t, size) | |
f8adb4d5 LZ |
1257 | __field(loff_t, offset) |
1258 | __field(size_t, count) | |
a206c817 | 1259 | __field(int, type) |
f8adb4d5 LZ |
1260 | __field(xfs_fileoff_t, startoff) |
1261 | __field(xfs_fsblock_t, startblock) | |
1262 | __field(xfs_filblks_t, blockcount) | |
1263 | ), | |
1264 | TP_fast_assign( | |
1265 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1266 | __entry->ino = ip->i_ino; | |
1267 | __entry->size = ip->i_d.di_size; | |
f8adb4d5 LZ |
1268 | __entry->offset = offset; |
1269 | __entry->count = count; | |
a206c817 | 1270 | __entry->type = type; |
f8adb4d5 LZ |
1271 | __entry->startoff = irec ? irec->br_startoff : 0; |
1272 | __entry->startblock = irec ? irec->br_startblock : 0; | |
1273 | __entry->blockcount = irec ? irec->br_blockcount : 0; | |
1274 | ), | |
2813d682 CH |
1275 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd " |
1276 | "type %s startoff 0x%llx startblock %lld blockcount 0x%llx", | |
f8adb4d5 LZ |
1277 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1278 | __entry->ino, | |
1279 | __entry->size, | |
f8adb4d5 LZ |
1280 | __entry->offset, |
1281 | __entry->count, | |
a206c817 | 1282 | __print_symbolic(__entry->type, XFS_IO_TYPES), |
f8adb4d5 | 1283 | __entry->startoff, |
c8ce540d | 1284 | (int64_t)__entry->startblock, |
f8adb4d5 | 1285 | __entry->blockcount) |
0b1b213f | 1286 | ) |
f8adb4d5 LZ |
1287 | |
1288 | #define DEFINE_IOMAP_EVENT(name) \ | |
a206c817 | 1289 | DEFINE_EVENT(xfs_imap_class, name, \ |
f8adb4d5 | 1290 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \ |
a206c817 CH |
1291 | int type, struct xfs_bmbt_irec *irec), \ |
1292 | TP_ARGS(ip, offset, count, type, irec)) | |
1293 | DEFINE_IOMAP_EVENT(xfs_map_blocks_found); | |
1294 | DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc); | |
1295 | DEFINE_IOMAP_EVENT(xfs_get_blocks_found); | |
1296 | DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc); | |
273dda76 | 1297 | DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct); |
68a9f5e7 CH |
1298 | DEFINE_IOMAP_EVENT(xfs_iomap_alloc); |
1299 | DEFINE_IOMAP_EVENT(xfs_iomap_found); | |
0b1b213f | 1300 | |
f8adb4d5 LZ |
1301 | DECLARE_EVENT_CLASS(xfs_simple_io_class, |
1302 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), | |
1303 | TP_ARGS(ip, offset, count), | |
1304 | TP_STRUCT__entry( | |
1305 | __field(dev_t, dev) | |
1306 | __field(xfs_ino_t, ino) | |
55fb25d5 DC |
1307 | __field(loff_t, isize) |
1308 | __field(loff_t, disize) | |
f8adb4d5 LZ |
1309 | __field(loff_t, offset) |
1310 | __field(size_t, count) | |
1311 | ), | |
1312 | TP_fast_assign( | |
1313 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1314 | __entry->ino = ip->i_ino; | |
ce7ae151 | 1315 | __entry->isize = VFS_I(ip)->i_size; |
55fb25d5 | 1316 | __entry->disize = ip->i_d.di_size; |
f8adb4d5 LZ |
1317 | __entry->offset = offset; |
1318 | __entry->count = count; | |
1319 | ), | |
2813d682 | 1320 | TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx " |
f8adb4d5 LZ |
1321 | "offset 0x%llx count %zd", |
1322 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1323 | __entry->ino, | |
55fb25d5 DC |
1324 | __entry->isize, |
1325 | __entry->disize, | |
f8adb4d5 LZ |
1326 | __entry->offset, |
1327 | __entry->count) | |
0b1b213f | 1328 | ); |
f8adb4d5 LZ |
1329 | |
1330 | #define DEFINE_SIMPLE_IO_EVENT(name) \ | |
1331 | DEFINE_EVENT(xfs_simple_io_class, name, \ | |
1332 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \ | |
1333 | TP_ARGS(ip, offset, count)) | |
0b1b213f CH |
1334 | DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc); |
1335 | DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); | |
a206c817 | 1336 | DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound); |
55fb25d5 | 1337 | DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize); |
0a50f162 | 1338 | DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof); |
273dda76 CH |
1339 | DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write); |
1340 | DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten); | |
1341 | DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append); | |
0b1b213f | 1342 | |
ea9a4888 CH |
1343 | DECLARE_EVENT_CLASS(xfs_itrunc_class, |
1344 | TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), | |
1345 | TP_ARGS(ip, new_size), | |
1346 | TP_STRUCT__entry( | |
1347 | __field(dev_t, dev) | |
1348 | __field(xfs_ino_t, ino) | |
1349 | __field(xfs_fsize_t, size) | |
1350 | __field(xfs_fsize_t, new_size) | |
1351 | ), | |
1352 | TP_fast_assign( | |
1353 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1354 | __entry->ino = ip->i_ino; | |
1355 | __entry->size = ip->i_d.di_size; | |
1356 | __entry->new_size = new_size; | |
1357 | ), | |
1358 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx", | |
1359 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1360 | __entry->ino, | |
1361 | __entry->size, | |
1362 | __entry->new_size) | |
1363 | ) | |
1364 | ||
0b1b213f | 1365 | #define DEFINE_ITRUNC_EVENT(name) \ |
ea9a4888 | 1366 | DEFINE_EVENT(xfs_itrunc_class, name, \ |
0b1b213f | 1367 | TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \ |
ea9a4888 | 1368 | TP_ARGS(ip, new_size)) |
673e8e59 CH |
1369 | DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start); |
1370 | DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end); | |
0b1b213f CH |
1371 | |
1372 | TRACE_EVENT(xfs_pagecache_inval, | |
1373 | TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish), | |
1374 | TP_ARGS(ip, start, finish), | |
1375 | TP_STRUCT__entry( | |
1376 | __field(dev_t, dev) | |
1377 | __field(xfs_ino_t, ino) | |
1378 | __field(xfs_fsize_t, size) | |
1379 | __field(xfs_off_t, start) | |
1380 | __field(xfs_off_t, finish) | |
1381 | ), | |
1382 | TP_fast_assign( | |
1383 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1384 | __entry->ino = ip->i_ino; | |
1385 | __entry->size = ip->i_d.di_size; | |
1386 | __entry->start = start; | |
1387 | __entry->finish = finish; | |
1388 | ), | |
1389 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx", | |
1390 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1391 | __entry->ino, | |
1392 | __entry->size, | |
1393 | __entry->start, | |
1394 | __entry->finish) | |
1395 | ); | |
1396 | ||
1397 | TRACE_EVENT(xfs_bunmap, | |
1398 | TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len, | |
1399 | int flags, unsigned long caller_ip), | |
1400 | TP_ARGS(ip, bno, len, flags, caller_ip), | |
1401 | TP_STRUCT__entry( | |
1402 | __field(dev_t, dev) | |
1403 | __field(xfs_ino_t, ino) | |
1404 | __field(xfs_fsize_t, size) | |
1405 | __field(xfs_fileoff_t, bno) | |
1406 | __field(xfs_filblks_t, len) | |
1407 | __field(unsigned long, caller_ip) | |
1408 | __field(int, flags) | |
1409 | ), | |
1410 | TP_fast_assign( | |
1411 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1412 | __entry->ino = ip->i_ino; | |
1413 | __entry->size = ip->i_d.di_size; | |
1414 | __entry->bno = bno; | |
1415 | __entry->len = len; | |
1416 | __entry->caller_ip = caller_ip; | |
1417 | __entry->flags = flags; | |
1418 | ), | |
1419 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx" | |
65dd297a | 1420 | "flags %s caller %ps", |
0b1b213f CH |
1421 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1422 | __entry->ino, | |
1423 | __entry->size, | |
1424 | __entry->bno, | |
1425 | __entry->len, | |
1426 | __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS), | |
1427 | (void *)__entry->caller_ip) | |
1428 | ||
1429 | ); | |
1430 | ||
4ecbfe63 | 1431 | DECLARE_EVENT_CLASS(xfs_extent_busy_class, |
0b1b213f | 1432 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
ed3b4d6c DC |
1433 | xfs_agblock_t agbno, xfs_extlen_t len), |
1434 | TP_ARGS(mp, agno, agbno, len), | |
0b1b213f CH |
1435 | TP_STRUCT__entry( |
1436 | __field(dev_t, dev) | |
1437 | __field(xfs_agnumber_t, agno) | |
ed3b4d6c DC |
1438 | __field(xfs_agblock_t, agbno) |
1439 | __field(xfs_extlen_t, len) | |
0b1b213f CH |
1440 | ), |
1441 | TP_fast_assign( | |
1442 | __entry->dev = mp->m_super->s_dev; | |
1443 | __entry->agno = agno; | |
ed3b4d6c DC |
1444 | __entry->agbno = agbno; |
1445 | __entry->len = len; | |
0b1b213f | 1446 | ), |
ed3b4d6c | 1447 | TP_printk("dev %d:%d agno %u agbno %u len %u", |
0b1b213f CH |
1448 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1449 | __entry->agno, | |
ed3b4d6c DC |
1450 | __entry->agbno, |
1451 | __entry->len) | |
0b1b213f | 1452 | ); |
97d3ac75 | 1453 | #define DEFINE_BUSY_EVENT(name) \ |
4ecbfe63 | 1454 | DEFINE_EVENT(xfs_extent_busy_class, name, \ |
97d3ac75 CH |
1455 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
1456 | xfs_agblock_t agbno, xfs_extlen_t len), \ | |
1457 | TP_ARGS(mp, agno, agbno, len)) | |
4ecbfe63 DC |
1458 | DEFINE_BUSY_EVENT(xfs_extent_busy); |
1459 | DEFINE_BUSY_EVENT(xfs_extent_busy_enomem); | |
1460 | DEFINE_BUSY_EVENT(xfs_extent_busy_force); | |
1461 | DEFINE_BUSY_EVENT(xfs_extent_busy_reuse); | |
1462 | DEFINE_BUSY_EVENT(xfs_extent_busy_clear); | |
ed3b4d6c | 1463 | |
4ecbfe63 | 1464 | TRACE_EVENT(xfs_extent_busy_trim, |
e26f0501 CH |
1465 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
1466 | xfs_agblock_t agbno, xfs_extlen_t len, | |
1467 | xfs_agblock_t tbno, xfs_extlen_t tlen), | |
1468 | TP_ARGS(mp, agno, agbno, len, tbno, tlen), | |
1469 | TP_STRUCT__entry( | |
1470 | __field(dev_t, dev) | |
1471 | __field(xfs_agnumber_t, agno) | |
1472 | __field(xfs_agblock_t, agbno) | |
1473 | __field(xfs_extlen_t, len) | |
1474 | __field(xfs_agblock_t, tbno) | |
1475 | __field(xfs_extlen_t, tlen) | |
1476 | ), | |
1477 | TP_fast_assign( | |
1478 | __entry->dev = mp->m_super->s_dev; | |
1479 | __entry->agno = agno; | |
1480 | __entry->agbno = agbno; | |
1481 | __entry->len = len; | |
1482 | __entry->tbno = tbno; | |
1483 | __entry->tlen = tlen; | |
1484 | ), | |
1485 | TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u", | |
1486 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1487 | __entry->agno, | |
1488 | __entry->agbno, | |
1489 | __entry->len, | |
1490 | __entry->tbno, | |
1491 | __entry->tlen) | |
1492 | ); | |
1493 | ||
0b1b213f CH |
1494 | TRACE_EVENT(xfs_agf, |
1495 | TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, | |
1496 | unsigned long caller_ip), | |
1497 | TP_ARGS(mp, agf, flags, caller_ip), | |
1498 | TP_STRUCT__entry( | |
1499 | __field(dev_t, dev) | |
1500 | __field(xfs_agnumber_t, agno) | |
1501 | __field(int, flags) | |
1502 | __field(__u32, length) | |
1503 | __field(__u32, bno_root) | |
1504 | __field(__u32, cnt_root) | |
1505 | __field(__u32, bno_level) | |
1506 | __field(__u32, cnt_level) | |
1507 | __field(__u32, flfirst) | |
1508 | __field(__u32, fllast) | |
1509 | __field(__u32, flcount) | |
1510 | __field(__u32, freeblks) | |
1511 | __field(__u32, longest) | |
1512 | __field(unsigned long, caller_ip) | |
1513 | ), | |
1514 | TP_fast_assign( | |
1515 | __entry->dev = mp->m_super->s_dev; | |
1516 | __entry->agno = be32_to_cpu(agf->agf_seqno), | |
1517 | __entry->flags = flags; | |
1518 | __entry->length = be32_to_cpu(agf->agf_length), | |
1519 | __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]), | |
1520 | __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]), | |
1521 | __entry->bno_level = | |
1522 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]), | |
1523 | __entry->cnt_level = | |
1524 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]), | |
1525 | __entry->flfirst = be32_to_cpu(agf->agf_flfirst), | |
1526 | __entry->fllast = be32_to_cpu(agf->agf_fllast), | |
1527 | __entry->flcount = be32_to_cpu(agf->agf_flcount), | |
1528 | __entry->freeblks = be32_to_cpu(agf->agf_freeblks), | |
1529 | __entry->longest = be32_to_cpu(agf->agf_longest); | |
1530 | __entry->caller_ip = caller_ip; | |
1531 | ), | |
1532 | TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u " | |
1533 | "levels b %u c %u flfirst %u fllast %u flcount %u " | |
65dd297a | 1534 | "freeblks %u longest %u caller %ps", |
0b1b213f CH |
1535 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1536 | __entry->agno, | |
1537 | __print_flags(__entry->flags, "|", XFS_AGF_FLAGS), | |
1538 | __entry->length, | |
1539 | __entry->bno_root, | |
1540 | __entry->cnt_root, | |
1541 | __entry->bno_level, | |
1542 | __entry->cnt_level, | |
1543 | __entry->flfirst, | |
1544 | __entry->fllast, | |
1545 | __entry->flcount, | |
1546 | __entry->freeblks, | |
1547 | __entry->longest, | |
1548 | (void *)__entry->caller_ip) | |
1549 | ); | |
1550 | ||
1551 | TRACE_EVENT(xfs_free_extent, | |
1552 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, | |
3fd129b6 DW |
1553 | xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft, |
1554 | int haveright), | |
1555 | TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright), | |
0b1b213f CH |
1556 | TP_STRUCT__entry( |
1557 | __field(dev_t, dev) | |
1558 | __field(xfs_agnumber_t, agno) | |
1559 | __field(xfs_agblock_t, agbno) | |
1560 | __field(xfs_extlen_t, len) | |
3fd129b6 | 1561 | __field(int, resv) |
0b1b213f CH |
1562 | __field(int, haveleft) |
1563 | __field(int, haveright) | |
1564 | ), | |
1565 | TP_fast_assign( | |
1566 | __entry->dev = mp->m_super->s_dev; | |
1567 | __entry->agno = agno; | |
1568 | __entry->agbno = agbno; | |
1569 | __entry->len = len; | |
3fd129b6 | 1570 | __entry->resv = resv; |
0b1b213f CH |
1571 | __entry->haveleft = haveleft; |
1572 | __entry->haveright = haveright; | |
1573 | ), | |
3fd129b6 | 1574 | TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s", |
0b1b213f CH |
1575 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1576 | __entry->agno, | |
1577 | __entry->agbno, | |
1578 | __entry->len, | |
3fd129b6 | 1579 | __entry->resv, |
0b1b213f CH |
1580 | __entry->haveleft ? |
1581 | (__entry->haveright ? "both" : "left") : | |
1582 | (__entry->haveright ? "right" : "none")) | |
1583 | ||
1584 | ); | |
1585 | ||
ea9a4888 CH |
1586 | DECLARE_EVENT_CLASS(xfs_alloc_class, |
1587 | TP_PROTO(struct xfs_alloc_arg *args), | |
1588 | TP_ARGS(args), | |
1589 | TP_STRUCT__entry( | |
1590 | __field(dev_t, dev) | |
1591 | __field(xfs_agnumber_t, agno) | |
1592 | __field(xfs_agblock_t, agbno) | |
1593 | __field(xfs_extlen_t, minlen) | |
1594 | __field(xfs_extlen_t, maxlen) | |
1595 | __field(xfs_extlen_t, mod) | |
1596 | __field(xfs_extlen_t, prod) | |
1597 | __field(xfs_extlen_t, minleft) | |
1598 | __field(xfs_extlen_t, total) | |
1599 | __field(xfs_extlen_t, alignment) | |
1600 | __field(xfs_extlen_t, minalignslop) | |
1601 | __field(xfs_extlen_t, len) | |
1602 | __field(short, type) | |
1603 | __field(short, otype) | |
1604 | __field(char, wasdel) | |
1605 | __field(char, wasfromfl) | |
3fd129b6 | 1606 | __field(int, resv) |
292378ed | 1607 | __field(int, datatype) |
ea9a4888 CH |
1608 | __field(xfs_fsblock_t, firstblock) |
1609 | ), | |
1610 | TP_fast_assign( | |
1611 | __entry->dev = args->mp->m_super->s_dev; | |
1612 | __entry->agno = args->agno; | |
1613 | __entry->agbno = args->agbno; | |
1614 | __entry->minlen = args->minlen; | |
1615 | __entry->maxlen = args->maxlen; | |
1616 | __entry->mod = args->mod; | |
1617 | __entry->prod = args->prod; | |
1618 | __entry->minleft = args->minleft; | |
1619 | __entry->total = args->total; | |
1620 | __entry->alignment = args->alignment; | |
1621 | __entry->minalignslop = args->minalignslop; | |
1622 | __entry->len = args->len; | |
1623 | __entry->type = args->type; | |
1624 | __entry->otype = args->otype; | |
1625 | __entry->wasdel = args->wasdel; | |
1626 | __entry->wasfromfl = args->wasfromfl; | |
3fd129b6 | 1627 | __entry->resv = args->resv; |
292378ed | 1628 | __entry->datatype = args->datatype; |
ea9a4888 CH |
1629 | __entry->firstblock = args->firstblock; |
1630 | ), | |
1631 | TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u " | |
1632 | "prod %u minleft %u total %u alignment %u minalignslop %u " | |
3fd129b6 | 1633 | "len %u type %s otype %s wasdel %d wasfromfl %d resv %d " |
292378ed | 1634 | "datatype 0x%x firstblock 0x%llx", |
ea9a4888 CH |
1635 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1636 | __entry->agno, | |
1637 | __entry->agbno, | |
1638 | __entry->minlen, | |
1639 | __entry->maxlen, | |
1640 | __entry->mod, | |
1641 | __entry->prod, | |
1642 | __entry->minleft, | |
1643 | __entry->total, | |
1644 | __entry->alignment, | |
1645 | __entry->minalignslop, | |
1646 | __entry->len, | |
1647 | __print_symbolic(__entry->type, XFS_ALLOC_TYPES), | |
1648 | __print_symbolic(__entry->otype, XFS_ALLOC_TYPES), | |
1649 | __entry->wasdel, | |
1650 | __entry->wasfromfl, | |
3fd129b6 | 1651 | __entry->resv, |
292378ed | 1652 | __entry->datatype, |
1a18a294 | 1653 | (unsigned long long)__entry->firstblock) |
0b1b213f CH |
1654 | ) |
1655 | ||
ea9a4888 CH |
1656 | #define DEFINE_ALLOC_EVENT(name) \ |
1657 | DEFINE_EVENT(xfs_alloc_class, name, \ | |
1658 | TP_PROTO(struct xfs_alloc_arg *args), \ | |
1659 | TP_ARGS(args)) | |
0b1b213f | 1660 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_done); |
9f9baab3 | 1661 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound); |
0b1b213f CH |
1662 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_error); |
1663 | DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft); | |
1664 | DEFINE_ALLOC_EVENT(xfs_alloc_near_first); | |
1665 | DEFINE_ALLOC_EVENT(xfs_alloc_near_greater); | |
1666 | DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser); | |
1667 | DEFINE_ALLOC_EVENT(xfs_alloc_near_error); | |
e26f0501 CH |
1668 | DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry); |
1669 | DEFINE_ALLOC_EVENT(xfs_alloc_near_busy); | |
0b1b213f CH |
1670 | DEFINE_ALLOC_EVENT(xfs_alloc_size_neither); |
1671 | DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry); | |
1672 | DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft); | |
1673 | DEFINE_ALLOC_EVENT(xfs_alloc_size_done); | |
1674 | DEFINE_ALLOC_EVENT(xfs_alloc_size_error); | |
e26f0501 | 1675 | DEFINE_ALLOC_EVENT(xfs_alloc_size_busy); |
0b1b213f CH |
1676 | DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist); |
1677 | DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough); | |
1678 | DEFINE_ALLOC_EVENT(xfs_alloc_small_done); | |
1679 | DEFINE_ALLOC_EVENT(xfs_alloc_small_error); | |
1680 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs); | |
1681 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix); | |
1682 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp); | |
1683 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed); | |
1684 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed); | |
1685 | ||
5a5881cd | 1686 | DECLARE_EVENT_CLASS(xfs_da_class, |
ea9a4888 CH |
1687 | TP_PROTO(struct xfs_da_args *args), |
1688 | TP_ARGS(args), | |
1689 | TP_STRUCT__entry( | |
1690 | __field(dev_t, dev) | |
1691 | __field(xfs_ino_t, ino) | |
1692 | __dynamic_array(char, name, args->namelen) | |
1693 | __field(int, namelen) | |
1694 | __field(xfs_dahash_t, hashval) | |
1695 | __field(xfs_ino_t, inumber) | |
1696 | __field(int, op_flags) | |
1697 | ), | |
1698 | TP_fast_assign( | |
1699 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; | |
1700 | __entry->ino = args->dp->i_ino; | |
1701 | if (args->namelen) | |
1702 | memcpy(__get_str(name), args->name, args->namelen); | |
1703 | __entry->namelen = args->namelen; | |
1704 | __entry->hashval = args->hashval; | |
1705 | __entry->inumber = args->inumber; | |
1706 | __entry->op_flags = args->op_flags; | |
1707 | ), | |
1708 | TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x " | |
1709 | "inumber 0x%llx op_flags %s", | |
1710 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1711 | __entry->ino, | |
1712 | __entry->namelen, | |
1713 | __entry->namelen ? __get_str(name) : NULL, | |
1714 | __entry->namelen, | |
1715 | __entry->hashval, | |
1716 | __entry->inumber, | |
1717 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS)) | |
1718 | ) | |
1719 | ||
1720 | #define DEFINE_DIR2_EVENT(name) \ | |
5a5881cd | 1721 | DEFINE_EVENT(xfs_da_class, name, \ |
0b1b213f | 1722 | TP_PROTO(struct xfs_da_args *args), \ |
ea9a4888 CH |
1723 | TP_ARGS(args)) |
1724 | DEFINE_DIR2_EVENT(xfs_dir2_sf_addname); | |
1725 | DEFINE_DIR2_EVENT(xfs_dir2_sf_create); | |
1726 | DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup); | |
1727 | DEFINE_DIR2_EVENT(xfs_dir2_sf_replace); | |
1728 | DEFINE_DIR2_EVENT(xfs_dir2_sf_removename); | |
1729 | DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4); | |
1730 | DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8); | |
1731 | DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block); | |
1732 | DEFINE_DIR2_EVENT(xfs_dir2_block_addname); | |
1733 | DEFINE_DIR2_EVENT(xfs_dir2_block_lookup); | |
1734 | DEFINE_DIR2_EVENT(xfs_dir2_block_replace); | |
1735 | DEFINE_DIR2_EVENT(xfs_dir2_block_removename); | |
1736 | DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf); | |
1737 | DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf); | |
1738 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname); | |
1739 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup); | |
1740 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace); | |
1741 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename); | |
1742 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block); | |
1743 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node); | |
1744 | DEFINE_DIR2_EVENT(xfs_dir2_node_addname); | |
1745 | DEFINE_DIR2_EVENT(xfs_dir2_node_lookup); | |
1746 | DEFINE_DIR2_EVENT(xfs_dir2_node_replace); | |
1747 | DEFINE_DIR2_EVENT(xfs_dir2_node_removename); | |
1748 | DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf); | |
1749 | ||
ee73259b DC |
1750 | DECLARE_EVENT_CLASS(xfs_attr_class, |
1751 | TP_PROTO(struct xfs_da_args *args), | |
1752 | TP_ARGS(args), | |
1753 | TP_STRUCT__entry( | |
1754 | __field(dev_t, dev) | |
1755 | __field(xfs_ino_t, ino) | |
1756 | __dynamic_array(char, name, args->namelen) | |
1757 | __field(int, namelen) | |
1758 | __field(int, valuelen) | |
1759 | __field(xfs_dahash_t, hashval) | |
1760 | __field(int, op_flags) | |
1761 | ), | |
1762 | TP_fast_assign( | |
1763 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; | |
1764 | __entry->ino = args->dp->i_ino; | |
1765 | if (args->namelen) | |
1766 | memcpy(__get_str(name), args->name, args->namelen); | |
1767 | __entry->namelen = args->namelen; | |
1768 | __entry->valuelen = args->valuelen; | |
1769 | __entry->hashval = args->hashval; | |
1770 | __entry->op_flags = args->op_flags; | |
1771 | ), | |
1772 | TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d " | |
1773 | "hashval 0x%x op_flags %s", | |
1774 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1775 | __entry->ino, | |
1776 | __entry->namelen, | |
1777 | __entry->namelen ? __get_str(name) : NULL, | |
1778 | __entry->namelen, | |
1779 | __entry->valuelen, | |
1780 | __entry->hashval, | |
1781 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS)) | |
1782 | ) | |
1783 | ||
5a5881cd | 1784 | #define DEFINE_ATTR_EVENT(name) \ |
ee73259b | 1785 | DEFINE_EVENT(xfs_attr_class, name, \ |
5a5881cd DC |
1786 | TP_PROTO(struct xfs_da_args *args), \ |
1787 | TP_ARGS(args)) | |
1788 | DEFINE_ATTR_EVENT(xfs_attr_sf_add); | |
1789 | DEFINE_ATTR_EVENT(xfs_attr_sf_addname); | |
1790 | DEFINE_ATTR_EVENT(xfs_attr_sf_create); | |
1791 | DEFINE_ATTR_EVENT(xfs_attr_sf_lookup); | |
1792 | DEFINE_ATTR_EVENT(xfs_attr_sf_remove); | |
5a5881cd DC |
1793 | DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf); |
1794 | ||
1795 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add); | |
1796 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old); | |
1797 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new); | |
ee73259b | 1798 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work); |
5a5881cd DC |
1799 | DEFINE_ATTR_EVENT(xfs_attr_leaf_addname); |
1800 | DEFINE_ATTR_EVENT(xfs_attr_leaf_create); | |
ee73259b DC |
1801 | DEFINE_ATTR_EVENT(xfs_attr_leaf_compact); |
1802 | DEFINE_ATTR_EVENT(xfs_attr_leaf_get); | |
5a5881cd DC |
1803 | DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup); |
1804 | DEFINE_ATTR_EVENT(xfs_attr_leaf_replace); | |
ee73259b | 1805 | DEFINE_ATTR_EVENT(xfs_attr_leaf_remove); |
5a5881cd DC |
1806 | DEFINE_ATTR_EVENT(xfs_attr_leaf_removename); |
1807 | DEFINE_ATTR_EVENT(xfs_attr_leaf_split); | |
1808 | DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before); | |
1809 | DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after); | |
1810 | DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag); | |
1811 | DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag); | |
1812 | DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags); | |
1813 | DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf); | |
1814 | DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node); | |
1815 | DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance); | |
1816 | DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance); | |
ee73259b | 1817 | DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall); |
5a5881cd DC |
1818 | |
1819 | DEFINE_ATTR_EVENT(xfs_attr_node_addname); | |
ee73259b | 1820 | DEFINE_ATTR_EVENT(xfs_attr_node_get); |
5a5881cd DC |
1821 | DEFINE_ATTR_EVENT(xfs_attr_node_replace); |
1822 | DEFINE_ATTR_EVENT(xfs_attr_node_removename); | |
1823 | ||
ee73259b DC |
1824 | DEFINE_ATTR_EVENT(xfs_attr_fillstate); |
1825 | DEFINE_ATTR_EVENT(xfs_attr_refillstate); | |
1826 | ||
1827 | DEFINE_ATTR_EVENT(xfs_attr_rmtval_get); | |
1828 | DEFINE_ATTR_EVENT(xfs_attr_rmtval_set); | |
1829 | DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove); | |
1830 | ||
5a5881cd DC |
1831 | #define DEFINE_DA_EVENT(name) \ |
1832 | DEFINE_EVENT(xfs_da_class, name, \ | |
1833 | TP_PROTO(struct xfs_da_args *args), \ | |
1834 | TP_ARGS(args)) | |
1835 | DEFINE_DA_EVENT(xfs_da_split); | |
1836 | DEFINE_DA_EVENT(xfs_da_join); | |
1837 | DEFINE_DA_EVENT(xfs_da_link_before); | |
1838 | DEFINE_DA_EVENT(xfs_da_link_after); | |
1839 | DEFINE_DA_EVENT(xfs_da_unlink_back); | |
1840 | DEFINE_DA_EVENT(xfs_da_unlink_forward); | |
1841 | DEFINE_DA_EVENT(xfs_da_root_split); | |
1842 | DEFINE_DA_EVENT(xfs_da_root_join); | |
1843 | DEFINE_DA_EVENT(xfs_da_node_add); | |
1844 | DEFINE_DA_EVENT(xfs_da_node_create); | |
1845 | DEFINE_DA_EVENT(xfs_da_node_split); | |
1846 | DEFINE_DA_EVENT(xfs_da_node_remove); | |
1847 | DEFINE_DA_EVENT(xfs_da_node_rebalance); | |
1848 | DEFINE_DA_EVENT(xfs_da_node_unbalance); | |
ee73259b | 1849 | DEFINE_DA_EVENT(xfs_da_node_toosmall); |
5a5881cd DC |
1850 | DEFINE_DA_EVENT(xfs_da_swap_lastblock); |
1851 | DEFINE_DA_EVENT(xfs_da_grow_inode); | |
1852 | DEFINE_DA_EVENT(xfs_da_shrink_inode); | |
ee73259b DC |
1853 | DEFINE_DA_EVENT(xfs_da_fixhashpath); |
1854 | DEFINE_DA_EVENT(xfs_da_path_shift); | |
5a5881cd | 1855 | |
ea9a4888 CH |
1856 | DECLARE_EVENT_CLASS(xfs_dir2_space_class, |
1857 | TP_PROTO(struct xfs_da_args *args, int idx), | |
1858 | TP_ARGS(args, idx), | |
1859 | TP_STRUCT__entry( | |
1860 | __field(dev_t, dev) | |
1861 | __field(xfs_ino_t, ino) | |
1862 | __field(int, op_flags) | |
1863 | __field(int, idx) | |
1864 | ), | |
1865 | TP_fast_assign( | |
1866 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; | |
1867 | __entry->ino = args->dp->i_ino; | |
1868 | __entry->op_flags = args->op_flags; | |
1869 | __entry->idx = idx; | |
1870 | ), | |
1871 | TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d", | |
1872 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1873 | __entry->ino, | |
1874 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), | |
1875 | __entry->idx) | |
0b1b213f | 1876 | ) |
0b1b213f | 1877 | |
ea9a4888 CH |
1878 | #define DEFINE_DIR2_SPACE_EVENT(name) \ |
1879 | DEFINE_EVENT(xfs_dir2_space_class, name, \ | |
0b1b213f | 1880 | TP_PROTO(struct xfs_da_args *args, int idx), \ |
ea9a4888 CH |
1881 | TP_ARGS(args, idx)) |
1882 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add); | |
1883 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove); | |
1884 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode); | |
1885 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode); | |
0b1b213f CH |
1886 | |
1887 | TRACE_EVENT(xfs_dir2_leafn_moveents, | |
1888 | TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count), | |
1889 | TP_ARGS(args, src_idx, dst_idx, count), | |
1890 | TP_STRUCT__entry( | |
1891 | __field(dev_t, dev) | |
1892 | __field(xfs_ino_t, ino) | |
1893 | __field(int, op_flags) | |
1894 | __field(int, src_idx) | |
1895 | __field(int, dst_idx) | |
1896 | __field(int, count) | |
1897 | ), | |
1898 | TP_fast_assign( | |
1899 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; | |
1900 | __entry->ino = args->dp->i_ino; | |
1901 | __entry->op_flags = args->op_flags; | |
1902 | __entry->src_idx = src_idx; | |
1903 | __entry->dst_idx = dst_idx; | |
1904 | __entry->count = count; | |
1905 | ), | |
1906 | TP_printk("dev %d:%d ino 0x%llx op_flags %s " | |
1907 | "src_idx %d dst_idx %d count %d", | |
1908 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1909 | __entry->ino, | |
1910 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), | |
1911 | __entry->src_idx, | |
1912 | __entry->dst_idx, | |
1913 | __entry->count) | |
1914 | ); | |
1915 | ||
3a85cd96 DC |
1916 | #define XFS_SWAPEXT_INODES \ |
1917 | { 0, "target" }, \ | |
1918 | { 1, "temp" } | |
1919 | ||
1920 | #define XFS_INODE_FORMAT_STR \ | |
1921 | { 0, "invalid" }, \ | |
1922 | { 1, "local" }, \ | |
1923 | { 2, "extent" }, \ | |
1924 | { 3, "btree" } | |
1925 | ||
1926 | DECLARE_EVENT_CLASS(xfs_swap_extent_class, | |
1927 | TP_PROTO(struct xfs_inode *ip, int which), | |
1928 | TP_ARGS(ip, which), | |
1929 | TP_STRUCT__entry( | |
1930 | __field(dev_t, dev) | |
1931 | __field(int, which) | |
1932 | __field(xfs_ino_t, ino) | |
1933 | __field(int, format) | |
1934 | __field(int, nex) | |
3a85cd96 DC |
1935 | __field(int, broot_size) |
1936 | __field(int, fork_off) | |
1937 | ), | |
1938 | TP_fast_assign( | |
1939 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1940 | __entry->which = which; | |
1941 | __entry->ino = ip->i_ino; | |
1942 | __entry->format = ip->i_d.di_format; | |
1943 | __entry->nex = ip->i_d.di_nextents; | |
3a85cd96 DC |
1944 | __entry->broot_size = ip->i_df.if_broot_bytes; |
1945 | __entry->fork_off = XFS_IFORK_BOFF(ip); | |
1946 | ), | |
1947 | TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, " | |
8096b1eb | 1948 | "broot size %d, fork offset %d", |
3a85cd96 DC |
1949 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1950 | __entry->ino, | |
1951 | __print_symbolic(__entry->which, XFS_SWAPEXT_INODES), | |
1952 | __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR), | |
1953 | __entry->nex, | |
3a85cd96 DC |
1954 | __entry->broot_size, |
1955 | __entry->fork_off) | |
1956 | ) | |
1957 | ||
1958 | #define DEFINE_SWAPEXT_EVENT(name) \ | |
1959 | DEFINE_EVENT(xfs_swap_extent_class, name, \ | |
1960 | TP_PROTO(struct xfs_inode *ip, int which), \ | |
1961 | TP_ARGS(ip, which)) | |
1962 | ||
1963 | DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before); | |
1964 | DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after); | |
1965 | ||
e67d3d42 BF |
1966 | TRACE_EVENT(xfs_log_recover, |
1967 | TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk), | |
1968 | TP_ARGS(log, headblk, tailblk), | |
1969 | TP_STRUCT__entry( | |
1970 | __field(dev_t, dev) | |
1971 | __field(xfs_daddr_t, headblk) | |
1972 | __field(xfs_daddr_t, tailblk) | |
1973 | ), | |
1974 | TP_fast_assign( | |
1975 | __entry->dev = log->l_mp->m_super->s_dev; | |
1976 | __entry->headblk = headblk; | |
1977 | __entry->tailblk = tailblk; | |
1978 | ), | |
1979 | TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx", | |
1980 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk, | |
1981 | __entry->tailblk) | |
1982 | ) | |
1983 | ||
5cd9cee9 BF |
1984 | TRACE_EVENT(xfs_log_recover_record, |
1985 | TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass), | |
1986 | TP_ARGS(log, rhead, pass), | |
1987 | TP_STRUCT__entry( | |
1988 | __field(dev_t, dev) | |
1989 | __field(xfs_lsn_t, lsn) | |
1990 | __field(int, len) | |
1991 | __field(int, num_logops) | |
1992 | __field(int, pass) | |
1993 | ), | |
1994 | TP_fast_assign( | |
1995 | __entry->dev = log->l_mp->m_super->s_dev; | |
1996 | __entry->lsn = be64_to_cpu(rhead->h_lsn); | |
1997 | __entry->len = be32_to_cpu(rhead->h_len); | |
1998 | __entry->num_logops = be32_to_cpu(rhead->h_num_logops); | |
1999 | __entry->pass = pass; | |
2000 | ), | |
2001 | TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d", | |
2002 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2003 | __entry->lsn, __entry->len, __entry->num_logops, | |
2004 | __entry->pass) | |
2005 | ) | |
2006 | ||
9abbc539 | 2007 | DECLARE_EVENT_CLASS(xfs_log_recover_item_class, |
ad223e60 | 2008 | TP_PROTO(struct xlog *log, struct xlog_recover *trans, |
9abbc539 DC |
2009 | struct xlog_recover_item *item, int pass), |
2010 | TP_ARGS(log, trans, item, pass), | |
2011 | TP_STRUCT__entry( | |
2012 | __field(dev_t, dev) | |
2013 | __field(unsigned long, item) | |
2014 | __field(xlog_tid_t, tid) | |
5cd9cee9 | 2015 | __field(xfs_lsn_t, lsn) |
9abbc539 DC |
2016 | __field(int, type) |
2017 | __field(int, pass) | |
2018 | __field(int, count) | |
2019 | __field(int, total) | |
2020 | ), | |
2021 | TP_fast_assign( | |
2022 | __entry->dev = log->l_mp->m_super->s_dev; | |
2023 | __entry->item = (unsigned long)item; | |
2024 | __entry->tid = trans->r_log_tid; | |
5cd9cee9 | 2025 | __entry->lsn = trans->r_lsn; |
9abbc539 DC |
2026 | __entry->type = ITEM_TYPE(item); |
2027 | __entry->pass = pass; | |
2028 | __entry->count = item->ri_cnt; | |
2029 | __entry->total = item->ri_total; | |
2030 | ), | |
5cd9cee9 BF |
2031 | TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item 0x%p, " |
2032 | "item type %s item region count/total %d/%d", | |
9abbc539 DC |
2033 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2034 | __entry->tid, | |
5cd9cee9 | 2035 | __entry->lsn, |
9abbc539 DC |
2036 | __entry->pass, |
2037 | (void *)__entry->item, | |
2038 | __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), | |
2039 | __entry->count, | |
2040 | __entry->total) | |
2041 | ) | |
2042 | ||
2043 | #define DEFINE_LOG_RECOVER_ITEM(name) \ | |
2044 | DEFINE_EVENT(xfs_log_recover_item_class, name, \ | |
ad223e60 | 2045 | TP_PROTO(struct xlog *log, struct xlog_recover *trans, \ |
9abbc539 DC |
2046 | struct xlog_recover_item *item, int pass), \ |
2047 | TP_ARGS(log, trans, item, pass)) | |
2048 | ||
2049 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add); | |
2050 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont); | |
2051 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head); | |
2052 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail); | |
2053 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover); | |
2054 | ||
2055 | DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class, | |
ad223e60 | 2056 | TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), |
9abbc539 DC |
2057 | TP_ARGS(log, buf_f), |
2058 | TP_STRUCT__entry( | |
2059 | __field(dev_t, dev) | |
c8ce540d | 2060 | __field(int64_t, blkno) |
9abbc539 DC |
2061 | __field(unsigned short, len) |
2062 | __field(unsigned short, flags) | |
2063 | __field(unsigned short, size) | |
2064 | __field(unsigned int, map_size) | |
2065 | ), | |
2066 | TP_fast_assign( | |
2067 | __entry->dev = log->l_mp->m_super->s_dev; | |
2068 | __entry->blkno = buf_f->blf_blkno; | |
2069 | __entry->len = buf_f->blf_len; | |
2070 | __entry->flags = buf_f->blf_flags; | |
2071 | __entry->size = buf_f->blf_size; | |
2072 | __entry->map_size = buf_f->blf_map_size; | |
2073 | ), | |
2074 | TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, " | |
2075 | "map_size %d", | |
2076 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2077 | __entry->blkno, | |
2078 | __entry->len, | |
2079 | __entry->flags, | |
2080 | __entry->size, | |
2081 | __entry->map_size) | |
2082 | ) | |
2083 | ||
2084 | #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \ | |
2085 | DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \ | |
ad223e60 | 2086 | TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \ |
9abbc539 DC |
2087 | TP_ARGS(log, buf_f)) |
2088 | ||
2089 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel); | |
2090 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel); | |
2091 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add); | |
2092 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc); | |
2093 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover); | |
5cd9cee9 | 2094 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip); |
9abbc539 DC |
2095 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf); |
2096 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf); | |
2097 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf); | |
2098 | ||
2099 | DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class, | |
ad223e60 | 2100 | TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), |
9abbc539 DC |
2101 | TP_ARGS(log, in_f), |
2102 | TP_STRUCT__entry( | |
2103 | __field(dev_t, dev) | |
2104 | __field(xfs_ino_t, ino) | |
2105 | __field(unsigned short, size) | |
2106 | __field(int, fields) | |
2107 | __field(unsigned short, asize) | |
2108 | __field(unsigned short, dsize) | |
c8ce540d | 2109 | __field(int64_t, blkno) |
9abbc539 DC |
2110 | __field(int, len) |
2111 | __field(int, boffset) | |
2112 | ), | |
2113 | TP_fast_assign( | |
2114 | __entry->dev = log->l_mp->m_super->s_dev; | |
2115 | __entry->ino = in_f->ilf_ino; | |
2116 | __entry->size = in_f->ilf_size; | |
2117 | __entry->fields = in_f->ilf_fields; | |
2118 | __entry->asize = in_f->ilf_asize; | |
2119 | __entry->dsize = in_f->ilf_dsize; | |
2120 | __entry->blkno = in_f->ilf_blkno; | |
2121 | __entry->len = in_f->ilf_len; | |
2122 | __entry->boffset = in_f->ilf_boffset; | |
2123 | ), | |
2124 | TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, " | |
2125 | "dsize %d, blkno 0x%llx, len %d, boffset %d", | |
2126 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2127 | __entry->ino, | |
2128 | __entry->size, | |
2129 | __entry->fields, | |
2130 | __entry->asize, | |
2131 | __entry->dsize, | |
2132 | __entry->blkno, | |
2133 | __entry->len, | |
2134 | __entry->boffset) | |
2135 | ) | |
2136 | #define DEFINE_LOG_RECOVER_INO_ITEM(name) \ | |
2137 | DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \ | |
ad223e60 | 2138 | TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \ |
9abbc539 DC |
2139 | TP_ARGS(log, in_f)) |
2140 | ||
2141 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover); | |
2142 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel); | |
2143 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip); | |
2144 | ||
78d57e45 BF |
2145 | DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class, |
2146 | TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), | |
2147 | TP_ARGS(log, in_f), | |
2148 | TP_STRUCT__entry( | |
2149 | __field(dev_t, dev) | |
2150 | __field(xfs_agnumber_t, agno) | |
2151 | __field(xfs_agblock_t, agbno) | |
2152 | __field(unsigned int, count) | |
2153 | __field(unsigned int, isize) | |
2154 | __field(xfs_agblock_t, length) | |
2155 | __field(unsigned int, gen) | |
2156 | ), | |
2157 | TP_fast_assign( | |
2158 | __entry->dev = log->l_mp->m_super->s_dev; | |
2159 | __entry->agno = be32_to_cpu(in_f->icl_ag); | |
2160 | __entry->agbno = be32_to_cpu(in_f->icl_agbno); | |
2161 | __entry->count = be32_to_cpu(in_f->icl_count); | |
2162 | __entry->isize = be32_to_cpu(in_f->icl_isize); | |
2163 | __entry->length = be32_to_cpu(in_f->icl_length); | |
2164 | __entry->gen = be32_to_cpu(in_f->icl_gen); | |
2165 | ), | |
2166 | TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u " | |
2167 | "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev), | |
2168 | __entry->agno, __entry->agbno, __entry->count, __entry->isize, | |
2169 | __entry->length, __entry->gen) | |
2170 | ) | |
2171 | #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \ | |
2172 | DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \ | |
2173 | TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \ | |
2174 | TP_ARGS(log, in_f)) | |
2175 | ||
2176 | DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel); | |
2177 | DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover); | |
2178 | ||
a46db608 CH |
2179 | DECLARE_EVENT_CLASS(xfs_discard_class, |
2180 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2181 | xfs_agblock_t agbno, xfs_extlen_t len), | |
2182 | TP_ARGS(mp, agno, agbno, len), | |
2183 | TP_STRUCT__entry( | |
2184 | __field(dev_t, dev) | |
2185 | __field(xfs_agnumber_t, agno) | |
2186 | __field(xfs_agblock_t, agbno) | |
2187 | __field(xfs_extlen_t, len) | |
2188 | ), | |
2189 | TP_fast_assign( | |
2190 | __entry->dev = mp->m_super->s_dev; | |
2191 | __entry->agno = agno; | |
2192 | __entry->agbno = agbno; | |
2193 | __entry->len = len; | |
2194 | ), | |
42bf9dba | 2195 | TP_printk("dev %d:%d agno %u agbno %u len %u", |
a46db608 CH |
2196 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2197 | __entry->agno, | |
2198 | __entry->agbno, | |
2199 | __entry->len) | |
2200 | ) | |
2201 | ||
2202 | #define DEFINE_DISCARD_EVENT(name) \ | |
2203 | DEFINE_EVENT(xfs_discard_class, name, \ | |
2204 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2205 | xfs_agblock_t agbno, xfs_extlen_t len), \ | |
2206 | TP_ARGS(mp, agno, agbno, len)) | |
2207 | DEFINE_DISCARD_EVENT(xfs_discard_extent); | |
2208 | DEFINE_DISCARD_EVENT(xfs_discard_toosmall); | |
2209 | DEFINE_DISCARD_EVENT(xfs_discard_exclude); | |
2210 | DEFINE_DISCARD_EVENT(xfs_discard_busy); | |
2211 | ||
2c813ad6 DW |
2212 | /* btree cursor events */ |
2213 | DECLARE_EVENT_CLASS(xfs_btree_cur_class, | |
2214 | TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), | |
2215 | TP_ARGS(cur, level, bp), | |
2216 | TP_STRUCT__entry( | |
2217 | __field(dev_t, dev) | |
2218 | __field(xfs_btnum_t, btnum) | |
2219 | __field(int, level) | |
2220 | __field(int, nlevels) | |
2221 | __field(int, ptr) | |
2222 | __field(xfs_daddr_t, daddr) | |
2223 | ), | |
2224 | TP_fast_assign( | |
2225 | __entry->dev = cur->bc_mp->m_super->s_dev; | |
2226 | __entry->btnum = cur->bc_btnum; | |
2227 | __entry->level = level; | |
2228 | __entry->nlevels = cur->bc_nlevels; | |
2229 | __entry->ptr = cur->bc_ptrs[level]; | |
2230 | __entry->daddr = bp ? bp->b_bn : -1; | |
2231 | ), | |
2232 | TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx", | |
2233 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2234 | __entry->btnum, | |
2235 | __entry->level, | |
2236 | __entry->nlevels, | |
2237 | __entry->ptr, | |
2238 | (unsigned long long)__entry->daddr) | |
2239 | ) | |
2240 | ||
2241 | #define DEFINE_BTREE_CUR_EVENT(name) \ | |
2242 | DEFINE_EVENT(xfs_btree_cur_class, name, \ | |
2243 | TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \ | |
2244 | TP_ARGS(cur, level, bp)) | |
2245 | DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys); | |
105f7d83 | 2246 | DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range); |
2c813ad6 | 2247 | |
3cd48abc DW |
2248 | /* deferred ops */ |
2249 | struct xfs_defer_pending; | |
3cd48abc DW |
2250 | struct xfs_defer_ops; |
2251 | ||
2252 | DECLARE_EVENT_CLASS(xfs_defer_class, | |
2253 | TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), | |
2254 | TP_ARGS(mp, dop), | |
2255 | TP_STRUCT__entry( | |
2256 | __field(dev_t, dev) | |
2257 | __field(void *, dop) | |
3f88a15a CH |
2258 | __field(char, committed) |
2259 | __field(char, low) | |
3cd48abc DW |
2260 | ), |
2261 | TP_fast_assign( | |
2262 | __entry->dev = mp ? mp->m_super->s_dev : 0; | |
2263 | __entry->dop = dop; | |
2264 | __entry->committed = dop->dop_committed; | |
2265 | __entry->low = dop->dop_low; | |
2266 | ), | |
42bf9dba | 2267 | TP_printk("dev %d:%d ops %p committed %d low %d", |
3cd48abc DW |
2268 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2269 | __entry->dop, | |
2270 | __entry->committed, | |
2271 | __entry->low) | |
2272 | ) | |
2273 | #define DEFINE_DEFER_EVENT(name) \ | |
2274 | DEFINE_EVENT(xfs_defer_class, name, \ | |
2275 | TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \ | |
2276 | TP_ARGS(mp, dop)) | |
2277 | ||
2278 | DECLARE_EVENT_CLASS(xfs_defer_error_class, | |
2279 | TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), | |
2280 | TP_ARGS(mp, dop, error), | |
2281 | TP_STRUCT__entry( | |
2282 | __field(dev_t, dev) | |
2283 | __field(void *, dop) | |
3f88a15a CH |
2284 | __field(char, committed) |
2285 | __field(char, low) | |
3cd48abc DW |
2286 | __field(int, error) |
2287 | ), | |
2288 | TP_fast_assign( | |
2289 | __entry->dev = mp ? mp->m_super->s_dev : 0; | |
2290 | __entry->dop = dop; | |
2291 | __entry->committed = dop->dop_committed; | |
2292 | __entry->low = dop->dop_low; | |
2293 | __entry->error = error; | |
2294 | ), | |
42bf9dba | 2295 | TP_printk("dev %d:%d ops %p committed %d low %d err %d", |
3cd48abc DW |
2296 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2297 | __entry->dop, | |
2298 | __entry->committed, | |
2299 | __entry->low, | |
2300 | __entry->error) | |
2301 | ) | |
2302 | #define DEFINE_DEFER_ERROR_EVENT(name) \ | |
2303 | DEFINE_EVENT(xfs_defer_error_class, name, \ | |
2304 | TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \ | |
2305 | TP_ARGS(mp, dop, error)) | |
2306 | ||
2307 | DECLARE_EVENT_CLASS(xfs_defer_pending_class, | |
2308 | TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), | |
2309 | TP_ARGS(mp, dfp), | |
2310 | TP_STRUCT__entry( | |
2311 | __field(dev_t, dev) | |
2312 | __field(int, type) | |
2313 | __field(void *, intent) | |
3f88a15a | 2314 | __field(char, committed) |
3cd48abc DW |
2315 | __field(int, nr) |
2316 | ), | |
2317 | TP_fast_assign( | |
2318 | __entry->dev = mp ? mp->m_super->s_dev : 0; | |
2319 | __entry->type = dfp->dfp_type->type; | |
2320 | __entry->intent = dfp->dfp_intent; | |
ea78d808 | 2321 | __entry->committed = dfp->dfp_done != NULL; |
3cd48abc DW |
2322 | __entry->nr = dfp->dfp_count; |
2323 | ), | |
42bf9dba | 2324 | TP_printk("dev %d:%d optype %d intent %p committed %d nr %d", |
3cd48abc DW |
2325 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2326 | __entry->type, | |
2327 | __entry->intent, | |
2328 | __entry->committed, | |
2329 | __entry->nr) | |
2330 | ) | |
2331 | #define DEFINE_DEFER_PENDING_EVENT(name) \ | |
2332 | DEFINE_EVENT(xfs_defer_pending_class, name, \ | |
2333 | TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \ | |
2334 | TP_ARGS(mp, dfp)) | |
2335 | ||
2336 | DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class, | |
2337 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2338 | int type, xfs_agblock_t agbno, xfs_extlen_t len), | |
2339 | TP_ARGS(mp, agno, type, agbno, len), | |
2340 | TP_STRUCT__entry( | |
2341 | __field(dev_t, dev) | |
2342 | __field(xfs_agnumber_t, agno) | |
2343 | __field(int, type) | |
2344 | __field(xfs_agblock_t, agbno) | |
2345 | __field(xfs_extlen_t, len) | |
2346 | ), | |
2347 | TP_fast_assign( | |
2348 | __entry->dev = mp->m_super->s_dev; | |
2349 | __entry->agno = agno; | |
2350 | __entry->type = type; | |
2351 | __entry->agbno = agbno; | |
2352 | __entry->len = len; | |
2353 | ), | |
2354 | TP_printk("dev %d:%d op %d agno %u agbno %u len %u", | |
2355 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2356 | __entry->type, | |
2357 | __entry->agno, | |
2358 | __entry->agbno, | |
2359 | __entry->len) | |
2360 | ); | |
2361 | #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \ | |
2362 | DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \ | |
2363 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2364 | int type, \ | |
2365 | xfs_agblock_t bno, \ | |
2366 | xfs_extlen_t len), \ | |
2367 | TP_ARGS(mp, agno, type, bno, len)) | |
2368 | ||
2369 | DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class, | |
2370 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2371 | int op, | |
2372 | xfs_agblock_t agbno, | |
2373 | xfs_ino_t ino, | |
2374 | int whichfork, | |
2375 | xfs_fileoff_t offset, | |
2376 | xfs_filblks_t len, | |
2377 | xfs_exntst_t state), | |
2378 | TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state), | |
2379 | TP_STRUCT__entry( | |
2380 | __field(dev_t, dev) | |
2381 | __field(xfs_agnumber_t, agno) | |
2382 | __field(xfs_ino_t, ino) | |
2383 | __field(xfs_agblock_t, agbno) | |
2384 | __field(int, whichfork) | |
2385 | __field(xfs_fileoff_t, l_loff) | |
2386 | __field(xfs_filblks_t, l_len) | |
2387 | __field(xfs_exntst_t, l_state) | |
2388 | __field(int, op) | |
2389 | ), | |
2390 | TP_fast_assign( | |
2391 | __entry->dev = mp->m_super->s_dev; | |
2392 | __entry->agno = agno; | |
2393 | __entry->ino = ino; | |
2394 | __entry->agbno = agbno; | |
2395 | __entry->whichfork = whichfork; | |
2396 | __entry->l_loff = offset; | |
2397 | __entry->l_len = len; | |
2398 | __entry->l_state = state; | |
2399 | __entry->op = op; | |
2400 | ), | |
2401 | TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d", | |
2402 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2403 | __entry->op, | |
2404 | __entry->agno, | |
2405 | __entry->agbno, | |
2406 | __entry->ino, | |
2407 | __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data", | |
2408 | __entry->l_loff, | |
2409 | __entry->l_len, | |
2410 | __entry->l_state) | |
2411 | ); | |
2412 | #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \ | |
2413 | DEFINE_EVENT(xfs_map_extent_deferred_class, name, \ | |
2414 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2415 | int op, \ | |
2416 | xfs_agblock_t agbno, \ | |
2417 | xfs_ino_t ino, \ | |
2418 | int whichfork, \ | |
2419 | xfs_fileoff_t offset, \ | |
2420 | xfs_filblks_t len, \ | |
2421 | xfs_exntst_t state), \ | |
2422 | TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state)) | |
2423 | ||
2424 | DEFINE_DEFER_EVENT(xfs_defer_init); | |
2425 | DEFINE_DEFER_EVENT(xfs_defer_cancel); | |
2426 | DEFINE_DEFER_EVENT(xfs_defer_trans_roll); | |
2427 | DEFINE_DEFER_EVENT(xfs_defer_trans_abort); | |
2428 | DEFINE_DEFER_EVENT(xfs_defer_finish); | |
2429 | DEFINE_DEFER_EVENT(xfs_defer_finish_done); | |
2430 | ||
2431 | DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error); | |
2432 | DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error); | |
3cd48abc DW |
2433 | |
2434 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work); | |
2435 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel); | |
3cd48abc DW |
2436 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel); |
2437 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish); | |
2438 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort); | |
2439 | ||
ba9e7802 DW |
2440 | #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT |
2441 | DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer); | |
2442 | DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred); | |
2443 | ||
673930c3 DW |
2444 | /* rmap tracepoints */ |
2445 | DECLARE_EVENT_CLASS(xfs_rmap_class, | |
2446 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2447 | xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, | |
2448 | struct xfs_owner_info *oinfo), | |
2449 | TP_ARGS(mp, agno, agbno, len, unwritten, oinfo), | |
2450 | TP_STRUCT__entry( | |
2451 | __field(dev_t, dev) | |
2452 | __field(xfs_agnumber_t, agno) | |
2453 | __field(xfs_agblock_t, agbno) | |
2454 | __field(xfs_extlen_t, len) | |
2455 | __field(uint64_t, owner) | |
2456 | __field(uint64_t, offset) | |
2457 | __field(unsigned long, flags) | |
2458 | ), | |
2459 | TP_fast_assign( | |
2460 | __entry->dev = mp->m_super->s_dev; | |
2461 | __entry->agno = agno; | |
2462 | __entry->agbno = agbno; | |
2463 | __entry->len = len; | |
2464 | __entry->owner = oinfo->oi_owner; | |
2465 | __entry->offset = oinfo->oi_offset; | |
2466 | __entry->flags = oinfo->oi_flags; | |
035e00ac DW |
2467 | if (unwritten) |
2468 | __entry->flags |= XFS_RMAP_UNWRITTEN; | |
673930c3 DW |
2469 | ), |
2470 | TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx", | |
2471 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2472 | __entry->agno, | |
2473 | __entry->agbno, | |
2474 | __entry->len, | |
2475 | __entry->owner, | |
2476 | __entry->offset, | |
2477 | __entry->flags) | |
2478 | ); | |
2479 | #define DEFINE_RMAP_EVENT(name) \ | |
2480 | DEFINE_EVENT(xfs_rmap_class, name, \ | |
2481 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2482 | xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \ | |
2483 | struct xfs_owner_info *oinfo), \ | |
2484 | TP_ARGS(mp, agno, agbno, len, unwritten, oinfo)) | |
2485 | ||
2486 | /* simple AG-based error/%ip tracepoint class */ | |
2487 | DECLARE_EVENT_CLASS(xfs_ag_error_class, | |
2488 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, | |
2489 | unsigned long caller_ip), | |
2490 | TP_ARGS(mp, agno, error, caller_ip), | |
2491 | TP_STRUCT__entry( | |
2492 | __field(dev_t, dev) | |
2493 | __field(xfs_agnumber_t, agno) | |
2494 | __field(int, error) | |
2495 | __field(unsigned long, caller_ip) | |
2496 | ), | |
2497 | TP_fast_assign( | |
2498 | __entry->dev = mp->m_super->s_dev; | |
2499 | __entry->agno = agno; | |
2500 | __entry->error = error; | |
2501 | __entry->caller_ip = caller_ip; | |
2502 | ), | |
2503 | TP_printk("dev %d:%d agno %u error %d caller %ps", | |
2504 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2505 | __entry->agno, | |
2506 | __entry->error, | |
2507 | (char *)__entry->caller_ip) | |
2508 | ); | |
2509 | ||
2510 | #define DEFINE_AG_ERROR_EVENT(name) \ | |
2511 | DEFINE_EVENT(xfs_ag_error_class, name, \ | |
2512 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \ | |
2513 | unsigned long caller_ip), \ | |
2514 | TP_ARGS(mp, agno, error, caller_ip)) | |
2515 | ||
2516 | DEFINE_RMAP_EVENT(xfs_rmap_unmap); | |
2517 | DEFINE_RMAP_EVENT(xfs_rmap_unmap_done); | |
2518 | DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error); | |
2519 | DEFINE_RMAP_EVENT(xfs_rmap_map); | |
2520 | DEFINE_RMAP_EVENT(xfs_rmap_map_done); | |
2521 | DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error); | |
fb7d9267 DW |
2522 | DEFINE_RMAP_EVENT(xfs_rmap_convert); |
2523 | DEFINE_RMAP_EVENT(xfs_rmap_convert_done); | |
2524 | DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error); | |
2525 | DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state); | |
673930c3 | 2526 | |
aa966d84 DW |
2527 | DECLARE_EVENT_CLASS(xfs_rmapbt_class, |
2528 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2529 | xfs_agblock_t agbno, xfs_extlen_t len, | |
2530 | uint64_t owner, uint64_t offset, unsigned int flags), | |
2531 | TP_ARGS(mp, agno, agbno, len, owner, offset, flags), | |
2532 | TP_STRUCT__entry( | |
2533 | __field(dev_t, dev) | |
2534 | __field(xfs_agnumber_t, agno) | |
2535 | __field(xfs_agblock_t, agbno) | |
2536 | __field(xfs_extlen_t, len) | |
2537 | __field(uint64_t, owner) | |
2538 | __field(uint64_t, offset) | |
2539 | __field(unsigned int, flags) | |
2540 | ), | |
2541 | TP_fast_assign( | |
2542 | __entry->dev = mp->m_super->s_dev; | |
2543 | __entry->agno = agno; | |
2544 | __entry->agbno = agbno; | |
2545 | __entry->len = len; | |
2546 | __entry->owner = owner; | |
2547 | __entry->offset = offset; | |
2548 | __entry->flags = flags; | |
2549 | ), | |
2550 | TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x", | |
2551 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2552 | __entry->agno, | |
2553 | __entry->agbno, | |
2554 | __entry->len, | |
2555 | __entry->owner, | |
2556 | __entry->offset, | |
2557 | __entry->flags) | |
2558 | ); | |
2559 | #define DEFINE_RMAPBT_EVENT(name) \ | |
2560 | DEFINE_EVENT(xfs_rmapbt_class, name, \ | |
2561 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2562 | xfs_agblock_t agbno, xfs_extlen_t len, \ | |
2563 | uint64_t owner, uint64_t offset, unsigned int flags), \ | |
2564 | TP_ARGS(mp, agno, agbno, len, owner, offset, flags)) | |
2565 | ||
2566 | #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT | |
2567 | DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer); | |
2568 | DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred); | |
2569 | ||
4b8ed677 DW |
2570 | DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block); |
2571 | DEFINE_BUSY_EVENT(xfs_rmapbt_free_block); | |
aa966d84 DW |
2572 | DEFINE_RMAPBT_EVENT(xfs_rmap_update); |
2573 | DEFINE_RMAPBT_EVENT(xfs_rmap_insert); | |
2574 | DEFINE_RMAPBT_EVENT(xfs_rmap_delete); | |
2575 | DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error); | |
2576 | DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error); | |
2577 | DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error); | |
ceeb9c83 DW |
2578 | |
2579 | DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate); | |
2580 | DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query); | |
2581 | DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate); | |
2582 | DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range); | |
0a1b0b38 DW |
2583 | DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result); |
2584 | DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result); | |
fb7d9267 | 2585 | DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result); |
4b8ed677 | 2586 | |
9f3afb57 DW |
2587 | /* deferred bmbt updates */ |
2588 | #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT | |
2589 | DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer); | |
2590 | DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred); | |
2591 | ||
3fd129b6 DW |
2592 | /* per-AG reservation */ |
2593 | DECLARE_EVENT_CLASS(xfs_ag_resv_class, | |
2594 | TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv, | |
2595 | xfs_extlen_t len), | |
2596 | TP_ARGS(pag, resv, len), | |
2597 | TP_STRUCT__entry( | |
2598 | __field(dev_t, dev) | |
2599 | __field(xfs_agnumber_t, agno) | |
2600 | __field(int, resv) | |
2601 | __field(xfs_extlen_t, freeblks) | |
2602 | __field(xfs_extlen_t, flcount) | |
2603 | __field(xfs_extlen_t, reserved) | |
2604 | __field(xfs_extlen_t, asked) | |
2605 | __field(xfs_extlen_t, len) | |
2606 | ), | |
2607 | TP_fast_assign( | |
2608 | struct xfs_ag_resv *r = xfs_perag_resv(pag, resv); | |
2609 | ||
2610 | __entry->dev = pag->pag_mount->m_super->s_dev; | |
2611 | __entry->agno = pag->pag_agno; | |
2612 | __entry->resv = resv; | |
2613 | __entry->freeblks = pag->pagf_freeblks; | |
2614 | __entry->flcount = pag->pagf_flcount; | |
2615 | __entry->reserved = r ? r->ar_reserved : 0; | |
2616 | __entry->asked = r ? r->ar_asked : 0; | |
2617 | __entry->len = len; | |
2618 | ), | |
42bf9dba HT |
2619 | TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u " |
2620 | "resv %u ask %u len %u", | |
3fd129b6 DW |
2621 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2622 | __entry->agno, | |
2623 | __entry->resv, | |
2624 | __entry->freeblks, | |
2625 | __entry->flcount, | |
2626 | __entry->reserved, | |
2627 | __entry->asked, | |
2628 | __entry->len) | |
2629 | ) | |
2630 | #define DEFINE_AG_RESV_EVENT(name) \ | |
2631 | DEFINE_EVENT(xfs_ag_resv_class, name, \ | |
2632 | TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \ | |
2633 | xfs_extlen_t len), \ | |
2634 | TP_ARGS(pag, type, len)) | |
2635 | ||
2636 | /* per-AG reservation tracepoints */ | |
2637 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_init); | |
2638 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_free); | |
2639 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent); | |
2640 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent); | |
2641 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical); | |
2642 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed); | |
2643 | ||
2644 | DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error); | |
2645 | DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error); | |
2646 | ||
c75c752d DW |
2647 | /* refcount tracepoint classes */ |
2648 | ||
2649 | /* reuse the discard trace class for agbno/aglen-based traces */ | |
2650 | #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name) | |
2651 | ||
2652 | /* ag btree lookup tracepoint class */ | |
2653 | #define XFS_AG_BTREE_CMP_FORMAT_STR \ | |
2654 | { XFS_LOOKUP_EQ, "eq" }, \ | |
2655 | { XFS_LOOKUP_LE, "le" }, \ | |
2656 | { XFS_LOOKUP_GE, "ge" } | |
2657 | DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class, | |
2658 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2659 | xfs_agblock_t agbno, xfs_lookup_t dir), | |
2660 | TP_ARGS(mp, agno, agbno, dir), | |
2661 | TP_STRUCT__entry( | |
2662 | __field(dev_t, dev) | |
2663 | __field(xfs_agnumber_t, agno) | |
2664 | __field(xfs_agblock_t, agbno) | |
2665 | __field(xfs_lookup_t, dir) | |
2666 | ), | |
2667 | TP_fast_assign( | |
2668 | __entry->dev = mp->m_super->s_dev; | |
2669 | __entry->agno = agno; | |
2670 | __entry->agbno = agbno; | |
2671 | __entry->dir = dir; | |
2672 | ), | |
42bf9dba | 2673 | TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)", |
c75c752d DW |
2674 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2675 | __entry->agno, | |
2676 | __entry->agbno, | |
2677 | __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR), | |
2678 | __entry->dir) | |
2679 | ) | |
2680 | ||
2681 | #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \ | |
2682 | DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \ | |
2683 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2684 | xfs_agblock_t agbno, xfs_lookup_t dir), \ | |
2685 | TP_ARGS(mp, agno, agbno, dir)) | |
2686 | ||
2687 | /* single-rcext tracepoint class */ | |
2688 | DECLARE_EVENT_CLASS(xfs_refcount_extent_class, | |
2689 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2690 | struct xfs_refcount_irec *irec), | |
2691 | TP_ARGS(mp, agno, irec), | |
2692 | TP_STRUCT__entry( | |
2693 | __field(dev_t, dev) | |
2694 | __field(xfs_agnumber_t, agno) | |
2695 | __field(xfs_agblock_t, startblock) | |
2696 | __field(xfs_extlen_t, blockcount) | |
2697 | __field(xfs_nlink_t, refcount) | |
2698 | ), | |
2699 | TP_fast_assign( | |
2700 | __entry->dev = mp->m_super->s_dev; | |
2701 | __entry->agno = agno; | |
2702 | __entry->startblock = irec->rc_startblock; | |
2703 | __entry->blockcount = irec->rc_blockcount; | |
2704 | __entry->refcount = irec->rc_refcount; | |
2705 | ), | |
42bf9dba | 2706 | TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u", |
c75c752d DW |
2707 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2708 | __entry->agno, | |
2709 | __entry->startblock, | |
2710 | __entry->blockcount, | |
2711 | __entry->refcount) | |
2712 | ) | |
2713 | ||
2714 | #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \ | |
2715 | DEFINE_EVENT(xfs_refcount_extent_class, name, \ | |
2716 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2717 | struct xfs_refcount_irec *irec), \ | |
2718 | TP_ARGS(mp, agno, irec)) | |
2719 | ||
2720 | /* single-rcext and an agbno tracepoint class */ | |
2721 | DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class, | |
2722 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2723 | struct xfs_refcount_irec *irec, xfs_agblock_t agbno), | |
2724 | TP_ARGS(mp, agno, irec, agbno), | |
2725 | TP_STRUCT__entry( | |
2726 | __field(dev_t, dev) | |
2727 | __field(xfs_agnumber_t, agno) | |
2728 | __field(xfs_agblock_t, startblock) | |
2729 | __field(xfs_extlen_t, blockcount) | |
2730 | __field(xfs_nlink_t, refcount) | |
2731 | __field(xfs_agblock_t, agbno) | |
2732 | ), | |
2733 | TP_fast_assign( | |
2734 | __entry->dev = mp->m_super->s_dev; | |
2735 | __entry->agno = agno; | |
2736 | __entry->startblock = irec->rc_startblock; | |
2737 | __entry->blockcount = irec->rc_blockcount; | |
2738 | __entry->refcount = irec->rc_refcount; | |
2739 | __entry->agbno = agbno; | |
2740 | ), | |
42bf9dba | 2741 | TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u", |
c75c752d DW |
2742 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2743 | __entry->agno, | |
2744 | __entry->startblock, | |
2745 | __entry->blockcount, | |
2746 | __entry->refcount, | |
2747 | __entry->agbno) | |
2748 | ) | |
2749 | ||
2750 | #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \ | |
2751 | DEFINE_EVENT(xfs_refcount_extent_at_class, name, \ | |
2752 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2753 | struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \ | |
2754 | TP_ARGS(mp, agno, irec, agbno)) | |
2755 | ||
2756 | /* double-rcext tracepoint class */ | |
2757 | DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class, | |
2758 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2759 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), | |
2760 | TP_ARGS(mp, agno, i1, i2), | |
2761 | TP_STRUCT__entry( | |
2762 | __field(dev_t, dev) | |
2763 | __field(xfs_agnumber_t, agno) | |
2764 | __field(xfs_agblock_t, i1_startblock) | |
2765 | __field(xfs_extlen_t, i1_blockcount) | |
2766 | __field(xfs_nlink_t, i1_refcount) | |
2767 | __field(xfs_agblock_t, i2_startblock) | |
2768 | __field(xfs_extlen_t, i2_blockcount) | |
2769 | __field(xfs_nlink_t, i2_refcount) | |
2770 | ), | |
2771 | TP_fast_assign( | |
2772 | __entry->dev = mp->m_super->s_dev; | |
2773 | __entry->agno = agno; | |
2774 | __entry->i1_startblock = i1->rc_startblock; | |
2775 | __entry->i1_blockcount = i1->rc_blockcount; | |
2776 | __entry->i1_refcount = i1->rc_refcount; | |
2777 | __entry->i2_startblock = i2->rc_startblock; | |
2778 | __entry->i2_blockcount = i2->rc_blockcount; | |
2779 | __entry->i2_refcount = i2->rc_refcount; | |
2780 | ), | |
2781 | TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- " | |
42bf9dba | 2782 | "agbno %u len %u refcount %u", |
c75c752d DW |
2783 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2784 | __entry->agno, | |
2785 | __entry->i1_startblock, | |
2786 | __entry->i1_blockcount, | |
2787 | __entry->i1_refcount, | |
2788 | __entry->i2_startblock, | |
2789 | __entry->i2_blockcount, | |
2790 | __entry->i2_refcount) | |
2791 | ) | |
2792 | ||
2793 | #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \ | |
2794 | DEFINE_EVENT(xfs_refcount_double_extent_class, name, \ | |
2795 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2796 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \ | |
2797 | TP_ARGS(mp, agno, i1, i2)) | |
2798 | ||
2799 | /* double-rcext and an agbno tracepoint class */ | |
2800 | DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class, | |
2801 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2802 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, | |
2803 | xfs_agblock_t agbno), | |
2804 | TP_ARGS(mp, agno, i1, i2, agbno), | |
2805 | TP_STRUCT__entry( | |
2806 | __field(dev_t, dev) | |
2807 | __field(xfs_agnumber_t, agno) | |
2808 | __field(xfs_agblock_t, i1_startblock) | |
2809 | __field(xfs_extlen_t, i1_blockcount) | |
2810 | __field(xfs_nlink_t, i1_refcount) | |
2811 | __field(xfs_agblock_t, i2_startblock) | |
2812 | __field(xfs_extlen_t, i2_blockcount) | |
2813 | __field(xfs_nlink_t, i2_refcount) | |
2814 | __field(xfs_agblock_t, agbno) | |
2815 | ), | |
2816 | TP_fast_assign( | |
2817 | __entry->dev = mp->m_super->s_dev; | |
2818 | __entry->agno = agno; | |
2819 | __entry->i1_startblock = i1->rc_startblock; | |
2820 | __entry->i1_blockcount = i1->rc_blockcount; | |
2821 | __entry->i1_refcount = i1->rc_refcount; | |
2822 | __entry->i2_startblock = i2->rc_startblock; | |
2823 | __entry->i2_blockcount = i2->rc_blockcount; | |
2824 | __entry->i2_refcount = i2->rc_refcount; | |
2825 | __entry->agbno = agbno; | |
2826 | ), | |
2827 | TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- " | |
42bf9dba | 2828 | "agbno %u len %u refcount %u @ agbno %u", |
c75c752d DW |
2829 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2830 | __entry->agno, | |
2831 | __entry->i1_startblock, | |
2832 | __entry->i1_blockcount, | |
2833 | __entry->i1_refcount, | |
2834 | __entry->i2_startblock, | |
2835 | __entry->i2_blockcount, | |
2836 | __entry->i2_refcount, | |
2837 | __entry->agbno) | |
2838 | ) | |
2839 | ||
2840 | #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \ | |
2841 | DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \ | |
2842 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2843 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \ | |
2844 | xfs_agblock_t agbno), \ | |
2845 | TP_ARGS(mp, agno, i1, i2, agbno)) | |
2846 | ||
2847 | /* triple-rcext tracepoint class */ | |
2848 | DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class, | |
2849 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2850 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, | |
2851 | struct xfs_refcount_irec *i3), | |
2852 | TP_ARGS(mp, agno, i1, i2, i3), | |
2853 | TP_STRUCT__entry( | |
2854 | __field(dev_t, dev) | |
2855 | __field(xfs_agnumber_t, agno) | |
2856 | __field(xfs_agblock_t, i1_startblock) | |
2857 | __field(xfs_extlen_t, i1_blockcount) | |
2858 | __field(xfs_nlink_t, i1_refcount) | |
2859 | __field(xfs_agblock_t, i2_startblock) | |
2860 | __field(xfs_extlen_t, i2_blockcount) | |
2861 | __field(xfs_nlink_t, i2_refcount) | |
2862 | __field(xfs_agblock_t, i3_startblock) | |
2863 | __field(xfs_extlen_t, i3_blockcount) | |
2864 | __field(xfs_nlink_t, i3_refcount) | |
2865 | ), | |
2866 | TP_fast_assign( | |
2867 | __entry->dev = mp->m_super->s_dev; | |
2868 | __entry->agno = agno; | |
2869 | __entry->i1_startblock = i1->rc_startblock; | |
2870 | __entry->i1_blockcount = i1->rc_blockcount; | |
2871 | __entry->i1_refcount = i1->rc_refcount; | |
2872 | __entry->i2_startblock = i2->rc_startblock; | |
2873 | __entry->i2_blockcount = i2->rc_blockcount; | |
2874 | __entry->i2_refcount = i2->rc_refcount; | |
2875 | __entry->i3_startblock = i3->rc_startblock; | |
2876 | __entry->i3_blockcount = i3->rc_blockcount; | |
2877 | __entry->i3_refcount = i3->rc_refcount; | |
2878 | ), | |
2879 | TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- " | |
2880 | "agbno %u len %u refcount %u -- " | |
42bf9dba | 2881 | "agbno %u len %u refcount %u", |
c75c752d DW |
2882 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2883 | __entry->agno, | |
2884 | __entry->i1_startblock, | |
2885 | __entry->i1_blockcount, | |
2886 | __entry->i1_refcount, | |
2887 | __entry->i2_startblock, | |
2888 | __entry->i2_blockcount, | |
2889 | __entry->i2_refcount, | |
2890 | __entry->i3_startblock, | |
2891 | __entry->i3_blockcount, | |
2892 | __entry->i3_refcount) | |
2893 | ); | |
2894 | ||
2895 | #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \ | |
2896 | DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \ | |
2897 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2898 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \ | |
2899 | struct xfs_refcount_irec *i3), \ | |
2900 | TP_ARGS(mp, agno, i1, i2, i3)) | |
2901 | ||
2902 | /* refcount btree tracepoints */ | |
2903 | DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block); | |
2904 | DEFINE_BUSY_EVENT(xfs_refcountbt_free_block); | |
2905 | DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup); | |
2906 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get); | |
2907 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update); | |
2908 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert); | |
2909 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete); | |
2910 | DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error); | |
2911 | DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error); | |
2912 | DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error); | |
2913 | ||
2914 | /* refcount adjustment tracepoints */ | |
2915 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase); | |
2916 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease); | |
174edb0e DW |
2917 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase); |
2918 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease); | |
c75c752d DW |
2919 | DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents); |
2920 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent); | |
174edb0e | 2921 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent); |
c75c752d DW |
2922 | DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent); |
2923 | DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent); | |
2924 | DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent); | |
2925 | DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent); | |
2926 | DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent); | |
2927 | DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error); | |
174edb0e | 2928 | DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error); |
c75c752d DW |
2929 | DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error); |
2930 | DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error); | |
2931 | DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error); | |
2932 | DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error); | |
2933 | DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error); | |
2934 | DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error); | |
2935 | DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error); | |
2936 | ||
2937 | /* reflink helpers */ | |
2938 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared); | |
2939 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result); | |
2940 | DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error); | |
33ba6129 DW |
2941 | #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT |
2942 | DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer); | |
2943 | DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred); | |
c75c752d | 2944 | |
f997ee21 DW |
2945 | TRACE_EVENT(xfs_refcount_finish_one_leftover, |
2946 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2947 | int type, xfs_agblock_t agbno, xfs_extlen_t len, | |
2948 | xfs_agblock_t new_agbno, xfs_extlen_t new_len), | |
2949 | TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len), | |
2950 | TP_STRUCT__entry( | |
2951 | __field(dev_t, dev) | |
2952 | __field(xfs_agnumber_t, agno) | |
2953 | __field(int, type) | |
2954 | __field(xfs_agblock_t, agbno) | |
2955 | __field(xfs_extlen_t, len) | |
2956 | __field(xfs_agblock_t, new_agbno) | |
2957 | __field(xfs_extlen_t, new_len) | |
2958 | ), | |
2959 | TP_fast_assign( | |
2960 | __entry->dev = mp->m_super->s_dev; | |
2961 | __entry->agno = agno; | |
2962 | __entry->type = type; | |
2963 | __entry->agbno = agbno; | |
2964 | __entry->len = len; | |
2965 | __entry->new_agbno = new_agbno; | |
2966 | __entry->new_len = new_len; | |
2967 | ), | |
2968 | TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u", | |
2969 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2970 | __entry->type, | |
2971 | __entry->agno, | |
2972 | __entry->agbno, | |
2973 | __entry->len, | |
2974 | __entry->new_agbno, | |
2975 | __entry->new_len) | |
2976 | ); | |
2977 | ||
f65306ea DW |
2978 | /* simple inode-based error/%ip tracepoint class */ |
2979 | DECLARE_EVENT_CLASS(xfs_inode_error_class, | |
2980 | TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip), | |
2981 | TP_ARGS(ip, error, caller_ip), | |
2982 | TP_STRUCT__entry( | |
2983 | __field(dev_t, dev) | |
2984 | __field(xfs_ino_t, ino) | |
2985 | __field(int, error) | |
2986 | __field(unsigned long, caller_ip) | |
2987 | ), | |
2988 | TP_fast_assign( | |
2989 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
2990 | __entry->ino = ip->i_ino; | |
2991 | __entry->error = error; | |
2992 | __entry->caller_ip = caller_ip; | |
2993 | ), | |
2994 | TP_printk("dev %d:%d ino %llx error %d caller %ps", | |
2995 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2996 | __entry->ino, | |
2997 | __entry->error, | |
2998 | (char *)__entry->caller_ip) | |
2999 | ); | |
3000 | ||
3001 | #define DEFINE_INODE_ERROR_EVENT(name) \ | |
3002 | DEFINE_EVENT(xfs_inode_error_class, name, \ | |
3003 | TP_PROTO(struct xfs_inode *ip, int error, \ | |
3004 | unsigned long caller_ip), \ | |
3005 | TP_ARGS(ip, error, caller_ip)) | |
3006 | ||
53aa1c34 DW |
3007 | /* reflink tracepoint classes */ |
3008 | ||
3009 | /* two-file io tracepoint class */ | |
3010 | DECLARE_EVENT_CLASS(xfs_double_io_class, | |
3011 | TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, | |
3012 | struct xfs_inode *dest, xfs_off_t doffset), | |
3013 | TP_ARGS(src, soffset, len, dest, doffset), | |
3014 | TP_STRUCT__entry( | |
3015 | __field(dev_t, dev) | |
3016 | __field(xfs_ino_t, src_ino) | |
3017 | __field(loff_t, src_isize) | |
3018 | __field(loff_t, src_disize) | |
3019 | __field(loff_t, src_offset) | |
3020 | __field(size_t, len) | |
3021 | __field(xfs_ino_t, dest_ino) | |
3022 | __field(loff_t, dest_isize) | |
3023 | __field(loff_t, dest_disize) | |
3024 | __field(loff_t, dest_offset) | |
3025 | ), | |
3026 | TP_fast_assign( | |
3027 | __entry->dev = VFS_I(src)->i_sb->s_dev; | |
3028 | __entry->src_ino = src->i_ino; | |
3029 | __entry->src_isize = VFS_I(src)->i_size; | |
3030 | __entry->src_disize = src->i_d.di_size; | |
3031 | __entry->src_offset = soffset; | |
3032 | __entry->len = len; | |
3033 | __entry->dest_ino = dest->i_ino; | |
3034 | __entry->dest_isize = VFS_I(dest)->i_size; | |
3035 | __entry->dest_disize = dest->i_d.di_size; | |
3036 | __entry->dest_offset = doffset; | |
3037 | ), | |
3038 | TP_printk("dev %d:%d count %zd " | |
3039 | "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> " | |
3040 | "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx", | |
3041 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3042 | __entry->len, | |
3043 | __entry->src_ino, | |
3044 | __entry->src_isize, | |
3045 | __entry->src_disize, | |
3046 | __entry->src_offset, | |
3047 | __entry->dest_ino, | |
3048 | __entry->dest_isize, | |
3049 | __entry->dest_disize, | |
3050 | __entry->dest_offset) | |
3051 | ) | |
3052 | ||
3053 | #define DEFINE_DOUBLE_IO_EVENT(name) \ | |
3054 | DEFINE_EVENT(xfs_double_io_class, name, \ | |
3055 | TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \ | |
3056 | struct xfs_inode *dest, xfs_off_t doffset), \ | |
3057 | TP_ARGS(src, soffset, len, dest, doffset)) | |
3058 | ||
53aa1c34 DW |
3059 | /* inode/irec events */ |
3060 | DECLARE_EVENT_CLASS(xfs_inode_irec_class, | |
3061 | TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), | |
3062 | TP_ARGS(ip, irec), | |
3063 | TP_STRUCT__entry( | |
3064 | __field(dev_t, dev) | |
3065 | __field(xfs_ino_t, ino) | |
3066 | __field(xfs_fileoff_t, lblk) | |
3067 | __field(xfs_extlen_t, len) | |
3068 | __field(xfs_fsblock_t, pblk) | |
5eda4300 | 3069 | __field(int, state) |
53aa1c34 DW |
3070 | ), |
3071 | TP_fast_assign( | |
3072 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
3073 | __entry->ino = ip->i_ino; | |
3074 | __entry->lblk = irec->br_startoff; | |
3075 | __entry->len = irec->br_blockcount; | |
3076 | __entry->pblk = irec->br_startblock; | |
5eda4300 | 3077 | __entry->state = irec->br_state; |
53aa1c34 | 3078 | ), |
5eda4300 | 3079 | TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x pblk %llu st %d", |
53aa1c34 DW |
3080 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3081 | __entry->ino, | |
3082 | __entry->lblk, | |
3083 | __entry->len, | |
5eda4300 DW |
3084 | __entry->pblk, |
3085 | __entry->state) | |
53aa1c34 DW |
3086 | ); |
3087 | #define DEFINE_INODE_IREC_EVENT(name) \ | |
3088 | DEFINE_EVENT(xfs_inode_irec_class, name, \ | |
3089 | TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \ | |
3090 | TP_ARGS(ip, irec)) | |
3091 | ||
3092 | /* refcount/reflink tracepoint definitions */ | |
3093 | ||
3094 | /* reflink tracepoints */ | |
3095 | DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag); | |
3096 | DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag); | |
3097 | DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size); | |
3098 | DEFINE_IOMAP_EVENT(xfs_reflink_remap_imap); | |
3099 | TRACE_EVENT(xfs_reflink_remap_blocks_loop, | |
3100 | TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset, | |
3101 | xfs_filblks_t len, struct xfs_inode *dest, | |
3102 | xfs_fileoff_t doffset), | |
3103 | TP_ARGS(src, soffset, len, dest, doffset), | |
3104 | TP_STRUCT__entry( | |
3105 | __field(dev_t, dev) | |
3106 | __field(xfs_ino_t, src_ino) | |
3107 | __field(xfs_fileoff_t, src_lblk) | |
3108 | __field(xfs_filblks_t, len) | |
3109 | __field(xfs_ino_t, dest_ino) | |
3110 | __field(xfs_fileoff_t, dest_lblk) | |
3111 | ), | |
3112 | TP_fast_assign( | |
3113 | __entry->dev = VFS_I(src)->i_sb->s_dev; | |
3114 | __entry->src_ino = src->i_ino; | |
3115 | __entry->src_lblk = soffset; | |
3116 | __entry->len = len; | |
3117 | __entry->dest_ino = dest->i_ino; | |
3118 | __entry->dest_lblk = doffset; | |
3119 | ), | |
3120 | TP_printk("dev %d:%d len 0x%llx " | |
3121 | "ino 0x%llx offset 0x%llx blocks -> " | |
3122 | "ino 0x%llx offset 0x%llx blocks", | |
3123 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3124 | __entry->len, | |
3125 | __entry->src_ino, | |
3126 | __entry->src_lblk, | |
3127 | __entry->dest_ino, | |
3128 | __entry->dest_lblk) | |
3129 | ); | |
3130 | TRACE_EVENT(xfs_reflink_punch_range, | |
3131 | TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk, | |
3132 | xfs_extlen_t len), | |
3133 | TP_ARGS(ip, lblk, len), | |
3134 | TP_STRUCT__entry( | |
3135 | __field(dev_t, dev) | |
3136 | __field(xfs_ino_t, ino) | |
3137 | __field(xfs_fileoff_t, lblk) | |
3138 | __field(xfs_extlen_t, len) | |
3139 | ), | |
3140 | TP_fast_assign( | |
3141 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
3142 | __entry->ino = ip->i_ino; | |
3143 | __entry->lblk = lblk; | |
3144 | __entry->len = len; | |
3145 | ), | |
3146 | TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x", | |
3147 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3148 | __entry->ino, | |
3149 | __entry->lblk, | |
3150 | __entry->len) | |
3151 | ); | |
3152 | TRACE_EVENT(xfs_reflink_remap, | |
3153 | TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk, | |
3154 | xfs_extlen_t len, xfs_fsblock_t new_pblk), | |
3155 | TP_ARGS(ip, lblk, len, new_pblk), | |
3156 | TP_STRUCT__entry( | |
3157 | __field(dev_t, dev) | |
3158 | __field(xfs_ino_t, ino) | |
3159 | __field(xfs_fileoff_t, lblk) | |
3160 | __field(xfs_extlen_t, len) | |
3161 | __field(xfs_fsblock_t, new_pblk) | |
3162 | ), | |
3163 | TP_fast_assign( | |
3164 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
3165 | __entry->ino = ip->i_ino; | |
3166 | __entry->lblk = lblk; | |
3167 | __entry->len = len; | |
3168 | __entry->new_pblk = new_pblk; | |
3169 | ), | |
3170 | TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x new_pblk %llu", | |
3171 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3172 | __entry->ino, | |
3173 | __entry->lblk, | |
3174 | __entry->len, | |
3175 | __entry->new_pblk) | |
3176 | ); | |
3177 | DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range); | |
3178 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error); | |
3179 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error); | |
3180 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error); | |
53aa1c34 DW |
3181 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error); |
3182 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error); | |
3183 | ||
3184 | /* dedupe tracepoints */ | |
3185 | DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents); | |
3186 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error); | |
3187 | ||
3188 | /* ioctl tracepoints */ | |
53aa1c34 DW |
3189 | TRACE_EVENT(xfs_ioctl_clone, |
3190 | TP_PROTO(struct inode *src, struct inode *dest), | |
3191 | TP_ARGS(src, dest), | |
3192 | TP_STRUCT__entry( | |
3193 | __field(dev_t, dev) | |
3194 | __field(unsigned long, src_ino) | |
3195 | __field(loff_t, src_isize) | |
3196 | __field(unsigned long, dest_ino) | |
3197 | __field(loff_t, dest_isize) | |
3198 | ), | |
3199 | TP_fast_assign( | |
3200 | __entry->dev = src->i_sb->s_dev; | |
3201 | __entry->src_ino = src->i_ino; | |
3202 | __entry->src_isize = i_size_read(src); | |
3203 | __entry->dest_ino = dest->i_ino; | |
3204 | __entry->dest_isize = i_size_read(dest); | |
3205 | ), | |
3206 | TP_printk("dev %d:%d " | |
3207 | "ino 0x%lx isize 0x%llx -> " | |
42bf9dba | 3208 | "ino 0x%lx isize 0x%llx", |
53aa1c34 DW |
3209 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3210 | __entry->src_ino, | |
3211 | __entry->src_isize, | |
3212 | __entry->dest_ino, | |
3213 | __entry->dest_isize) | |
3214 | ); | |
3215 | ||
3216 | /* unshare tracepoints */ | |
3217 | DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare); | |
53aa1c34 | 3218 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error); |
53aa1c34 DW |
3219 | |
3220 | /* copy on write */ | |
3221 | DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared); | |
be51f811 DW |
3222 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_alloc); |
3223 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found); | |
3224 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc); | |
5eda4300 | 3225 | DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow); |
53aa1c34 | 3226 | |
3ba020be | 3227 | DEFINE_RW_EVENT(xfs_reflink_reserve_cow); |
53aa1c34 | 3228 | |
54a4ef8a | 3229 | DEFINE_SIMPLE_IO_EVENT(xfs_reflink_bounce_dio_write); |
53aa1c34 DW |
3230 | DEFINE_IOMAP_EVENT(xfs_reflink_find_cow_mapping); |
3231 | DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_irec); | |
53aa1c34 DW |
3232 | |
3233 | DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range); | |
3234 | DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow); | |
3235 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap); | |
53aa1c34 | 3236 | |
53aa1c34 DW |
3237 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error); |
3238 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error); | |
3239 | ||
53aa1c34 | 3240 | |
53aa1c34 | 3241 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow); |
53aa1c34 | 3242 | |
1f08af52 DW |
3243 | /* rmap swapext tracepoints */ |
3244 | DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap); | |
3245 | DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece); | |
3246 | DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error); | |
3247 | ||
e89c0413 DW |
3248 | /* fsmap traces */ |
3249 | DECLARE_EVENT_CLASS(xfs_fsmap_class, | |
3250 | TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, | |
3251 | struct xfs_rmap_irec *rmap), | |
3252 | TP_ARGS(mp, keydev, agno, rmap), | |
3253 | TP_STRUCT__entry( | |
3254 | __field(dev_t, dev) | |
3255 | __field(dev_t, keydev) | |
3256 | __field(xfs_agnumber_t, agno) | |
3257 | __field(xfs_fsblock_t, bno) | |
3258 | __field(xfs_filblks_t, len) | |
c8ce540d DW |
3259 | __field(uint64_t, owner) |
3260 | __field(uint64_t, offset) | |
e89c0413 DW |
3261 | __field(unsigned int, flags) |
3262 | ), | |
3263 | TP_fast_assign( | |
3264 | __entry->dev = mp->m_super->s_dev; | |
3265 | __entry->keydev = new_decode_dev(keydev); | |
3266 | __entry->agno = agno; | |
3267 | __entry->bno = rmap->rm_startblock; | |
3268 | __entry->len = rmap->rm_blockcount; | |
3269 | __entry->owner = rmap->rm_owner; | |
3270 | __entry->offset = rmap->rm_offset; | |
3271 | __entry->flags = rmap->rm_flags; | |
3272 | ), | |
42bf9dba | 3273 | TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld offset %llu flags 0x%x", |
e89c0413 DW |
3274 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3275 | MAJOR(__entry->keydev), MINOR(__entry->keydev), | |
3276 | __entry->agno, | |
3277 | __entry->bno, | |
3278 | __entry->len, | |
3279 | __entry->owner, | |
3280 | __entry->offset, | |
3281 | __entry->flags) | |
3282 | ) | |
3283 | #define DEFINE_FSMAP_EVENT(name) \ | |
3284 | DEFINE_EVENT(xfs_fsmap_class, name, \ | |
3285 | TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \ | |
3286 | struct xfs_rmap_irec *rmap), \ | |
3287 | TP_ARGS(mp, keydev, agno, rmap)) | |
3288 | DEFINE_FSMAP_EVENT(xfs_fsmap_low_key); | |
3289 | DEFINE_FSMAP_EVENT(xfs_fsmap_high_key); | |
3290 | DEFINE_FSMAP_EVENT(xfs_fsmap_mapping); | |
3291 | ||
3292 | DECLARE_EVENT_CLASS(xfs_getfsmap_class, | |
3293 | TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), | |
3294 | TP_ARGS(mp, fsmap), | |
3295 | TP_STRUCT__entry( | |
3296 | __field(dev_t, dev) | |
3297 | __field(dev_t, keydev) | |
3298 | __field(xfs_daddr_t, block) | |
3299 | __field(xfs_daddr_t, len) | |
c8ce540d DW |
3300 | __field(uint64_t, owner) |
3301 | __field(uint64_t, offset) | |
3302 | __field(uint64_t, flags) | |
e89c0413 DW |
3303 | ), |
3304 | TP_fast_assign( | |
3305 | __entry->dev = mp->m_super->s_dev; | |
3306 | __entry->keydev = new_decode_dev(fsmap->fmr_device); | |
3307 | __entry->block = fsmap->fmr_physical; | |
3308 | __entry->len = fsmap->fmr_length; | |
3309 | __entry->owner = fsmap->fmr_owner; | |
3310 | __entry->offset = fsmap->fmr_offset; | |
3311 | __entry->flags = fsmap->fmr_flags; | |
3312 | ), | |
42bf9dba | 3313 | TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld offset %llu flags 0x%llx", |
e89c0413 DW |
3314 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3315 | MAJOR(__entry->keydev), MINOR(__entry->keydev), | |
3316 | __entry->block, | |
3317 | __entry->len, | |
3318 | __entry->owner, | |
3319 | __entry->offset, | |
3320 | __entry->flags) | |
3321 | ) | |
3322 | #define DEFINE_GETFSMAP_EVENT(name) \ | |
3323 | DEFINE_EVENT(xfs_getfsmap_class, name, \ | |
3324 | TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \ | |
3325 | TP_ARGS(mp, fsmap)) | |
3326 | DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key); | |
3327 | DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key); | |
3328 | DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping); | |
3329 | ||
0b1b213f CH |
3330 | #endif /* _TRACE_XFS_H */ |
3331 | ||
3332 | #undef TRACE_INCLUDE_PATH | |
3333 | #define TRACE_INCLUDE_PATH . | |
3334 | #define TRACE_INCLUDE_FILE xfs_trace | |
3335 | #include <trace/define_trace.h> |