1 | // SPDX-License-Identifier: GPL-2.0 |
2 | /* |
3 | * Copyright (c) 2009, Christoph Hellwig |
4 | * All Rights Reserved. |
5 | * |
6 | * NOTE: none of these tracepoints shall be considered a stable kernel ABI |
7 | * as they can change at any time. |
8 | * |
9 | * Current conventions for printing numbers measuring specific units: |
10 | * |
11 | * agno: allocation group number |
12 | * |
13 | * agino: per-AG inode number |
14 | * ino: filesystem inode number |
15 | * |
16 | * agbno: per-AG block number in fs blocks |
17 | * startblock: physical block number for file mappings. This is either a |
18 | * segmented fsblock for data device mappings, or a rfsblock |
19 | * for realtime device mappings |
20 | * fsbcount: number of blocks in an extent, in fs blocks |
21 | * |
22 | * daddr: physical block number in 512b blocks |
23 | * bbcount: number of blocks in a physical extent, in 512b blocks |
24 | * |
25 | * rtx: physical rt extent number for extent mappings |
26 | * rtxcount: number of rt extents in an extent mapping |
27 | * |
28 | * owner: reverse-mapping owner, usually inodes |
29 | * |
30 | * fileoff: file offset, in fs blocks |
31 | * pos: file offset, in bytes |
32 | * bytecount: number of bytes |
33 | * |
34 | * disize: ondisk file size, in bytes |
35 | * isize: incore file size, in bytes |
36 | * |
37 | * forkoff: inode fork offset, in bytes |
38 | * |
39 | * ireccount: number of inode records |
40 | * |
41 | * Numbers describing space allocations (blocks, extents, inodes) should be |
42 | * formatted in hexadecimal. |
43 | */ |
44 | #undef TRACE_SYSTEM |
45 | #define TRACE_SYSTEM xfs |
46 | |
47 | #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ) |
48 | #define _TRACE_XFS_H |
49 | |
50 | #include <linux/tracepoint.h> |
51 | |
52 | struct xfs_agf; |
53 | struct xfs_alloc_arg; |
54 | struct xfs_attr_list_context; |
55 | struct xfs_buf_log_item; |
56 | struct xfs_da_args; |
57 | struct xfs_da_node_entry; |
58 | struct xfs_dquot; |
59 | struct xfs_log_item; |
60 | struct xlog; |
61 | struct xlog_ticket; |
62 | struct xlog_recover; |
63 | struct xlog_recover_item; |
64 | struct ; |
65 | struct xlog_in_core; |
66 | struct xfs_buf_log_format; |
67 | struct xfs_inode_log_format; |
68 | struct xfs_bmbt_irec; |
69 | struct xfs_btree_cur; |
70 | struct xfs_refcount_irec; |
71 | struct xfs_fsmap; |
72 | struct xfs_rmap_irec; |
73 | struct xfs_icreate_log; |
74 | struct xfs_owner_info; |
75 | struct xfs_trans_res; |
76 | struct xfs_inobt_rec_incore; |
77 | union xfs_btree_ptr; |
78 | struct xfs_dqtrx; |
79 | struct xfs_icwalk; |
80 | struct xfs_perag; |
81 | |
82 | #define XFS_ATTR_FILTER_FLAGS \ |
83 | { XFS_ATTR_ROOT, "ROOT" }, \ |
84 | { XFS_ATTR_SECURE, "SECURE" }, \ |
85 | { XFS_ATTR_INCOMPLETE, "INCOMPLETE" } |
86 | |
87 | DECLARE_EVENT_CLASS(xfs_attr_list_class, |
88 | TP_PROTO(struct xfs_attr_list_context *ctx), |
89 | TP_ARGS(ctx), |
90 | TP_STRUCT__entry( |
91 | __field(dev_t, dev) |
92 | __field(xfs_ino_t, ino) |
93 | __field(u32, hashval) |
94 | __field(u32, blkno) |
95 | __field(u32, offset) |
96 | __field(void *, buffer) |
97 | __field(int, bufsize) |
98 | __field(int, count) |
99 | __field(int, firstu) |
100 | __field(int, dupcnt) |
101 | __field(unsigned int, attr_filter) |
102 | ), |
103 | TP_fast_assign( |
104 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; |
105 | __entry->ino = ctx->dp->i_ino; |
106 | __entry->hashval = ctx->cursor.hashval; |
107 | __entry->blkno = ctx->cursor.blkno; |
108 | __entry->offset = ctx->cursor.offset; |
109 | __entry->buffer = ctx->buffer; |
110 | __entry->bufsize = ctx->bufsize; |
111 | __entry->count = ctx->count; |
112 | __entry->firstu = ctx->firstu; |
113 | __entry->attr_filter = ctx->attr_filter; |
114 | ), |
115 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " |
116 | "buffer %p size %u count %u firstu %u filter %s" , |
117 | MAJOR(__entry->dev), MINOR(__entry->dev), |
118 | __entry->ino, |
119 | __entry->hashval, |
120 | __entry->blkno, |
121 | __entry->offset, |
122 | __entry->dupcnt, |
123 | __entry->buffer, |
124 | __entry->bufsize, |
125 | __entry->count, |
126 | __entry->firstu, |
127 | __print_flags(__entry->attr_filter, "|" , |
128 | XFS_ATTR_FILTER_FLAGS) |
129 | ) |
130 | ) |
131 | |
132 | #define DEFINE_ATTR_LIST_EVENT(name) \ |
133 | DEFINE_EVENT(xfs_attr_list_class, name, \ |
134 | TP_PROTO(struct xfs_attr_list_context *ctx), \ |
135 | TP_ARGS(ctx)) |
136 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf); |
137 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all); |
138 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf); |
139 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end); |
140 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full); |
141 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add); |
142 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk); |
143 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound); |
144 | DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list); |
145 | DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list); |
146 | |
147 | TRACE_EVENT(xlog_intent_recovery_failed, |
148 | TP_PROTO(struct xfs_mount *mp, int error, void *function), |
149 | TP_ARGS(mp, error, function), |
150 | TP_STRUCT__entry( |
151 | __field(dev_t, dev) |
152 | __field(int, error) |
153 | __field(void *, function) |
154 | ), |
155 | TP_fast_assign( |
156 | __entry->dev = mp->m_super->s_dev; |
157 | __entry->error = error; |
158 | __entry->function = function; |
159 | ), |
160 | TP_printk("dev %d:%d error %d function %pS" , |
161 | MAJOR(__entry->dev), MINOR(__entry->dev), |
162 | __entry->error, __entry->function) |
163 | ); |
164 | |
165 | DECLARE_EVENT_CLASS(xfs_perag_class, |
166 | TP_PROTO(struct xfs_perag *pag, unsigned long caller_ip), |
167 | TP_ARGS(pag, caller_ip), |
168 | TP_STRUCT__entry( |
169 | __field(dev_t, dev) |
170 | __field(xfs_agnumber_t, agno) |
171 | __field(int, refcount) |
172 | __field(int, active_refcount) |
173 | __field(unsigned long, caller_ip) |
174 | ), |
175 | TP_fast_assign( |
176 | __entry->dev = pag->pag_mount->m_super->s_dev; |
177 | __entry->agno = pag->pag_agno; |
178 | __entry->refcount = atomic_read(&pag->pag_ref); |
179 | __entry->active_refcount = atomic_read(&pag->pag_active_ref); |
180 | __entry->caller_ip = caller_ip; |
181 | ), |
182 | TP_printk("dev %d:%d agno 0x%x passive refs %d active refs %d caller %pS" , |
183 | MAJOR(__entry->dev), MINOR(__entry->dev), |
184 | __entry->agno, |
185 | __entry->refcount, |
186 | __entry->active_refcount, |
187 | (char *)__entry->caller_ip) |
188 | ); |
189 | |
190 | #define DEFINE_PERAG_REF_EVENT(name) \ |
191 | DEFINE_EVENT(xfs_perag_class, name, \ |
192 | TP_PROTO(struct xfs_perag *pag, unsigned long caller_ip), \ |
193 | TP_ARGS(pag, caller_ip)) |
194 | DEFINE_PERAG_REF_EVENT(xfs_perag_get); |
195 | DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag); |
196 | DEFINE_PERAG_REF_EVENT(xfs_perag_hold); |
197 | DEFINE_PERAG_REF_EVENT(xfs_perag_put); |
198 | DEFINE_PERAG_REF_EVENT(xfs_perag_grab); |
199 | DEFINE_PERAG_REF_EVENT(xfs_perag_grab_tag); |
200 | DEFINE_PERAG_REF_EVENT(xfs_perag_rele); |
201 | DEFINE_PERAG_REF_EVENT(xfs_perag_set_inode_tag); |
202 | DEFINE_PERAG_REF_EVENT(xfs_perag_clear_inode_tag); |
203 | |
204 | TRACE_EVENT(xfs_inodegc_worker, |
205 | TP_PROTO(struct xfs_mount *mp, unsigned int shrinker_hits), |
206 | TP_ARGS(mp, shrinker_hits), |
207 | TP_STRUCT__entry( |
208 | __field(dev_t, dev) |
209 | __field(unsigned int, shrinker_hits) |
210 | ), |
211 | TP_fast_assign( |
212 | __entry->dev = mp->m_super->s_dev; |
213 | __entry->shrinker_hits = shrinker_hits; |
214 | ), |
215 | TP_printk("dev %d:%d shrinker_hits %u" , |
216 | MAJOR(__entry->dev), MINOR(__entry->dev), |
217 | __entry->shrinker_hits) |
218 | ); |
219 | |
220 | DECLARE_EVENT_CLASS(xfs_fs_class, |
221 | TP_PROTO(struct xfs_mount *mp, void *caller_ip), |
222 | TP_ARGS(mp, caller_ip), |
223 | TP_STRUCT__entry( |
224 | __field(dev_t, dev) |
225 | __field(unsigned long long, mflags) |
226 | __field(unsigned long, opstate) |
227 | __field(unsigned long, sbflags) |
228 | __field(void *, caller_ip) |
229 | ), |
230 | TP_fast_assign( |
231 | if (mp) { |
232 | __entry->dev = mp->m_super->s_dev; |
233 | __entry->mflags = mp->m_features; |
234 | __entry->opstate = mp->m_opstate; |
235 | __entry->sbflags = mp->m_super->s_flags; |
236 | } |
237 | __entry->caller_ip = caller_ip; |
238 | ), |
239 | TP_printk("dev %d:%d m_features 0x%llx opstate (%s) s_flags 0x%lx caller %pS" , |
240 | MAJOR(__entry->dev), MINOR(__entry->dev), |
241 | __entry->mflags, |
242 | __print_flags(__entry->opstate, "|" , XFS_OPSTATE_STRINGS), |
243 | __entry->sbflags, |
244 | __entry->caller_ip) |
245 | ); |
246 | |
247 | #define DEFINE_FS_EVENT(name) \ |
248 | DEFINE_EVENT(xfs_fs_class, name, \ |
249 | TP_PROTO(struct xfs_mount *mp, void *caller_ip), \ |
250 | TP_ARGS(mp, caller_ip)) |
251 | DEFINE_FS_EVENT(xfs_inodegc_flush); |
252 | DEFINE_FS_EVENT(xfs_inodegc_push); |
253 | DEFINE_FS_EVENT(xfs_inodegc_start); |
254 | DEFINE_FS_EVENT(xfs_inodegc_stop); |
255 | DEFINE_FS_EVENT(xfs_inodegc_queue); |
256 | DEFINE_FS_EVENT(xfs_inodegc_throttle); |
257 | DEFINE_FS_EVENT(xfs_fs_sync_fs); |
258 | DEFINE_FS_EVENT(xfs_blockgc_start); |
259 | DEFINE_FS_EVENT(xfs_blockgc_stop); |
260 | DEFINE_FS_EVENT(xfs_blockgc_worker); |
261 | DEFINE_FS_EVENT(xfs_blockgc_flush_all); |
262 | |
263 | TRACE_EVENT(xfs_inodegc_shrinker_scan, |
264 | TP_PROTO(struct xfs_mount *mp, struct shrink_control *sc, |
265 | void *caller_ip), |
266 | TP_ARGS(mp, sc, caller_ip), |
267 | TP_STRUCT__entry( |
268 | __field(dev_t, dev) |
269 | __field(unsigned long, nr_to_scan) |
270 | __field(void *, caller_ip) |
271 | ), |
272 | TP_fast_assign( |
273 | __entry->dev = mp->m_super->s_dev; |
274 | __entry->nr_to_scan = sc->nr_to_scan; |
275 | __entry->caller_ip = caller_ip; |
276 | ), |
277 | TP_printk("dev %d:%d nr_to_scan %lu caller %pS" , |
278 | MAJOR(__entry->dev), MINOR(__entry->dev), |
279 | __entry->nr_to_scan, |
280 | __entry->caller_ip) |
281 | ); |
282 | |
283 | DECLARE_EVENT_CLASS(xfs_ag_class, |
284 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), |
285 | TP_ARGS(mp, agno), |
286 | TP_STRUCT__entry( |
287 | __field(dev_t, dev) |
288 | __field(xfs_agnumber_t, agno) |
289 | ), |
290 | TP_fast_assign( |
291 | __entry->dev = mp->m_super->s_dev; |
292 | __entry->agno = agno; |
293 | ), |
294 | TP_printk("dev %d:%d agno 0x%x" , |
295 | MAJOR(__entry->dev), MINOR(__entry->dev), |
296 | __entry->agno) |
297 | ); |
298 | #define DEFINE_AG_EVENT(name) \ |
299 | DEFINE_EVENT(xfs_ag_class, name, \ |
300 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \ |
301 | TP_ARGS(mp, agno)) |
302 | |
303 | DEFINE_AG_EVENT(xfs_read_agf); |
304 | DEFINE_AG_EVENT(xfs_alloc_read_agf); |
305 | DEFINE_AG_EVENT(xfs_read_agi); |
306 | DEFINE_AG_EVENT(xfs_ialloc_read_agi); |
307 | |
308 | TRACE_EVENT(xfs_attr_list_node_descend, |
309 | TP_PROTO(struct xfs_attr_list_context *ctx, |
310 | struct xfs_da_node_entry *btree), |
311 | TP_ARGS(ctx, btree), |
312 | TP_STRUCT__entry( |
313 | __field(dev_t, dev) |
314 | __field(xfs_ino_t, ino) |
315 | __field(u32, hashval) |
316 | __field(u32, blkno) |
317 | __field(u32, offset) |
318 | __field(void *, buffer) |
319 | __field(int, bufsize) |
320 | __field(int, count) |
321 | __field(int, firstu) |
322 | __field(int, dupcnt) |
323 | __field(unsigned int, attr_filter) |
324 | __field(u32, bt_hashval) |
325 | __field(u32, bt_before) |
326 | ), |
327 | TP_fast_assign( |
328 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; |
329 | __entry->ino = ctx->dp->i_ino; |
330 | __entry->hashval = ctx->cursor.hashval; |
331 | __entry->blkno = ctx->cursor.blkno; |
332 | __entry->offset = ctx->cursor.offset; |
333 | __entry->buffer = ctx->buffer; |
334 | __entry->bufsize = ctx->bufsize; |
335 | __entry->count = ctx->count; |
336 | __entry->firstu = ctx->firstu; |
337 | __entry->attr_filter = ctx->attr_filter; |
338 | __entry->bt_hashval = be32_to_cpu(btree->hashval); |
339 | __entry->bt_before = be32_to_cpu(btree->before); |
340 | ), |
341 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " |
342 | "buffer %p size %u count %u firstu %u filter %s " |
343 | "node hashval %u, node before %u" , |
344 | MAJOR(__entry->dev), MINOR(__entry->dev), |
345 | __entry->ino, |
346 | __entry->hashval, |
347 | __entry->blkno, |
348 | __entry->offset, |
349 | __entry->dupcnt, |
350 | __entry->buffer, |
351 | __entry->bufsize, |
352 | __entry->count, |
353 | __entry->firstu, |
354 | __print_flags(__entry->attr_filter, "|" , |
355 | XFS_ATTR_FILTER_FLAGS), |
356 | __entry->bt_hashval, |
357 | __entry->bt_before) |
358 | ); |
359 | |
360 | DECLARE_EVENT_CLASS(xfs_bmap_class, |
361 | TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, |
362 | unsigned long caller_ip), |
363 | TP_ARGS(ip, cur, state, caller_ip), |
364 | TP_STRUCT__entry( |
365 | __field(dev_t, dev) |
366 | __field(xfs_ino_t, ino) |
367 | __field(void *, leaf) |
368 | __field(int, pos) |
369 | __field(xfs_fileoff_t, startoff) |
370 | __field(xfs_fsblock_t, startblock) |
371 | __field(xfs_filblks_t, blockcount) |
372 | __field(xfs_exntst_t, state) |
373 | __field(int, bmap_state) |
374 | __field(unsigned long, caller_ip) |
375 | ), |
376 | TP_fast_assign( |
377 | struct xfs_ifork *ifp; |
378 | struct xfs_bmbt_irec r; |
379 | |
380 | ifp = xfs_iext_state_to_fork(ip, state); |
381 | xfs_iext_get_extent(ifp, cur, &r); |
382 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
383 | __entry->ino = ip->i_ino; |
384 | __entry->leaf = cur->leaf; |
385 | __entry->pos = cur->pos; |
386 | __entry->startoff = r.br_startoff; |
387 | __entry->startblock = r.br_startblock; |
388 | __entry->blockcount = r.br_blockcount; |
389 | __entry->state = r.br_state; |
390 | __entry->bmap_state = state; |
391 | __entry->caller_ip = caller_ip; |
392 | ), |
393 | TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d " |
394 | "fileoff 0x%llx startblock 0x%llx fsbcount 0x%llx flag %d caller %pS" , |
395 | MAJOR(__entry->dev), MINOR(__entry->dev), |
396 | __entry->ino, |
397 | __print_flags(__entry->bmap_state, "|" , XFS_BMAP_EXT_FLAGS), |
398 | __entry->leaf, |
399 | __entry->pos, |
400 | __entry->startoff, |
401 | (int64_t)__entry->startblock, |
402 | __entry->blockcount, |
403 | __entry->state, |
404 | (char *)__entry->caller_ip) |
405 | ) |
406 | |
407 | #define DEFINE_BMAP_EVENT(name) \ |
408 | DEFINE_EVENT(xfs_bmap_class, name, \ |
409 | TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \ |
410 | unsigned long caller_ip), \ |
411 | TP_ARGS(ip, cur, state, caller_ip)) |
412 | DEFINE_BMAP_EVENT(xfs_iext_insert); |
413 | DEFINE_BMAP_EVENT(xfs_iext_remove); |
414 | DEFINE_BMAP_EVENT(xfs_bmap_pre_update); |
415 | DEFINE_BMAP_EVENT(xfs_bmap_post_update); |
416 | DEFINE_BMAP_EVENT(xfs_read_extent); |
417 | DEFINE_BMAP_EVENT(xfs_write_extent); |
418 | |
419 | DECLARE_EVENT_CLASS(xfs_buf_class, |
420 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), |
421 | TP_ARGS(bp, caller_ip), |
422 | TP_STRUCT__entry( |
423 | __field(dev_t, dev) |
424 | __field(xfs_daddr_t, bno) |
425 | __field(int, nblks) |
426 | __field(int, hold) |
427 | __field(int, pincount) |
428 | __field(unsigned, lockval) |
429 | __field(unsigned, flags) |
430 | __field(unsigned long, caller_ip) |
431 | __field(const void *, buf_ops) |
432 | ), |
433 | TP_fast_assign( |
434 | __entry->dev = bp->b_target->bt_dev; |
435 | __entry->bno = xfs_buf_daddr(bp); |
436 | __entry->nblks = bp->b_length; |
437 | __entry->hold = atomic_read(&bp->b_hold); |
438 | __entry->pincount = atomic_read(&bp->b_pin_count); |
439 | __entry->lockval = bp->b_sema.count; |
440 | __entry->flags = bp->b_flags; |
441 | __entry->caller_ip = caller_ip; |
442 | __entry->buf_ops = bp->b_ops; |
443 | ), |
444 | TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d " |
445 | "lock %d flags %s bufops %pS caller %pS" , |
446 | MAJOR(__entry->dev), MINOR(__entry->dev), |
447 | (unsigned long long)__entry->bno, |
448 | __entry->nblks, |
449 | __entry->hold, |
450 | __entry->pincount, |
451 | __entry->lockval, |
452 | __print_flags(__entry->flags, "|" , XFS_BUF_FLAGS), |
453 | __entry->buf_ops, |
454 | (void *)__entry->caller_ip) |
455 | ) |
456 | |
457 | #define DEFINE_BUF_EVENT(name) \ |
458 | DEFINE_EVENT(xfs_buf_class, name, \ |
459 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \ |
460 | TP_ARGS(bp, caller_ip)) |
461 | DEFINE_BUF_EVENT(xfs_buf_init); |
462 | DEFINE_BUF_EVENT(xfs_buf_free); |
463 | DEFINE_BUF_EVENT(xfs_buf_hold); |
464 | DEFINE_BUF_EVENT(xfs_buf_rele); |
465 | DEFINE_BUF_EVENT(xfs_buf_iodone); |
466 | DEFINE_BUF_EVENT(xfs_buf_submit); |
467 | DEFINE_BUF_EVENT(xfs_buf_lock); |
468 | DEFINE_BUF_EVENT(xfs_buf_lock_done); |
469 | DEFINE_BUF_EVENT(xfs_buf_trylock_fail); |
470 | DEFINE_BUF_EVENT(xfs_buf_trylock); |
471 | DEFINE_BUF_EVENT(xfs_buf_unlock); |
472 | DEFINE_BUF_EVENT(xfs_buf_iowait); |
473 | DEFINE_BUF_EVENT(xfs_buf_iowait_done); |
474 | DEFINE_BUF_EVENT(xfs_buf_delwri_queue); |
475 | DEFINE_BUF_EVENT(xfs_buf_delwri_queued); |
476 | DEFINE_BUF_EVENT(xfs_buf_delwri_split); |
477 | DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf); |
478 | DEFINE_BUF_EVENT(xfs_buf_get_uncached); |
479 | DEFINE_BUF_EVENT(xfs_buf_item_relse); |
480 | DEFINE_BUF_EVENT(xfs_buf_iodone_async); |
481 | DEFINE_BUF_EVENT(xfs_buf_error_relse); |
482 | DEFINE_BUF_EVENT(xfs_buf_drain_buftarg); |
483 | DEFINE_BUF_EVENT(xfs_trans_read_buf_shut); |
484 | |
485 | /* not really buffer traces, but the buf provides useful information */ |
486 | DEFINE_BUF_EVENT(xfs_btree_corrupt); |
487 | DEFINE_BUF_EVENT(xfs_reset_dqcounts); |
488 | |
489 | /* pass flags explicitly */ |
490 | DECLARE_EVENT_CLASS(xfs_buf_flags_class, |
491 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), |
492 | TP_ARGS(bp, flags, caller_ip), |
493 | TP_STRUCT__entry( |
494 | __field(dev_t, dev) |
495 | __field(xfs_daddr_t, bno) |
496 | __field(unsigned int, length) |
497 | __field(int, hold) |
498 | __field(int, pincount) |
499 | __field(unsigned, lockval) |
500 | __field(unsigned, flags) |
501 | __field(unsigned long, caller_ip) |
502 | ), |
503 | TP_fast_assign( |
504 | __entry->dev = bp->b_target->bt_dev; |
505 | __entry->bno = xfs_buf_daddr(bp); |
506 | __entry->length = bp->b_length; |
507 | __entry->flags = flags; |
508 | __entry->hold = atomic_read(&bp->b_hold); |
509 | __entry->pincount = atomic_read(&bp->b_pin_count); |
510 | __entry->lockval = bp->b_sema.count; |
511 | __entry->caller_ip = caller_ip; |
512 | ), |
513 | TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d " |
514 | "lock %d flags %s caller %pS" , |
515 | MAJOR(__entry->dev), MINOR(__entry->dev), |
516 | (unsigned long long)__entry->bno, |
517 | __entry->length, |
518 | __entry->hold, |
519 | __entry->pincount, |
520 | __entry->lockval, |
521 | __print_flags(__entry->flags, "|" , XFS_BUF_FLAGS), |
522 | (void *)__entry->caller_ip) |
523 | ) |
524 | |
525 | #define DEFINE_BUF_FLAGS_EVENT(name) \ |
526 | DEFINE_EVENT(xfs_buf_flags_class, name, \ |
527 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \ |
528 | TP_ARGS(bp, flags, caller_ip)) |
529 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_find); |
530 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_get); |
531 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_read); |
532 | |
533 | TRACE_EVENT(xfs_buf_ioerror, |
534 | TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip), |
535 | TP_ARGS(bp, error, caller_ip), |
536 | TP_STRUCT__entry( |
537 | __field(dev_t, dev) |
538 | __field(xfs_daddr_t, bno) |
539 | __field(unsigned int, length) |
540 | __field(unsigned, flags) |
541 | __field(int, hold) |
542 | __field(int, pincount) |
543 | __field(unsigned, lockval) |
544 | __field(int, error) |
545 | __field(xfs_failaddr_t, caller_ip) |
546 | ), |
547 | TP_fast_assign( |
548 | __entry->dev = bp->b_target->bt_dev; |
549 | __entry->bno = xfs_buf_daddr(bp); |
550 | __entry->length = bp->b_length; |
551 | __entry->hold = atomic_read(&bp->b_hold); |
552 | __entry->pincount = atomic_read(&bp->b_pin_count); |
553 | __entry->lockval = bp->b_sema.count; |
554 | __entry->error = error; |
555 | __entry->flags = bp->b_flags; |
556 | __entry->caller_ip = caller_ip; |
557 | ), |
558 | TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d " |
559 | "lock %d error %d flags %s caller %pS" , |
560 | MAJOR(__entry->dev), MINOR(__entry->dev), |
561 | (unsigned long long)__entry->bno, |
562 | __entry->length, |
563 | __entry->hold, |
564 | __entry->pincount, |
565 | __entry->lockval, |
566 | __entry->error, |
567 | __print_flags(__entry->flags, "|" , XFS_BUF_FLAGS), |
568 | (void *)__entry->caller_ip) |
569 | ); |
570 | |
571 | DECLARE_EVENT_CLASS(xfs_buf_item_class, |
572 | TP_PROTO(struct xfs_buf_log_item *bip), |
573 | TP_ARGS(bip), |
574 | TP_STRUCT__entry( |
575 | __field(dev_t, dev) |
576 | __field(xfs_daddr_t, buf_bno) |
577 | __field(unsigned int, buf_len) |
578 | __field(int, buf_hold) |
579 | __field(int, buf_pincount) |
580 | __field(int, buf_lockval) |
581 | __field(unsigned, buf_flags) |
582 | __field(unsigned, bli_recur) |
583 | __field(int, bli_refcount) |
584 | __field(unsigned, bli_flags) |
585 | __field(unsigned long, li_flags) |
586 | ), |
587 | TP_fast_assign( |
588 | __entry->dev = bip->bli_buf->b_target->bt_dev; |
589 | __entry->bli_flags = bip->bli_flags; |
590 | __entry->bli_recur = bip->bli_recur; |
591 | __entry->bli_refcount = atomic_read(&bip->bli_refcount); |
592 | __entry->buf_bno = xfs_buf_daddr(bip->bli_buf); |
593 | __entry->buf_len = bip->bli_buf->b_length; |
594 | __entry->buf_flags = bip->bli_buf->b_flags; |
595 | __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold); |
596 | __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count); |
597 | __entry->buf_lockval = bip->bli_buf->b_sema.count; |
598 | __entry->li_flags = bip->bli_item.li_flags; |
599 | ), |
600 | TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d " |
601 | "lock %d flags %s recur %d refcount %d bliflags %s " |
602 | "liflags %s" , |
603 | MAJOR(__entry->dev), MINOR(__entry->dev), |
604 | (unsigned long long)__entry->buf_bno, |
605 | __entry->buf_len, |
606 | __entry->buf_hold, |
607 | __entry->buf_pincount, |
608 | __entry->buf_lockval, |
609 | __print_flags(__entry->buf_flags, "|" , XFS_BUF_FLAGS), |
610 | __entry->bli_recur, |
611 | __entry->bli_refcount, |
612 | __print_flags(__entry->bli_flags, "|" , XFS_BLI_FLAGS), |
613 | __print_flags(__entry->li_flags, "|" , XFS_LI_FLAGS)) |
614 | ) |
615 | |
616 | #define DEFINE_BUF_ITEM_EVENT(name) \ |
617 | DEFINE_EVENT(xfs_buf_item_class, name, \ |
618 | TP_PROTO(struct xfs_buf_log_item *bip), \ |
619 | TP_ARGS(bip)) |
620 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size); |
621 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered); |
622 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale); |
623 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format); |
624 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale); |
625 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered); |
626 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin); |
627 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin); |
628 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale); |
629 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release); |
630 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed); |
631 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push); |
632 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf); |
633 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur); |
634 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb); |
635 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur); |
636 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf); |
637 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur); |
638 | DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf); |
639 | DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse); |
640 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin); |
641 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold); |
642 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release); |
643 | DEFINE_BUF_ITEM_EVENT(xfs_trans_binval); |
644 | |
645 | DECLARE_EVENT_CLASS(xfs_filestream_class, |
646 | TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino), |
647 | TP_ARGS(pag, ino), |
648 | TP_STRUCT__entry( |
649 | __field(dev_t, dev) |
650 | __field(xfs_ino_t, ino) |
651 | __field(xfs_agnumber_t, agno) |
652 | __field(int, streams) |
653 | ), |
654 | TP_fast_assign( |
655 | __entry->dev = pag->pag_mount->m_super->s_dev; |
656 | __entry->ino = ino; |
657 | __entry->agno = pag->pag_agno; |
658 | __entry->streams = atomic_read(&pag->pagf_fstrms); |
659 | ), |
660 | TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d" , |
661 | MAJOR(__entry->dev), MINOR(__entry->dev), |
662 | __entry->ino, |
663 | __entry->agno, |
664 | __entry->streams) |
665 | ) |
666 | #define DEFINE_FILESTREAM_EVENT(name) \ |
667 | DEFINE_EVENT(xfs_filestream_class, name, \ |
668 | TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino), \ |
669 | TP_ARGS(pag, ino)) |
670 | DEFINE_FILESTREAM_EVENT(xfs_filestream_free); |
671 | DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup); |
672 | DEFINE_FILESTREAM_EVENT(xfs_filestream_scan); |
673 | |
674 | TRACE_EVENT(xfs_filestream_pick, |
675 | TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino, xfs_extlen_t free), |
676 | TP_ARGS(pag, ino, free), |
677 | TP_STRUCT__entry( |
678 | __field(dev_t, dev) |
679 | __field(xfs_ino_t, ino) |
680 | __field(xfs_agnumber_t, agno) |
681 | __field(int, streams) |
682 | __field(xfs_extlen_t, free) |
683 | ), |
684 | TP_fast_assign( |
685 | __entry->dev = pag->pag_mount->m_super->s_dev; |
686 | __entry->ino = ino; |
687 | if (pag) { |
688 | __entry->agno = pag->pag_agno; |
689 | __entry->streams = atomic_read(&pag->pagf_fstrms); |
690 | } else { |
691 | __entry->agno = NULLAGNUMBER; |
692 | __entry->streams = 0; |
693 | } |
694 | __entry->free = free; |
695 | ), |
696 | TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d free %d" , |
697 | MAJOR(__entry->dev), MINOR(__entry->dev), |
698 | __entry->ino, |
699 | __entry->agno, |
700 | __entry->streams, |
701 | __entry->free) |
702 | ); |
703 | |
704 | DECLARE_EVENT_CLASS(xfs_lock_class, |
705 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, |
706 | unsigned long caller_ip), |
707 | TP_ARGS(ip, lock_flags, caller_ip), |
708 | TP_STRUCT__entry( |
709 | __field(dev_t, dev) |
710 | __field(xfs_ino_t, ino) |
711 | __field(int, lock_flags) |
712 | __field(unsigned long, caller_ip) |
713 | ), |
714 | TP_fast_assign( |
715 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
716 | __entry->ino = ip->i_ino; |
717 | __entry->lock_flags = lock_flags; |
718 | __entry->caller_ip = caller_ip; |
719 | ), |
720 | TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS" , |
721 | MAJOR(__entry->dev), MINOR(__entry->dev), |
722 | __entry->ino, |
723 | __print_flags(__entry->lock_flags, "|" , XFS_LOCK_FLAGS), |
724 | (void *)__entry->caller_ip) |
725 | ) |
726 | |
727 | #define DEFINE_LOCK_EVENT(name) \ |
728 | DEFINE_EVENT(xfs_lock_class, name, \ |
729 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \ |
730 | unsigned long caller_ip), \ |
731 | TP_ARGS(ip, lock_flags, caller_ip)) |
732 | DEFINE_LOCK_EVENT(xfs_ilock); |
733 | DEFINE_LOCK_EVENT(xfs_ilock_nowait); |
734 | DEFINE_LOCK_EVENT(xfs_ilock_demote); |
735 | DEFINE_LOCK_EVENT(xfs_iunlock); |
736 | |
737 | DECLARE_EVENT_CLASS(xfs_inode_class, |
738 | TP_PROTO(struct xfs_inode *ip), |
739 | TP_ARGS(ip), |
740 | TP_STRUCT__entry( |
741 | __field(dev_t, dev) |
742 | __field(xfs_ino_t, ino) |
743 | __field(unsigned long, iflags) |
744 | ), |
745 | TP_fast_assign( |
746 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
747 | __entry->ino = ip->i_ino; |
748 | __entry->iflags = ip->i_flags; |
749 | ), |
750 | TP_printk("dev %d:%d ino 0x%llx iflags 0x%lx" , |
751 | MAJOR(__entry->dev), MINOR(__entry->dev), |
752 | __entry->ino, |
753 | __entry->iflags) |
754 | ) |
755 | |
756 | #define DEFINE_INODE_EVENT(name) \ |
757 | DEFINE_EVENT(xfs_inode_class, name, \ |
758 | TP_PROTO(struct xfs_inode * |
---|