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; | |
33 | struct xlog_ticket; | |
34 | struct log; | |
35 | ||
ea9a4888 CH |
36 | DECLARE_EVENT_CLASS(xfs_attr_list_class, |
37 | TP_PROTO(struct xfs_attr_list_context *ctx), | |
38 | TP_ARGS(ctx), | |
39 | TP_STRUCT__entry( | |
40 | __field(dev_t, dev) | |
41 | __field(xfs_ino_t, ino) | |
42 | __field(u32, hashval) | |
43 | __field(u32, blkno) | |
44 | __field(u32, offset) | |
45 | __field(void *, alist) | |
46 | __field(int, bufsize) | |
47 | __field(int, count) | |
48 | __field(int, firstu) | |
49 | __field(int, dupcnt) | |
50 | __field(int, flags) | |
51 | ), | |
52 | TP_fast_assign( | |
53 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; | |
54 | __entry->ino = ctx->dp->i_ino; | |
55 | __entry->hashval = ctx->cursor->hashval; | |
56 | __entry->blkno = ctx->cursor->blkno; | |
57 | __entry->offset = ctx->cursor->offset; | |
58 | __entry->alist = ctx->alist; | |
59 | __entry->bufsize = ctx->bufsize; | |
60 | __entry->count = ctx->count; | |
61 | __entry->firstu = ctx->firstu; | |
62 | __entry->flags = ctx->flags; | |
63 | ), | |
64 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " | |
65 | "alist 0x%p size %u count %u firstu %u flags %d %s", | |
66 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
67 | __entry->ino, | |
68 | __entry->hashval, | |
69 | __entry->blkno, | |
70 | __entry->offset, | |
71 | __entry->dupcnt, | |
72 | __entry->alist, | |
73 | __entry->bufsize, | |
74 | __entry->count, | |
75 | __entry->firstu, | |
76 | __entry->flags, | |
77 | __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS) | |
78 | ) | |
79 | ) | |
80 | ||
0fa800fb DC |
81 | #define DEFINE_PERAG_REF_EVENT(name) \ |
82 | TRACE_EVENT(name, \ | |
83 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \ | |
84 | unsigned long caller_ip), \ | |
85 | TP_ARGS(mp, agno, refcount, caller_ip), \ | |
86 | TP_STRUCT__entry( \ | |
87 | __field(dev_t, dev) \ | |
88 | __field(xfs_agnumber_t, agno) \ | |
89 | __field(int, refcount) \ | |
90 | __field(unsigned long, caller_ip) \ | |
91 | ), \ | |
92 | TP_fast_assign( \ | |
93 | __entry->dev = mp->m_super->s_dev; \ | |
94 | __entry->agno = agno; \ | |
95 | __entry->refcount = refcount; \ | |
96 | __entry->caller_ip = caller_ip; \ | |
97 | ), \ | |
98 | TP_printk("dev %d:%d agno %u refcount %d caller %pf", \ | |
99 | MAJOR(__entry->dev), MINOR(__entry->dev), \ | |
100 | __entry->agno, \ | |
101 | __entry->refcount, \ | |
102 | (char *)__entry->caller_ip) \ | |
103 | ); | |
104 | ||
105 | DEFINE_PERAG_REF_EVENT(xfs_perag_get) | |
106 | DEFINE_PERAG_REF_EVENT(xfs_perag_put) | |
107 | ||
0b1b213f | 108 | #define DEFINE_ATTR_LIST_EVENT(name) \ |
ea9a4888 | 109 | DEFINE_EVENT(xfs_attr_list_class, name, \ |
0b1b213f | 110 | TP_PROTO(struct xfs_attr_list_context *ctx), \ |
ea9a4888 | 111 | TP_ARGS(ctx)) |
0b1b213f CH |
112 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf); |
113 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all); | |
114 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf); | |
115 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end); | |
116 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full); | |
117 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add); | |
118 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk); | |
119 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound); | |
120 | ||
121 | TRACE_EVENT(xfs_attr_list_node_descend, | |
122 | TP_PROTO(struct xfs_attr_list_context *ctx, | |
123 | struct xfs_da_node_entry *btree), | |
124 | TP_ARGS(ctx, btree), | |
125 | TP_STRUCT__entry( | |
126 | __field(dev_t, dev) | |
127 | __field(xfs_ino_t, ino) | |
128 | __field(u32, hashval) | |
129 | __field(u32, blkno) | |
130 | __field(u32, offset) | |
131 | __field(void *, alist) | |
132 | __field(int, bufsize) | |
133 | __field(int, count) | |
134 | __field(int, firstu) | |
135 | __field(int, dupcnt) | |
136 | __field(int, flags) | |
137 | __field(u32, bt_hashval) | |
138 | __field(u32, bt_before) | |
139 | ), | |
140 | TP_fast_assign( | |
141 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; | |
142 | __entry->ino = ctx->dp->i_ino; | |
143 | __entry->hashval = ctx->cursor->hashval; | |
144 | __entry->blkno = ctx->cursor->blkno; | |
145 | __entry->offset = ctx->cursor->offset; | |
146 | __entry->alist = ctx->alist; | |
147 | __entry->bufsize = ctx->bufsize; | |
148 | __entry->count = ctx->count; | |
149 | __entry->firstu = ctx->firstu; | |
150 | __entry->flags = ctx->flags; | |
151 | __entry->bt_hashval = be32_to_cpu(btree->hashval); | |
152 | __entry->bt_before = be32_to_cpu(btree->before); | |
153 | ), | |
154 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " | |
155 | "alist 0x%p size %u count %u firstu %u flags %d %s " | |
156 | "node hashval %u, node before %u", | |
157 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
158 | __entry->ino, | |
159 | __entry->hashval, | |
160 | __entry->blkno, | |
161 | __entry->offset, | |
162 | __entry->dupcnt, | |
163 | __entry->alist, | |
164 | __entry->bufsize, | |
165 | __entry->count, | |
166 | __entry->firstu, | |
167 | __entry->flags, | |
168 | __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS), | |
169 | __entry->bt_hashval, | |
170 | __entry->bt_before) | |
171 | ); | |
172 | ||
173 | TRACE_EVENT(xfs_iext_insert, | |
174 | TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, | |
175 | struct xfs_bmbt_irec *r, int state, unsigned long caller_ip), | |
176 | TP_ARGS(ip, idx, r, state, caller_ip), | |
177 | TP_STRUCT__entry( | |
178 | __field(dev_t, dev) | |
179 | __field(xfs_ino_t, ino) | |
180 | __field(xfs_extnum_t, idx) | |
181 | __field(xfs_fileoff_t, startoff) | |
182 | __field(xfs_fsblock_t, startblock) | |
183 | __field(xfs_filblks_t, blockcount) | |
184 | __field(xfs_exntst_t, state) | |
185 | __field(int, bmap_state) | |
186 | __field(unsigned long, caller_ip) | |
187 | ), | |
188 | TP_fast_assign( | |
189 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
190 | __entry->ino = ip->i_ino; | |
191 | __entry->idx = idx; | |
192 | __entry->startoff = r->br_startoff; | |
193 | __entry->startblock = r->br_startblock; | |
194 | __entry->blockcount = r->br_blockcount; | |
195 | __entry->state = r->br_state; | |
196 | __entry->bmap_state = state; | |
197 | __entry->caller_ip = caller_ip; | |
198 | ), | |
199 | TP_printk("dev %d:%d ino 0x%llx state %s idx %ld " | |
200 | "offset %lld block %s count %lld flag %d caller %pf", | |
201 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
202 | __entry->ino, | |
203 | __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), | |
204 | (long)__entry->idx, | |
205 | __entry->startoff, | |
206 | xfs_fmtfsblock(__entry->startblock), | |
207 | __entry->blockcount, | |
208 | __entry->state, | |
209 | (char *)__entry->caller_ip) | |
210 | ); | |
211 | ||
ea9a4888 CH |
212 | DECLARE_EVENT_CLASS(xfs_bmap_class, |
213 | TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, | |
214 | unsigned long caller_ip), | |
215 | TP_ARGS(ip, idx, state, caller_ip), | |
216 | TP_STRUCT__entry( | |
217 | __field(dev_t, dev) | |
218 | __field(xfs_ino_t, ino) | |
219 | __field(xfs_extnum_t, idx) | |
220 | __field(xfs_fileoff_t, startoff) | |
221 | __field(xfs_fsblock_t, startblock) | |
222 | __field(xfs_filblks_t, blockcount) | |
223 | __field(xfs_exntst_t, state) | |
224 | __field(int, bmap_state) | |
225 | __field(unsigned long, caller_ip) | |
226 | ), | |
227 | TP_fast_assign( | |
228 | struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ? | |
229 | ip->i_afp : &ip->i_df; | |
230 | struct xfs_bmbt_irec r; | |
231 | ||
232 | xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r); | |
233 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
234 | __entry->ino = ip->i_ino; | |
235 | __entry->idx = idx; | |
236 | __entry->startoff = r.br_startoff; | |
237 | __entry->startblock = r.br_startblock; | |
238 | __entry->blockcount = r.br_blockcount; | |
239 | __entry->state = r.br_state; | |
240 | __entry->bmap_state = state; | |
241 | __entry->caller_ip = caller_ip; | |
242 | ), | |
243 | TP_printk("dev %d:%d ino 0x%llx state %s idx %ld " | |
244 | "offset %lld block %s count %lld flag %d caller %pf", | |
245 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
246 | __entry->ino, | |
247 | __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), | |
248 | (long)__entry->idx, | |
249 | __entry->startoff, | |
250 | xfs_fmtfsblock(__entry->startblock), | |
251 | __entry->blockcount, | |
252 | __entry->state, | |
253 | (char *)__entry->caller_ip) | |
254 | ) | |
255 | ||
0b1b213f | 256 | #define DEFINE_BMAP_EVENT(name) \ |
ea9a4888 | 257 | DEFINE_EVENT(xfs_bmap_class, name, \ |
0b1b213f CH |
258 | TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \ |
259 | unsigned long caller_ip), \ | |
ea9a4888 | 260 | TP_ARGS(ip, idx, state, caller_ip)) |
0b1b213f CH |
261 | DEFINE_BMAP_EVENT(xfs_iext_remove); |
262 | DEFINE_BMAP_EVENT(xfs_bmap_pre_update); | |
263 | DEFINE_BMAP_EVENT(xfs_bmap_post_update); | |
264 | DEFINE_BMAP_EVENT(xfs_extlist); | |
265 | ||
ea9a4888 CH |
266 | DECLARE_EVENT_CLASS(xfs_buf_class, |
267 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), | |
268 | TP_ARGS(bp, caller_ip), | |
269 | TP_STRUCT__entry( | |
270 | __field(dev_t, dev) | |
271 | __field(xfs_daddr_t, bno) | |
272 | __field(size_t, buffer_length) | |
273 | __field(int, hold) | |
274 | __field(int, pincount) | |
275 | __field(unsigned, lockval) | |
276 | __field(unsigned, flags) | |
277 | __field(unsigned long, caller_ip) | |
278 | ), | |
279 | TP_fast_assign( | |
280 | __entry->dev = bp->b_target->bt_dev; | |
281 | __entry->bno = bp->b_bn; | |
282 | __entry->buffer_length = bp->b_buffer_length; | |
283 | __entry->hold = atomic_read(&bp->b_hold); | |
284 | __entry->pincount = atomic_read(&bp->b_pin_count); | |
285 | __entry->lockval = xfs_buf_lock_value(bp); | |
286 | __entry->flags = bp->b_flags; | |
287 | __entry->caller_ip = caller_ip; | |
288 | ), | |
289 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " | |
290 | "lock %d flags %s caller %pf", | |
291 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
292 | (unsigned long long)__entry->bno, | |
293 | __entry->buffer_length, | |
294 | __entry->hold, | |
295 | __entry->pincount, | |
296 | __entry->lockval, | |
297 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), | |
298 | (void *)__entry->caller_ip) | |
0b1b213f | 299 | ) |
ea9a4888 CH |
300 | |
301 | #define DEFINE_BUF_EVENT(name) \ | |
302 | DEFINE_EVENT(xfs_buf_class, name, \ | |
303 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \ | |
304 | TP_ARGS(bp, caller_ip)) | |
0b1b213f CH |
305 | DEFINE_BUF_EVENT(xfs_buf_init); |
306 | DEFINE_BUF_EVENT(xfs_buf_free); | |
307 | DEFINE_BUF_EVENT(xfs_buf_hold); | |
308 | DEFINE_BUF_EVENT(xfs_buf_rele); | |
309 | DEFINE_BUF_EVENT(xfs_buf_pin); | |
310 | DEFINE_BUF_EVENT(xfs_buf_unpin); | |
311 | DEFINE_BUF_EVENT(xfs_buf_iodone); | |
312 | DEFINE_BUF_EVENT(xfs_buf_iorequest); | |
313 | DEFINE_BUF_EVENT(xfs_buf_bawrite); | |
314 | DEFINE_BUF_EVENT(xfs_buf_bdwrite); | |
315 | DEFINE_BUF_EVENT(xfs_buf_lock); | |
316 | DEFINE_BUF_EVENT(xfs_buf_lock_done); | |
317 | DEFINE_BUF_EVENT(xfs_buf_cond_lock); | |
318 | DEFINE_BUF_EVENT(xfs_buf_unlock); | |
319 | DEFINE_BUF_EVENT(xfs_buf_ordered_retry); | |
320 | DEFINE_BUF_EVENT(xfs_buf_iowait); | |
321 | DEFINE_BUF_EVENT(xfs_buf_iowait_done); | |
322 | DEFINE_BUF_EVENT(xfs_buf_delwri_queue); | |
323 | DEFINE_BUF_EVENT(xfs_buf_delwri_dequeue); | |
324 | DEFINE_BUF_EVENT(xfs_buf_delwri_split); | |
325 | DEFINE_BUF_EVENT(xfs_buf_get_noaddr); | |
326 | DEFINE_BUF_EVENT(xfs_bdstrat_shut); | |
327 | DEFINE_BUF_EVENT(xfs_buf_item_relse); | |
328 | DEFINE_BUF_EVENT(xfs_buf_item_iodone); | |
329 | DEFINE_BUF_EVENT(xfs_buf_item_iodone_async); | |
330 | DEFINE_BUF_EVENT(xfs_buf_error_relse); | |
331 | DEFINE_BUF_EVENT(xfs_trans_read_buf_io); | |
332 | DEFINE_BUF_EVENT(xfs_trans_read_buf_shut); | |
333 | ||
334 | /* not really buffer traces, but the buf provides useful information */ | |
335 | DEFINE_BUF_EVENT(xfs_btree_corrupt); | |
336 | DEFINE_BUF_EVENT(xfs_da_btree_corrupt); | |
337 | DEFINE_BUF_EVENT(xfs_reset_dqcounts); | |
338 | DEFINE_BUF_EVENT(xfs_inode_item_push); | |
339 | ||
340 | /* pass flags explicitly */ | |
ea9a4888 CH |
341 | DECLARE_EVENT_CLASS(xfs_buf_flags_class, |
342 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), | |
343 | TP_ARGS(bp, flags, caller_ip), | |
344 | TP_STRUCT__entry( | |
345 | __field(dev_t, dev) | |
346 | __field(xfs_daddr_t, bno) | |
347 | __field(size_t, buffer_length) | |
348 | __field(int, hold) | |
349 | __field(int, pincount) | |
350 | __field(unsigned, lockval) | |
351 | __field(unsigned, flags) | |
352 | __field(unsigned long, caller_ip) | |
353 | ), | |
354 | TP_fast_assign( | |
355 | __entry->dev = bp->b_target->bt_dev; | |
356 | __entry->bno = bp->b_bn; | |
357 | __entry->buffer_length = bp->b_buffer_length; | |
358 | __entry->flags = flags; | |
359 | __entry->hold = atomic_read(&bp->b_hold); | |
360 | __entry->pincount = atomic_read(&bp->b_pin_count); | |
361 | __entry->lockval = xfs_buf_lock_value(bp); | |
362 | __entry->caller_ip = caller_ip; | |
363 | ), | |
364 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " | |
365 | "lock %d flags %s caller %pf", | |
366 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
367 | (unsigned long long)__entry->bno, | |
368 | __entry->buffer_length, | |
369 | __entry->hold, | |
370 | __entry->pincount, | |
371 | __entry->lockval, | |
372 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), | |
373 | (void *)__entry->caller_ip) | |
0b1b213f | 374 | ) |
ea9a4888 CH |
375 | |
376 | #define DEFINE_BUF_FLAGS_EVENT(name) \ | |
377 | DEFINE_EVENT(xfs_buf_flags_class, name, \ | |
378 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \ | |
379 | TP_ARGS(bp, flags, caller_ip)) | |
0b1b213f CH |
380 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_find); |
381 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_get); | |
382 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_read); | |
383 | ||
384 | TRACE_EVENT(xfs_buf_ioerror, | |
385 | TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip), | |
386 | TP_ARGS(bp, error, caller_ip), | |
387 | TP_STRUCT__entry( | |
388 | __field(dev_t, dev) | |
389 | __field(xfs_daddr_t, bno) | |
390 | __field(size_t, buffer_length) | |
391 | __field(unsigned, flags) | |
392 | __field(int, hold) | |
393 | __field(int, pincount) | |
394 | __field(unsigned, lockval) | |
395 | __field(int, error) | |
396 | __field(unsigned long, caller_ip) | |
397 | ), | |
398 | TP_fast_assign( | |
399 | __entry->dev = bp->b_target->bt_dev; | |
400 | __entry->bno = bp->b_bn; | |
401 | __entry->buffer_length = bp->b_buffer_length; | |
402 | __entry->hold = atomic_read(&bp->b_hold); | |
403 | __entry->pincount = atomic_read(&bp->b_pin_count); | |
404 | __entry->lockval = xfs_buf_lock_value(bp); | |
405 | __entry->error = error; | |
406 | __entry->flags = bp->b_flags; | |
407 | __entry->caller_ip = caller_ip; | |
408 | ), | |
409 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " | |
410 | "lock %d error %d flags %s caller %pf", | |
411 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
412 | (unsigned long long)__entry->bno, | |
413 | __entry->buffer_length, | |
414 | __entry->hold, | |
415 | __entry->pincount, | |
416 | __entry->lockval, | |
417 | __entry->error, | |
418 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), | |
419 | (void *)__entry->caller_ip) | |
420 | ); | |
421 | ||
ea9a4888 CH |
422 | DECLARE_EVENT_CLASS(xfs_buf_item_class, |
423 | TP_PROTO(struct xfs_buf_log_item *bip), | |
424 | TP_ARGS(bip), | |
425 | TP_STRUCT__entry( | |
426 | __field(dev_t, dev) | |
427 | __field(xfs_daddr_t, buf_bno) | |
428 | __field(size_t, buf_len) | |
429 | __field(int, buf_hold) | |
430 | __field(int, buf_pincount) | |
431 | __field(int, buf_lockval) | |
432 | __field(unsigned, buf_flags) | |
433 | __field(unsigned, bli_recur) | |
434 | __field(int, bli_refcount) | |
435 | __field(unsigned, bli_flags) | |
436 | __field(void *, li_desc) | |
437 | __field(unsigned, li_flags) | |
438 | ), | |
439 | TP_fast_assign( | |
440 | __entry->dev = bip->bli_buf->b_target->bt_dev; | |
441 | __entry->bli_flags = bip->bli_flags; | |
442 | __entry->bli_recur = bip->bli_recur; | |
443 | __entry->bli_refcount = atomic_read(&bip->bli_refcount); | |
444 | __entry->buf_bno = bip->bli_buf->b_bn; | |
445 | __entry->buf_len = bip->bli_buf->b_buffer_length; | |
446 | __entry->buf_flags = bip->bli_buf->b_flags; | |
447 | __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold); | |
448 | __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count); | |
449 | __entry->buf_lockval = xfs_buf_lock_value(bip->bli_buf); | |
450 | __entry->li_desc = bip->bli_item.li_desc; | |
451 | __entry->li_flags = bip->bli_item.li_flags; | |
452 | ), | |
453 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " | |
454 | "lock %d flags %s recur %d refcount %d bliflags %s " | |
455 | "lidesc 0x%p liflags %s", | |
456 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
457 | (unsigned long long)__entry->buf_bno, | |
458 | __entry->buf_len, | |
459 | __entry->buf_hold, | |
460 | __entry->buf_pincount, | |
461 | __entry->buf_lockval, | |
462 | __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS), | |
463 | __entry->bli_recur, | |
464 | __entry->bli_refcount, | |
465 | __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS), | |
466 | __entry->li_desc, | |
467 | __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS)) | |
0b1b213f | 468 | ) |
ea9a4888 CH |
469 | |
470 | #define DEFINE_BUF_ITEM_EVENT(name) \ | |
471 | DEFINE_EVENT(xfs_buf_item_class, name, \ | |
472 | TP_PROTO(struct xfs_buf_log_item *bip), \ | |
473 | TP_ARGS(bip)) | |
0b1b213f CH |
474 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size); |
475 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale); | |
476 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format); | |
477 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale); | |
478 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin); | |
479 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin); | |
480 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale); | |
481 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_trylock); | |
482 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock); | |
483 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale); | |
484 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed); | |
485 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push); | |
d808f617 | 486 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pushbuf); |
0b1b213f CH |
487 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf); |
488 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur); | |
489 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb); | |
490 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur); | |
491 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf); | |
492 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur); | |
493 | DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf); | |
494 | DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse); | |
495 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin); | |
496 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold); | |
497 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release); | |
498 | DEFINE_BUF_ITEM_EVENT(xfs_trans_binval); | |
499 | ||
ea9a4888 CH |
500 | DECLARE_EVENT_CLASS(xfs_lock_class, |
501 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, | |
502 | unsigned long caller_ip), | |
503 | TP_ARGS(ip, lock_flags, caller_ip), | |
504 | TP_STRUCT__entry( | |
505 | __field(dev_t, dev) | |
506 | __field(xfs_ino_t, ino) | |
507 | __field(int, lock_flags) | |
508 | __field(unsigned long, caller_ip) | |
509 | ), | |
510 | TP_fast_assign( | |
511 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
512 | __entry->ino = ip->i_ino; | |
513 | __entry->lock_flags = lock_flags; | |
514 | __entry->caller_ip = caller_ip; | |
515 | ), | |
516 | TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf", | |
517 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
518 | __entry->ino, | |
519 | __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS), | |
520 | (void *)__entry->caller_ip) | |
521 | ) | |
522 | ||
0b1b213f | 523 | #define DEFINE_LOCK_EVENT(name) \ |
ea9a4888 | 524 | DEFINE_EVENT(xfs_lock_class, name, \ |
0b1b213f CH |
525 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \ |
526 | unsigned long caller_ip), \ | |
ea9a4888 | 527 | TP_ARGS(ip, lock_flags, caller_ip)) |
0b1b213f CH |
528 | DEFINE_LOCK_EVENT(xfs_ilock); |
529 | DEFINE_LOCK_EVENT(xfs_ilock_nowait); | |
530 | DEFINE_LOCK_EVENT(xfs_ilock_demote); | |
531 | DEFINE_LOCK_EVENT(xfs_iunlock); | |
532 | ||
ea9a4888 CH |
533 | DECLARE_EVENT_CLASS(xfs_iget_class, |
534 | TP_PROTO(struct xfs_inode *ip), | |
535 | TP_ARGS(ip), | |
536 | TP_STRUCT__entry( | |
537 | __field(dev_t, dev) | |
538 | __field(xfs_ino_t, ino) | |
539 | ), | |
540 | TP_fast_assign( | |
541 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
542 | __entry->ino = ip->i_ino; | |
543 | ), | |
544 | TP_printk("dev %d:%d ino 0x%llx", | |
545 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
546 | __entry->ino) | |
547 | ) | |
548 | ||
0b1b213f | 549 | #define DEFINE_IGET_EVENT(name) \ |
ea9a4888 | 550 | DEFINE_EVENT(xfs_iget_class, name, \ |
0b1b213f | 551 | TP_PROTO(struct xfs_inode *ip), \ |
ea9a4888 | 552 | TP_ARGS(ip)) |
0b1b213f CH |
553 | DEFINE_IGET_EVENT(xfs_iget_skip); |
554 | DEFINE_IGET_EVENT(xfs_iget_reclaim); | |
555 | DEFINE_IGET_EVENT(xfs_iget_found); | |
556 | DEFINE_IGET_EVENT(xfs_iget_alloc); | |
557 | ||
ea9a4888 CH |
558 | DECLARE_EVENT_CLASS(xfs_inode_class, |
559 | TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), | |
560 | TP_ARGS(ip, caller_ip), | |
561 | TP_STRUCT__entry( | |
562 | __field(dev_t, dev) | |
563 | __field(xfs_ino_t, ino) | |
564 | __field(int, count) | |
565 | __field(unsigned long, caller_ip) | |
566 | ), | |
567 | TP_fast_assign( | |
568 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
569 | __entry->ino = ip->i_ino; | |
570 | __entry->count = atomic_read(&VFS_I(ip)->i_count); | |
571 | __entry->caller_ip = caller_ip; | |
572 | ), | |
573 | TP_printk("dev %d:%d ino 0x%llx count %d caller %pf", | |
574 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
575 | __entry->ino, | |
576 | __entry->count, | |
577 | (char *)__entry->caller_ip) | |
578 | ) | |
579 | ||
0b1b213f | 580 | #define DEFINE_INODE_EVENT(name) \ |
ea9a4888 | 581 | DEFINE_EVENT(xfs_inode_class, name, \ |
0b1b213f | 582 | TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \ |
ea9a4888 | 583 | TP_ARGS(ip, caller_ip)) |
0b1b213f CH |
584 | DEFINE_INODE_EVENT(xfs_ihold); |
585 | DEFINE_INODE_EVENT(xfs_irele); | |
586 | /* the old xfs_itrace_entry tracer - to be replaced by s.th. in the VFS */ | |
587 | DEFINE_INODE_EVENT(xfs_inode); | |
588 | #define xfs_itrace_entry(ip) \ | |
589 | trace_xfs_inode(ip, _THIS_IP_) | |
590 | ||
ea9a4888 CH |
591 | DECLARE_EVENT_CLASS(xfs_dquot_class, |
592 | TP_PROTO(struct xfs_dquot *dqp), | |
593 | TP_ARGS(dqp), | |
594 | TP_STRUCT__entry( | |
595 | __field(dev_t, dev) | |
596 | __field(__be32, id) | |
597 | __field(unsigned, flags) | |
598 | __field(unsigned, nrefs) | |
599 | __field(unsigned long long, res_bcount) | |
600 | __field(unsigned long long, bcount) | |
601 | __field(unsigned long long, icount) | |
602 | __field(unsigned long long, blk_hardlimit) | |
603 | __field(unsigned long long, blk_softlimit) | |
604 | __field(unsigned long long, ino_hardlimit) | |
605 | __field(unsigned long long, ino_softlimit) | |
0b1b213f | 606 | ), \ |
ea9a4888 CH |
607 | TP_fast_assign( |
608 | __entry->dev = dqp->q_mount->m_super->s_dev; | |
609 | __entry->id = dqp->q_core.d_id; | |
610 | __entry->flags = dqp->dq_flags; | |
611 | __entry->nrefs = dqp->q_nrefs; | |
612 | __entry->res_bcount = dqp->q_res_bcount; | |
613 | __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount); | |
614 | __entry->icount = be64_to_cpu(dqp->q_core.d_icount); | |
615 | __entry->blk_hardlimit = | |
616 | be64_to_cpu(dqp->q_core.d_blk_hardlimit); | |
617 | __entry->blk_softlimit = | |
618 | be64_to_cpu(dqp->q_core.d_blk_softlimit); | |
619 | __entry->ino_hardlimit = | |
620 | be64_to_cpu(dqp->q_core.d_ino_hardlimit); | |
621 | __entry->ino_softlimit = | |
622 | be64_to_cpu(dqp->q_core.d_ino_softlimit); | |
623 | ), | |
624 | TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx " | |
625 | "bcnt 0x%llx [hard 0x%llx | soft 0x%llx] " | |
626 | "icnt 0x%llx [hard 0x%llx | soft 0x%llx]", | |
627 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
628 | be32_to_cpu(__entry->id), | |
629 | __print_flags(__entry->flags, "|", XFS_DQ_FLAGS), | |
630 | __entry->nrefs, | |
631 | __entry->res_bcount, | |
632 | __entry->bcount, | |
633 | __entry->blk_hardlimit, | |
634 | __entry->blk_softlimit, | |
635 | __entry->icount, | |
636 | __entry->ino_hardlimit, | |
637 | __entry->ino_softlimit) | |
0b1b213f | 638 | ) |
ea9a4888 CH |
639 | |
640 | #define DEFINE_DQUOT_EVENT(name) \ | |
641 | DEFINE_EVENT(xfs_dquot_class, name, \ | |
642 | TP_PROTO(struct xfs_dquot *dqp), \ | |
643 | TP_ARGS(dqp)) | |
0b1b213f CH |
644 | DEFINE_DQUOT_EVENT(xfs_dqadjust); |
645 | DEFINE_DQUOT_EVENT(xfs_dqshake_dirty); | |
646 | DEFINE_DQUOT_EVENT(xfs_dqshake_unlink); | |
647 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_want); | |
648 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty); | |
649 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_unlink); | |
650 | DEFINE_DQUOT_EVENT(xfs_dqattach_found); | |
651 | DEFINE_DQUOT_EVENT(xfs_dqattach_get); | |
652 | DEFINE_DQUOT_EVENT(xfs_dqinit); | |
653 | DEFINE_DQUOT_EVENT(xfs_dqreuse); | |
654 | DEFINE_DQUOT_EVENT(xfs_dqalloc); | |
655 | DEFINE_DQUOT_EVENT(xfs_dqtobp_read); | |
656 | DEFINE_DQUOT_EVENT(xfs_dqread); | |
657 | DEFINE_DQUOT_EVENT(xfs_dqread_fail); | |
658 | DEFINE_DQUOT_EVENT(xfs_dqlookup_found); | |
659 | DEFINE_DQUOT_EVENT(xfs_dqlookup_want); | |
660 | DEFINE_DQUOT_EVENT(xfs_dqlookup_freelist); | |
661 | DEFINE_DQUOT_EVENT(xfs_dqlookup_move); | |
662 | DEFINE_DQUOT_EVENT(xfs_dqlookup_done); | |
663 | DEFINE_DQUOT_EVENT(xfs_dqget_hit); | |
664 | DEFINE_DQUOT_EVENT(xfs_dqget_miss); | |
665 | DEFINE_DQUOT_EVENT(xfs_dqput); | |
666 | DEFINE_DQUOT_EVENT(xfs_dqput_wait); | |
667 | DEFINE_DQUOT_EVENT(xfs_dqput_free); | |
668 | DEFINE_DQUOT_EVENT(xfs_dqrele); | |
669 | DEFINE_DQUOT_EVENT(xfs_dqflush); | |
670 | DEFINE_DQUOT_EVENT(xfs_dqflush_force); | |
671 | DEFINE_DQUOT_EVENT(xfs_dqflush_done); | |
672 | /* not really iget events, but we re-use the format */ | |
673 | DEFINE_IGET_EVENT(xfs_dquot_dqalloc); | |
674 | DEFINE_IGET_EVENT(xfs_dquot_dqdetach); | |
675 | ||
ea9a4888 CH |
676 | DECLARE_EVENT_CLASS(xfs_loggrant_class, |
677 | TP_PROTO(struct log *log, struct xlog_ticket *tic), | |
678 | TP_ARGS(log, tic), | |
679 | TP_STRUCT__entry( | |
680 | __field(dev_t, dev) | |
681 | __field(unsigned, trans_type) | |
682 | __field(char, ocnt) | |
683 | __field(char, cnt) | |
684 | __field(int, curr_res) | |
685 | __field(int, unit_res) | |
686 | __field(unsigned int, flags) | |
687 | __field(void *, reserve_headq) | |
688 | __field(void *, write_headq) | |
689 | __field(int, grant_reserve_cycle) | |
690 | __field(int, grant_reserve_bytes) | |
691 | __field(int, grant_write_cycle) | |
692 | __field(int, grant_write_bytes) | |
693 | __field(int, curr_cycle) | |
694 | __field(int, curr_block) | |
695 | __field(xfs_lsn_t, tail_lsn) | |
696 | ), | |
697 | TP_fast_assign( | |
698 | __entry->dev = log->l_mp->m_super->s_dev; | |
699 | __entry->trans_type = tic->t_trans_type; | |
700 | __entry->ocnt = tic->t_ocnt; | |
701 | __entry->cnt = tic->t_cnt; | |
702 | __entry->curr_res = tic->t_curr_res; | |
703 | __entry->unit_res = tic->t_unit_res; | |
704 | __entry->flags = tic->t_flags; | |
705 | __entry->reserve_headq = log->l_reserve_headq; | |
706 | __entry->write_headq = log->l_write_headq; | |
707 | __entry->grant_reserve_cycle = log->l_grant_reserve_cycle; | |
708 | __entry->grant_reserve_bytes = log->l_grant_reserve_bytes; | |
709 | __entry->grant_write_cycle = log->l_grant_write_cycle; | |
710 | __entry->grant_write_bytes = log->l_grant_write_bytes; | |
711 | __entry->curr_cycle = log->l_curr_cycle; | |
712 | __entry->curr_block = log->l_curr_block; | |
713 | __entry->tail_lsn = log->l_tail_lsn; | |
714 | ), | |
715 | TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u " | |
716 | "t_unit_res %u t_flags %s reserve_headq 0x%p " | |
717 | "write_headq 0x%p grant_reserve_cycle %d " | |
718 | "grant_reserve_bytes %d grant_write_cycle %d " | |
719 | "grant_write_bytes %d curr_cycle %d curr_block %d " | |
720 | "tail_cycle %d tail_block %d", | |
721 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
722 | __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES), | |
723 | __entry->ocnt, | |
724 | __entry->cnt, | |
725 | __entry->curr_res, | |
726 | __entry->unit_res, | |
727 | __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS), | |
728 | __entry->reserve_headq, | |
729 | __entry->write_headq, | |
730 | __entry->grant_reserve_cycle, | |
731 | __entry->grant_reserve_bytes, | |
732 | __entry->grant_write_cycle, | |
733 | __entry->grant_write_bytes, | |
734 | __entry->curr_cycle, | |
735 | __entry->curr_block, | |
736 | CYCLE_LSN(__entry->tail_lsn), | |
737 | BLOCK_LSN(__entry->tail_lsn) | |
738 | ) | |
739 | ) | |
0b1b213f | 740 | |
ea9a4888 CH |
741 | #define DEFINE_LOGGRANT_EVENT(name) \ |
742 | DEFINE_EVENT(xfs_loggrant_class, name, \ | |
0b1b213f | 743 | TP_PROTO(struct log *log, struct xlog_ticket *tic), \ |
ea9a4888 | 744 | TP_ARGS(log, tic)) |
0b1b213f CH |
745 | DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm); |
746 | DEFINE_LOGGRANT_EVENT(xfs_log_done_perm); | |
747 | DEFINE_LOGGRANT_EVENT(xfs_log_reserve); | |
748 | DEFINE_LOGGRANT_EVENT(xfs_log_umount_write); | |
749 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_enter); | |
750 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_exit); | |
751 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_error); | |
752 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep1); | |
753 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake1); | |
754 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep2); | |
755 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake2); | |
756 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_enter); | |
757 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_exit); | |
758 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_error); | |
759 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep1); | |
760 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake1); | |
761 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep2); | |
762 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake2); | |
763 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter); | |
764 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit); | |
765 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub); | |
766 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter); | |
767 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit); | |
768 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub); | |
769 | ||
770 | #define DEFINE_RW_EVENT(name) \ | |
771 | TRACE_EVENT(name, \ | |
772 | TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \ | |
773 | TP_ARGS(ip, count, offset, flags), \ | |
774 | TP_STRUCT__entry( \ | |
775 | __field(dev_t, dev) \ | |
776 | __field(xfs_ino_t, ino) \ | |
777 | __field(xfs_fsize_t, size) \ | |
778 | __field(xfs_fsize_t, new_size) \ | |
779 | __field(loff_t, offset) \ | |
780 | __field(size_t, count) \ | |
781 | __field(int, flags) \ | |
782 | ), \ | |
783 | TP_fast_assign( \ | |
784 | __entry->dev = VFS_I(ip)->i_sb->s_dev; \ | |
785 | __entry->ino = ip->i_ino; \ | |
786 | __entry->size = ip->i_d.di_size; \ | |
787 | __entry->new_size = ip->i_new_size; \ | |
788 | __entry->offset = offset; \ | |
789 | __entry->count = count; \ | |
790 | __entry->flags = flags; \ | |
791 | ), \ | |
792 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \ | |
793 | "offset 0x%llx count 0x%zx ioflags %s", \ | |
794 | MAJOR(__entry->dev), MINOR(__entry->dev), \ | |
795 | __entry->ino, \ | |
796 | __entry->size, \ | |
797 | __entry->new_size, \ | |
798 | __entry->offset, \ | |
799 | __entry->count, \ | |
800 | __print_flags(__entry->flags, "|", XFS_IO_FLAGS)) \ | |
801 | ) | |
802 | DEFINE_RW_EVENT(xfs_file_read); | |
803 | DEFINE_RW_EVENT(xfs_file_buffered_write); | |
804 | DEFINE_RW_EVENT(xfs_file_direct_write); | |
805 | DEFINE_RW_EVENT(xfs_file_splice_read); | |
806 | DEFINE_RW_EVENT(xfs_file_splice_write); | |
807 | ||
808 | ||
809 | #define DEFINE_PAGE_EVENT(name) \ | |
810 | TRACE_EVENT(name, \ | |
811 | TP_PROTO(struct inode *inode, struct page *page, unsigned long off), \ | |
812 | TP_ARGS(inode, page, off), \ | |
813 | TP_STRUCT__entry( \ | |
814 | __field(dev_t, dev) \ | |
815 | __field(xfs_ino_t, ino) \ | |
816 | __field(pgoff_t, pgoff) \ | |
817 | __field(loff_t, size) \ | |
818 | __field(unsigned long, offset) \ | |
819 | __field(int, delalloc) \ | |
820 | __field(int, unmapped) \ | |
821 | __field(int, unwritten) \ | |
822 | ), \ | |
823 | TP_fast_assign( \ | |
824 | int delalloc = -1, unmapped = -1, unwritten = -1; \ | |
825 | \ | |
826 | if (page_has_buffers(page)) \ | |
827 | xfs_count_page_state(page, &delalloc, \ | |
828 | &unmapped, &unwritten); \ | |
829 | __entry->dev = inode->i_sb->s_dev; \ | |
830 | __entry->ino = XFS_I(inode)->i_ino; \ | |
831 | __entry->pgoff = page_offset(page); \ | |
832 | __entry->size = i_size_read(inode); \ | |
833 | __entry->offset = off; \ | |
834 | __entry->delalloc = delalloc; \ | |
835 | __entry->unmapped = unmapped; \ | |
836 | __entry->unwritten = unwritten; \ | |
837 | ), \ | |
838 | TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx " \ | |
839 | "delalloc %d unmapped %d unwritten %d", \ | |
840 | MAJOR(__entry->dev), MINOR(__entry->dev), \ | |
841 | __entry->ino, \ | |
842 | __entry->pgoff, \ | |
843 | __entry->size, \ | |
844 | __entry->offset, \ | |
845 | __entry->delalloc, \ | |
846 | __entry->unmapped, \ | |
847 | __entry->unwritten) \ | |
848 | ) | |
849 | DEFINE_PAGE_EVENT(xfs_writepage); | |
850 | DEFINE_PAGE_EVENT(xfs_releasepage); | |
851 | DEFINE_PAGE_EVENT(xfs_invalidatepage); | |
852 | ||
853 | #define DEFINE_IOMAP_EVENT(name) \ | |
854 | TRACE_EVENT(name, \ | |
855 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \ | |
856 | int flags, struct xfs_bmbt_irec *irec), \ | |
857 | TP_ARGS(ip, offset, count, flags, irec), \ | |
858 | TP_STRUCT__entry( \ | |
859 | __field(dev_t, dev) \ | |
860 | __field(xfs_ino_t, ino) \ | |
861 | __field(loff_t, size) \ | |
862 | __field(loff_t, new_size) \ | |
863 | __field(loff_t, offset) \ | |
864 | __field(size_t, count) \ | |
865 | __field(int, flags) \ | |
866 | __field(xfs_fileoff_t, startoff) \ | |
867 | __field(xfs_fsblock_t, startblock) \ | |
868 | __field(xfs_filblks_t, blockcount) \ | |
869 | ), \ | |
870 | TP_fast_assign( \ | |
871 | __entry->dev = VFS_I(ip)->i_sb->s_dev; \ | |
872 | __entry->ino = ip->i_ino; \ | |
873 | __entry->size = ip->i_d.di_size; \ | |
874 | __entry->new_size = ip->i_new_size; \ | |
875 | __entry->offset = offset; \ | |
876 | __entry->count = count; \ | |
877 | __entry->flags = flags; \ | |
878 | __entry->startoff = irec ? irec->br_startoff : 0; \ | |
879 | __entry->startblock = irec ? irec->br_startblock : 0; \ | |
880 | __entry->blockcount = irec ? irec->br_blockcount : 0; \ | |
881 | ), \ | |
882 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \ | |
883 | "offset 0x%llx count %zd flags %s " \ | |
a539bd8c | 884 | "startoff 0x%llx startblock %s blockcount 0x%llx", \ |
0b1b213f CH |
885 | MAJOR(__entry->dev), MINOR(__entry->dev), \ |
886 | __entry->ino, \ | |
887 | __entry->size, \ | |
888 | __entry->new_size, \ | |
889 | __entry->offset, \ | |
890 | __entry->count, \ | |
891 | __print_flags(__entry->flags, "|", BMAPI_FLAGS), \ | |
892 | __entry->startoff, \ | |
a539bd8c | 893 | xfs_fmtfsblock(__entry->startblock), \ |
0b1b213f CH |
894 | __entry->blockcount) \ |
895 | ) | |
896 | DEFINE_IOMAP_EVENT(xfs_iomap_enter); | |
897 | DEFINE_IOMAP_EVENT(xfs_iomap_found); | |
898 | DEFINE_IOMAP_EVENT(xfs_iomap_alloc); | |
899 | ||
900 | #define DEFINE_SIMPLE_IO_EVENT(name) \ | |
901 | TRACE_EVENT(name, \ | |
902 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \ | |
903 | TP_ARGS(ip, offset, count), \ | |
904 | TP_STRUCT__entry( \ | |
905 | __field(dev_t, dev) \ | |
906 | __field(xfs_ino_t, ino) \ | |
907 | __field(loff_t, size) \ | |
908 | __field(loff_t, new_size) \ | |
909 | __field(loff_t, offset) \ | |
910 | __field(size_t, count) \ | |
911 | ), \ | |
912 | TP_fast_assign( \ | |
913 | __entry->dev = VFS_I(ip)->i_sb->s_dev; \ | |
914 | __entry->ino = ip->i_ino; \ | |
915 | __entry->size = ip->i_d.di_size; \ | |
916 | __entry->new_size = ip->i_new_size; \ | |
917 | __entry->offset = offset; \ | |
918 | __entry->count = count; \ | |
919 | ), \ | |
920 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \ | |
921 | "offset 0x%llx count %zd", \ | |
922 | MAJOR(__entry->dev), MINOR(__entry->dev), \ | |
923 | __entry->ino, \ | |
924 | __entry->size, \ | |
925 | __entry->new_size, \ | |
926 | __entry->offset, \ | |
927 | __entry->count) \ | |
928 | ); | |
929 | DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc); | |
930 | DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); | |
931 | ||
932 | ||
933 | TRACE_EVENT(xfs_itruncate_start, | |
934 | TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size, int flag, | |
935 | xfs_off_t toss_start, xfs_off_t toss_finish), | |
936 | TP_ARGS(ip, new_size, flag, toss_start, toss_finish), | |
937 | TP_STRUCT__entry( | |
938 | __field(dev_t, dev) | |
939 | __field(xfs_ino_t, ino) | |
940 | __field(xfs_fsize_t, size) | |
941 | __field(xfs_fsize_t, new_size) | |
942 | __field(xfs_off_t, toss_start) | |
943 | __field(xfs_off_t, toss_finish) | |
944 | __field(int, flag) | |
945 | ), | |
946 | TP_fast_assign( | |
947 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
948 | __entry->ino = ip->i_ino; | |
949 | __entry->size = ip->i_d.di_size; | |
950 | __entry->new_size = new_size; | |
951 | __entry->toss_start = toss_start; | |
952 | __entry->toss_finish = toss_finish; | |
953 | __entry->flag = flag; | |
954 | ), | |
955 | TP_printk("dev %d:%d ino 0x%llx %s size 0x%llx new_size 0x%llx " | |
956 | "toss start 0x%llx toss finish 0x%llx", | |
957 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
958 | __entry->ino, | |
959 | __print_flags(__entry->flag, "|", XFS_ITRUNC_FLAGS), | |
960 | __entry->size, | |
961 | __entry->new_size, | |
962 | __entry->toss_start, | |
963 | __entry->toss_finish) | |
964 | ); | |
965 | ||
ea9a4888 CH |
966 | DECLARE_EVENT_CLASS(xfs_itrunc_class, |
967 | TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), | |
968 | TP_ARGS(ip, new_size), | |
969 | TP_STRUCT__entry( | |
970 | __field(dev_t, dev) | |
971 | __field(xfs_ino_t, ino) | |
972 | __field(xfs_fsize_t, size) | |
973 | __field(xfs_fsize_t, new_size) | |
974 | ), | |
975 | TP_fast_assign( | |
976 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
977 | __entry->ino = ip->i_ino; | |
978 | __entry->size = ip->i_d.di_size; | |
979 | __entry->new_size = new_size; | |
980 | ), | |
981 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx", | |
982 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
983 | __entry->ino, | |
984 | __entry->size, | |
985 | __entry->new_size) | |
986 | ) | |
987 | ||
0b1b213f | 988 | #define DEFINE_ITRUNC_EVENT(name) \ |
ea9a4888 | 989 | DEFINE_EVENT(xfs_itrunc_class, name, \ |
0b1b213f | 990 | TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \ |
ea9a4888 | 991 | TP_ARGS(ip, new_size)) |
0b1b213f CH |
992 | DEFINE_ITRUNC_EVENT(xfs_itruncate_finish_start); |
993 | DEFINE_ITRUNC_EVENT(xfs_itruncate_finish_end); | |
994 | ||
995 | TRACE_EVENT(xfs_pagecache_inval, | |
996 | TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish), | |
997 | TP_ARGS(ip, start, finish), | |
998 | TP_STRUCT__entry( | |
999 | __field(dev_t, dev) | |
1000 | __field(xfs_ino_t, ino) | |
1001 | __field(xfs_fsize_t, size) | |
1002 | __field(xfs_off_t, start) | |
1003 | __field(xfs_off_t, finish) | |
1004 | ), | |
1005 | TP_fast_assign( | |
1006 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1007 | __entry->ino = ip->i_ino; | |
1008 | __entry->size = ip->i_d.di_size; | |
1009 | __entry->start = start; | |
1010 | __entry->finish = finish; | |
1011 | ), | |
1012 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx", | |
1013 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1014 | __entry->ino, | |
1015 | __entry->size, | |
1016 | __entry->start, | |
1017 | __entry->finish) | |
1018 | ); | |
1019 | ||
1020 | TRACE_EVENT(xfs_bunmap, | |
1021 | TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len, | |
1022 | int flags, unsigned long caller_ip), | |
1023 | TP_ARGS(ip, bno, len, flags, caller_ip), | |
1024 | TP_STRUCT__entry( | |
1025 | __field(dev_t, dev) | |
1026 | __field(xfs_ino_t, ino) | |
1027 | __field(xfs_fsize_t, size) | |
1028 | __field(xfs_fileoff_t, bno) | |
1029 | __field(xfs_filblks_t, len) | |
1030 | __field(unsigned long, caller_ip) | |
1031 | __field(int, flags) | |
1032 | ), | |
1033 | TP_fast_assign( | |
1034 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1035 | __entry->ino = ip->i_ino; | |
1036 | __entry->size = ip->i_d.di_size; | |
1037 | __entry->bno = bno; | |
1038 | __entry->len = len; | |
1039 | __entry->caller_ip = caller_ip; | |
1040 | __entry->flags = flags; | |
1041 | ), | |
1042 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx" | |
1043 | "flags %s caller %pf", | |
1044 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1045 | __entry->ino, | |
1046 | __entry->size, | |
1047 | __entry->bno, | |
1048 | __entry->len, | |
1049 | __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS), | |
1050 | (void *)__entry->caller_ip) | |
1051 | ||
1052 | ); | |
1053 | ||
1054 | TRACE_EVENT(xfs_alloc_busy, | |
1055 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, | |
1056 | xfs_extlen_t len, int slot), | |
1057 | TP_ARGS(mp, agno, agbno, len, slot), | |
1058 | TP_STRUCT__entry( | |
1059 | __field(dev_t, dev) | |
1060 | __field(xfs_agnumber_t, agno) | |
1061 | __field(xfs_agblock_t, agbno) | |
1062 | __field(xfs_extlen_t, len) | |
1063 | __field(int, slot) | |
1064 | ), | |
1065 | TP_fast_assign( | |
1066 | __entry->dev = mp->m_super->s_dev; | |
1067 | __entry->agno = agno; | |
1068 | __entry->agbno = agbno; | |
1069 | __entry->len = len; | |
1070 | __entry->slot = slot; | |
1071 | ), | |
1072 | TP_printk("dev %d:%d agno %u agbno %u len %u slot %d", | |
1073 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1074 | __entry->agno, | |
1075 | __entry->agbno, | |
1076 | __entry->len, | |
1077 | __entry->slot) | |
1078 | ||
1079 | ); | |
1080 | ||
1081 | #define XFS_BUSY_STATES \ | |
1082 | { 0, "found" }, \ | |
1083 | { 1, "missing" } | |
1084 | ||
1085 | TRACE_EVENT(xfs_alloc_unbusy, | |
1086 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
1087 | int slot, int found), | |
1088 | TP_ARGS(mp, agno, slot, found), | |
1089 | TP_STRUCT__entry( | |
1090 | __field(dev_t, dev) | |
1091 | __field(xfs_agnumber_t, agno) | |
1092 | __field(int, slot) | |
1093 | __field(int, found) | |
1094 | ), | |
1095 | TP_fast_assign( | |
1096 | __entry->dev = mp->m_super->s_dev; | |
1097 | __entry->agno = agno; | |
1098 | __entry->slot = slot; | |
1099 | __entry->found = found; | |
1100 | ), | |
1101 | TP_printk("dev %d:%d agno %u slot %d %s", | |
1102 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1103 | __entry->agno, | |
1104 | __entry->slot, | |
1105 | __print_symbolic(__entry->found, XFS_BUSY_STATES)) | |
1106 | ); | |
1107 | ||
1108 | TRACE_EVENT(xfs_alloc_busysearch, | |
1109 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, | |
fd45e478 DC |
1110 | xfs_extlen_t len, xfs_lsn_t lsn), |
1111 | TP_ARGS(mp, agno, agbno, len, lsn), | |
0b1b213f CH |
1112 | TP_STRUCT__entry( |
1113 | __field(dev_t, dev) | |
1114 | __field(xfs_agnumber_t, agno) | |
1115 | __field(xfs_agblock_t, agbno) | |
1116 | __field(xfs_extlen_t, len) | |
fd45e478 | 1117 | __field(xfs_lsn_t, lsn) |
0b1b213f CH |
1118 | ), |
1119 | TP_fast_assign( | |
1120 | __entry->dev = mp->m_super->s_dev; | |
1121 | __entry->agno = agno; | |
1122 | __entry->agbno = agbno; | |
1123 | __entry->len = len; | |
fd45e478 | 1124 | __entry->lsn = lsn; |
0b1b213f | 1125 | ), |
fd45e478 | 1126 | TP_printk("dev %d:%d agno %u agbno %u len %u force lsn 0x%llx", |
0b1b213f CH |
1127 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1128 | __entry->agno, | |
1129 | __entry->agbno, | |
1130 | __entry->len, | |
fd45e478 | 1131 | __entry->lsn) |
0b1b213f CH |
1132 | ); |
1133 | ||
1134 | TRACE_EVENT(xfs_agf, | |
1135 | TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, | |
1136 | unsigned long caller_ip), | |
1137 | TP_ARGS(mp, agf, flags, caller_ip), | |
1138 | TP_STRUCT__entry( | |
1139 | __field(dev_t, dev) | |
1140 | __field(xfs_agnumber_t, agno) | |
1141 | __field(int, flags) | |
1142 | __field(__u32, length) | |
1143 | __field(__u32, bno_root) | |
1144 | __field(__u32, cnt_root) | |
1145 | __field(__u32, bno_level) | |
1146 | __field(__u32, cnt_level) | |
1147 | __field(__u32, flfirst) | |
1148 | __field(__u32, fllast) | |
1149 | __field(__u32, flcount) | |
1150 | __field(__u32, freeblks) | |
1151 | __field(__u32, longest) | |
1152 | __field(unsigned long, caller_ip) | |
1153 | ), | |
1154 | TP_fast_assign( | |
1155 | __entry->dev = mp->m_super->s_dev; | |
1156 | __entry->agno = be32_to_cpu(agf->agf_seqno), | |
1157 | __entry->flags = flags; | |
1158 | __entry->length = be32_to_cpu(agf->agf_length), | |
1159 | __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]), | |
1160 | __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]), | |
1161 | __entry->bno_level = | |
1162 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]), | |
1163 | __entry->cnt_level = | |
1164 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]), | |
1165 | __entry->flfirst = be32_to_cpu(agf->agf_flfirst), | |
1166 | __entry->fllast = be32_to_cpu(agf->agf_fllast), | |
1167 | __entry->flcount = be32_to_cpu(agf->agf_flcount), | |
1168 | __entry->freeblks = be32_to_cpu(agf->agf_freeblks), | |
1169 | __entry->longest = be32_to_cpu(agf->agf_longest); | |
1170 | __entry->caller_ip = caller_ip; | |
1171 | ), | |
1172 | TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u " | |
1173 | "levels b %u c %u flfirst %u fllast %u flcount %u " | |
1174 | "freeblks %u longest %u caller %pf", | |
1175 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1176 | __entry->agno, | |
1177 | __print_flags(__entry->flags, "|", XFS_AGF_FLAGS), | |
1178 | __entry->length, | |
1179 | __entry->bno_root, | |
1180 | __entry->cnt_root, | |
1181 | __entry->bno_level, | |
1182 | __entry->cnt_level, | |
1183 | __entry->flfirst, | |
1184 | __entry->fllast, | |
1185 | __entry->flcount, | |
1186 | __entry->freeblks, | |
1187 | __entry->longest, | |
1188 | (void *)__entry->caller_ip) | |
1189 | ); | |
1190 | ||
1191 | TRACE_EVENT(xfs_free_extent, | |
1192 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, | |
1193 | xfs_extlen_t len, bool isfl, int haveleft, int haveright), | |
1194 | TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright), | |
1195 | TP_STRUCT__entry( | |
1196 | __field(dev_t, dev) | |
1197 | __field(xfs_agnumber_t, agno) | |
1198 | __field(xfs_agblock_t, agbno) | |
1199 | __field(xfs_extlen_t, len) | |
1200 | __field(int, isfl) | |
1201 | __field(int, haveleft) | |
1202 | __field(int, haveright) | |
1203 | ), | |
1204 | TP_fast_assign( | |
1205 | __entry->dev = mp->m_super->s_dev; | |
1206 | __entry->agno = agno; | |
1207 | __entry->agbno = agbno; | |
1208 | __entry->len = len; | |
1209 | __entry->isfl = isfl; | |
1210 | __entry->haveleft = haveleft; | |
1211 | __entry->haveright = haveright; | |
1212 | ), | |
1213 | TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s", | |
1214 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1215 | __entry->agno, | |
1216 | __entry->agbno, | |
1217 | __entry->len, | |
1218 | __entry->isfl, | |
1219 | __entry->haveleft ? | |
1220 | (__entry->haveright ? "both" : "left") : | |
1221 | (__entry->haveright ? "right" : "none")) | |
1222 | ||
1223 | ); | |
1224 | ||
ea9a4888 CH |
1225 | DECLARE_EVENT_CLASS(xfs_alloc_class, |
1226 | TP_PROTO(struct xfs_alloc_arg *args), | |
1227 | TP_ARGS(args), | |
1228 | TP_STRUCT__entry( | |
1229 | __field(dev_t, dev) | |
1230 | __field(xfs_agnumber_t, agno) | |
1231 | __field(xfs_agblock_t, agbno) | |
1232 | __field(xfs_extlen_t, minlen) | |
1233 | __field(xfs_extlen_t, maxlen) | |
1234 | __field(xfs_extlen_t, mod) | |
1235 | __field(xfs_extlen_t, prod) | |
1236 | __field(xfs_extlen_t, minleft) | |
1237 | __field(xfs_extlen_t, total) | |
1238 | __field(xfs_extlen_t, alignment) | |
1239 | __field(xfs_extlen_t, minalignslop) | |
1240 | __field(xfs_extlen_t, len) | |
1241 | __field(short, type) | |
1242 | __field(short, otype) | |
1243 | __field(char, wasdel) | |
1244 | __field(char, wasfromfl) | |
1245 | __field(char, isfl) | |
1246 | __field(char, userdata) | |
1247 | __field(xfs_fsblock_t, firstblock) | |
1248 | ), | |
1249 | TP_fast_assign( | |
1250 | __entry->dev = args->mp->m_super->s_dev; | |
1251 | __entry->agno = args->agno; | |
1252 | __entry->agbno = args->agbno; | |
1253 | __entry->minlen = args->minlen; | |
1254 | __entry->maxlen = args->maxlen; | |
1255 | __entry->mod = args->mod; | |
1256 | __entry->prod = args->prod; | |
1257 | __entry->minleft = args->minleft; | |
1258 | __entry->total = args->total; | |
1259 | __entry->alignment = args->alignment; | |
1260 | __entry->minalignslop = args->minalignslop; | |
1261 | __entry->len = args->len; | |
1262 | __entry->type = args->type; | |
1263 | __entry->otype = args->otype; | |
1264 | __entry->wasdel = args->wasdel; | |
1265 | __entry->wasfromfl = args->wasfromfl; | |
1266 | __entry->isfl = args->isfl; | |
1267 | __entry->userdata = args->userdata; | |
1268 | __entry->firstblock = args->firstblock; | |
1269 | ), | |
1270 | TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u " | |
1271 | "prod %u minleft %u total %u alignment %u minalignslop %u " | |
1272 | "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d " | |
1273 | "userdata %d firstblock 0x%llx", | |
1274 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1275 | __entry->agno, | |
1276 | __entry->agbno, | |
1277 | __entry->minlen, | |
1278 | __entry->maxlen, | |
1279 | __entry->mod, | |
1280 | __entry->prod, | |
1281 | __entry->minleft, | |
1282 | __entry->total, | |
1283 | __entry->alignment, | |
1284 | __entry->minalignslop, | |
1285 | __entry->len, | |
1286 | __print_symbolic(__entry->type, XFS_ALLOC_TYPES), | |
1287 | __print_symbolic(__entry->otype, XFS_ALLOC_TYPES), | |
1288 | __entry->wasdel, | |
1289 | __entry->wasfromfl, | |
1290 | __entry->isfl, | |
1291 | __entry->userdata, | |
1292 | __entry->firstblock) | |
0b1b213f CH |
1293 | ) |
1294 | ||
ea9a4888 CH |
1295 | #define DEFINE_ALLOC_EVENT(name) \ |
1296 | DEFINE_EVENT(xfs_alloc_class, name, \ | |
1297 | TP_PROTO(struct xfs_alloc_arg *args), \ | |
1298 | TP_ARGS(args)) | |
0b1b213f CH |
1299 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_done); |
1300 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_error); | |
1301 | DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft); | |
1302 | DEFINE_ALLOC_EVENT(xfs_alloc_near_first); | |
1303 | DEFINE_ALLOC_EVENT(xfs_alloc_near_greater); | |
1304 | DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser); | |
1305 | DEFINE_ALLOC_EVENT(xfs_alloc_near_error); | |
1306 | DEFINE_ALLOC_EVENT(xfs_alloc_size_neither); | |
1307 | DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry); | |
1308 | DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft); | |
1309 | DEFINE_ALLOC_EVENT(xfs_alloc_size_done); | |
1310 | DEFINE_ALLOC_EVENT(xfs_alloc_size_error); | |
1311 | DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist); | |
1312 | DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough); | |
1313 | DEFINE_ALLOC_EVENT(xfs_alloc_small_done); | |
1314 | DEFINE_ALLOC_EVENT(xfs_alloc_small_error); | |
1315 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs); | |
1316 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix); | |
1317 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp); | |
1318 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed); | |
1319 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed); | |
1320 | ||
ea9a4888 CH |
1321 | DECLARE_EVENT_CLASS(xfs_dir2_class, |
1322 | TP_PROTO(struct xfs_da_args *args), | |
1323 | TP_ARGS(args), | |
1324 | TP_STRUCT__entry( | |
1325 | __field(dev_t, dev) | |
1326 | __field(xfs_ino_t, ino) | |
1327 | __dynamic_array(char, name, args->namelen) | |
1328 | __field(int, namelen) | |
1329 | __field(xfs_dahash_t, hashval) | |
1330 | __field(xfs_ino_t, inumber) | |
1331 | __field(int, op_flags) | |
1332 | ), | |
1333 | TP_fast_assign( | |
1334 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; | |
1335 | __entry->ino = args->dp->i_ino; | |
1336 | if (args->namelen) | |
1337 | memcpy(__get_str(name), args->name, args->namelen); | |
1338 | __entry->namelen = args->namelen; | |
1339 | __entry->hashval = args->hashval; | |
1340 | __entry->inumber = args->inumber; | |
1341 | __entry->op_flags = args->op_flags; | |
1342 | ), | |
1343 | TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x " | |
1344 | "inumber 0x%llx op_flags %s", | |
1345 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1346 | __entry->ino, | |
1347 | __entry->namelen, | |
1348 | __entry->namelen ? __get_str(name) : NULL, | |
1349 | __entry->namelen, | |
1350 | __entry->hashval, | |
1351 | __entry->inumber, | |
1352 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS)) | |
1353 | ) | |
1354 | ||
1355 | #define DEFINE_DIR2_EVENT(name) \ | |
1356 | DEFINE_EVENT(xfs_dir2_class, name, \ | |
0b1b213f | 1357 | TP_PROTO(struct xfs_da_args *args), \ |
ea9a4888 CH |
1358 | TP_ARGS(args)) |
1359 | DEFINE_DIR2_EVENT(xfs_dir2_sf_addname); | |
1360 | DEFINE_DIR2_EVENT(xfs_dir2_sf_create); | |
1361 | DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup); | |
1362 | DEFINE_DIR2_EVENT(xfs_dir2_sf_replace); | |
1363 | DEFINE_DIR2_EVENT(xfs_dir2_sf_removename); | |
1364 | DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4); | |
1365 | DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8); | |
1366 | DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block); | |
1367 | DEFINE_DIR2_EVENT(xfs_dir2_block_addname); | |
1368 | DEFINE_DIR2_EVENT(xfs_dir2_block_lookup); | |
1369 | DEFINE_DIR2_EVENT(xfs_dir2_block_replace); | |
1370 | DEFINE_DIR2_EVENT(xfs_dir2_block_removename); | |
1371 | DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf); | |
1372 | DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf); | |
1373 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname); | |
1374 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup); | |
1375 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace); | |
1376 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename); | |
1377 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block); | |
1378 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node); | |
1379 | DEFINE_DIR2_EVENT(xfs_dir2_node_addname); | |
1380 | DEFINE_DIR2_EVENT(xfs_dir2_node_lookup); | |
1381 | DEFINE_DIR2_EVENT(xfs_dir2_node_replace); | |
1382 | DEFINE_DIR2_EVENT(xfs_dir2_node_removename); | |
1383 | DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf); | |
1384 | ||
1385 | DECLARE_EVENT_CLASS(xfs_dir2_space_class, | |
1386 | TP_PROTO(struct xfs_da_args *args, int idx), | |
1387 | TP_ARGS(args, idx), | |
1388 | TP_STRUCT__entry( | |
1389 | __field(dev_t, dev) | |
1390 | __field(xfs_ino_t, ino) | |
1391 | __field(int, op_flags) | |
1392 | __field(int, idx) | |
1393 | ), | |
1394 | TP_fast_assign( | |
1395 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; | |
1396 | __entry->ino = args->dp->i_ino; | |
1397 | __entry->op_flags = args->op_flags; | |
1398 | __entry->idx = idx; | |
1399 | ), | |
1400 | TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d", | |
1401 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1402 | __entry->ino, | |
1403 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), | |
1404 | __entry->idx) | |
0b1b213f | 1405 | ) |
0b1b213f | 1406 | |
ea9a4888 CH |
1407 | #define DEFINE_DIR2_SPACE_EVENT(name) \ |
1408 | DEFINE_EVENT(xfs_dir2_space_class, name, \ | |
0b1b213f | 1409 | TP_PROTO(struct xfs_da_args *args, int idx), \ |
ea9a4888 CH |
1410 | TP_ARGS(args, idx)) |
1411 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add); | |
1412 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove); | |
1413 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode); | |
1414 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode); | |
0b1b213f CH |
1415 | |
1416 | TRACE_EVENT(xfs_dir2_leafn_moveents, | |
1417 | TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count), | |
1418 | TP_ARGS(args, src_idx, dst_idx, count), | |
1419 | TP_STRUCT__entry( | |
1420 | __field(dev_t, dev) | |
1421 | __field(xfs_ino_t, ino) | |
1422 | __field(int, op_flags) | |
1423 | __field(int, src_idx) | |
1424 | __field(int, dst_idx) | |
1425 | __field(int, count) | |
1426 | ), | |
1427 | TP_fast_assign( | |
1428 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; | |
1429 | __entry->ino = args->dp->i_ino; | |
1430 | __entry->op_flags = args->op_flags; | |
1431 | __entry->src_idx = src_idx; | |
1432 | __entry->dst_idx = dst_idx; | |
1433 | __entry->count = count; | |
1434 | ), | |
1435 | TP_printk("dev %d:%d ino 0x%llx op_flags %s " | |
1436 | "src_idx %d dst_idx %d count %d", | |
1437 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1438 | __entry->ino, | |
1439 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), | |
1440 | __entry->src_idx, | |
1441 | __entry->dst_idx, | |
1442 | __entry->count) | |
1443 | ); | |
1444 | ||
3a85cd96 DC |
1445 | #define XFS_SWAPEXT_INODES \ |
1446 | { 0, "target" }, \ | |
1447 | { 1, "temp" } | |
1448 | ||
1449 | #define XFS_INODE_FORMAT_STR \ | |
1450 | { 0, "invalid" }, \ | |
1451 | { 1, "local" }, \ | |
1452 | { 2, "extent" }, \ | |
1453 | { 3, "btree" } | |
1454 | ||
1455 | DECLARE_EVENT_CLASS(xfs_swap_extent_class, | |
1456 | TP_PROTO(struct xfs_inode *ip, int which), | |
1457 | TP_ARGS(ip, which), | |
1458 | TP_STRUCT__entry( | |
1459 | __field(dev_t, dev) | |
1460 | __field(int, which) | |
1461 | __field(xfs_ino_t, ino) | |
1462 | __field(int, format) | |
1463 | __field(int, nex) | |
1464 | __field(int, max_nex) | |
1465 | __field(int, broot_size) | |
1466 | __field(int, fork_off) | |
1467 | ), | |
1468 | TP_fast_assign( | |
1469 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1470 | __entry->which = which; | |
1471 | __entry->ino = ip->i_ino; | |
1472 | __entry->format = ip->i_d.di_format; | |
1473 | __entry->nex = ip->i_d.di_nextents; | |
1474 | __entry->max_nex = ip->i_df.if_ext_max; | |
1475 | __entry->broot_size = ip->i_df.if_broot_bytes; | |
1476 | __entry->fork_off = XFS_IFORK_BOFF(ip); | |
1477 | ), | |
1478 | TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, " | |
1479 | "Max in-fork extents %d, broot size %d, fork offset %d", | |
1480 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1481 | __entry->ino, | |
1482 | __print_symbolic(__entry->which, XFS_SWAPEXT_INODES), | |
1483 | __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR), | |
1484 | __entry->nex, | |
1485 | __entry->max_nex, | |
1486 | __entry->broot_size, | |
1487 | __entry->fork_off) | |
1488 | ) | |
1489 | ||
1490 | #define DEFINE_SWAPEXT_EVENT(name) \ | |
1491 | DEFINE_EVENT(xfs_swap_extent_class, name, \ | |
1492 | TP_PROTO(struct xfs_inode *ip, int which), \ | |
1493 | TP_ARGS(ip, which)) | |
1494 | ||
1495 | DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before); | |
1496 | DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after); | |
1497 | ||
0b1b213f CH |
1498 | #endif /* _TRACE_XFS_H */ |
1499 | ||
1500 | #undef TRACE_INCLUDE_PATH | |
1501 | #define TRACE_INCLUDE_PATH . | |
1502 | #define TRACE_INCLUDE_FILE xfs_trace | |
1503 | #include <trace/define_trace.h> |