blob: 2e41756e263a5d76967ed25bdd2e8e96740e3c65 [file] [log] [blame]
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001/*
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
26struct xfs_agf;
27struct xfs_alloc_arg;
28struct xfs_attr_list_context;
29struct xfs_buf_log_item;
30struct xfs_da_args;
31struct xfs_da_node_entry;
32struct xfs_dquot;
Christoph Hellwig9e4c1092011-10-11 15:14:11 +000033struct xfs_log_item;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000034struct xlog_ticket;
35struct log;
Dave Chinner9abbc532010-04-13 15:06:46 +100036struct xlog_recover;
37struct xlog_recover_item;
38struct xfs_buf_log_format;
39struct xfs_inode_log_format;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000040
Christoph Hellwigea9a4882009-12-21 14:03:03 +000041DECLARE_EVENT_CLASS(xfs_attr_list_class,
42 TP_PROTO(struct xfs_attr_list_context *ctx),
43 TP_ARGS(ctx),
44 TP_STRUCT__entry(
45 __field(dev_t, dev)
46 __field(xfs_ino_t, ino)
47 __field(u32, hashval)
48 __field(u32, blkno)
49 __field(u32, offset)
50 __field(void *, alist)
51 __field(int, bufsize)
52 __field(int, count)
53 __field(int, firstu)
54 __field(int, dupcnt)
55 __field(int, flags)
56 ),
57 TP_fast_assign(
58 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
59 __entry->ino = ctx->dp->i_ino;
60 __entry->hashval = ctx->cursor->hashval;
61 __entry->blkno = ctx->cursor->blkno;
62 __entry->offset = ctx->cursor->offset;
63 __entry->alist = ctx->alist;
64 __entry->bufsize = ctx->bufsize;
65 __entry->count = ctx->count;
66 __entry->firstu = ctx->firstu;
67 __entry->flags = ctx->flags;
68 ),
69 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
70 "alist 0x%p size %u count %u firstu %u flags %d %s",
71 MAJOR(__entry->dev), MINOR(__entry->dev),
72 __entry->ino,
73 __entry->hashval,
74 __entry->blkno,
75 __entry->offset,
76 __entry->dupcnt,
77 __entry->alist,
78 __entry->bufsize,
79 __entry->count,
80 __entry->firstu,
81 __entry->flags,
82 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
83 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000084)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000085
86#define DEFINE_ATTR_LIST_EVENT(name) \
87DEFINE_EVENT(xfs_attr_list_class, name, \
88 TP_PROTO(struct xfs_attr_list_context *ctx), \
89 TP_ARGS(ctx))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000090DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
91DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
92DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
93DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
94DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
95DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
96DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
97DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
98
Li Zefanf8adb4d2010-05-24 08:25:57 +000099DECLARE_EVENT_CLASS(xfs_perag_class,
100 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
101 unsigned long caller_ip),
102 TP_ARGS(mp, agno, refcount, caller_ip),
103 TP_STRUCT__entry(
104 __field(dev_t, dev)
105 __field(xfs_agnumber_t, agno)
106 __field(int, refcount)
107 __field(unsigned long, caller_ip)
108 ),
109 TP_fast_assign(
110 __entry->dev = mp->m_super->s_dev;
111 __entry->agno = agno;
112 __entry->refcount = refcount;
113 __entry->caller_ip = caller_ip;
114 ),
115 TP_printk("dev %d:%d agno %u refcount %d caller %pf",
116 MAJOR(__entry->dev), MINOR(__entry->dev),
117 __entry->agno,
118 __entry->refcount,
119 (char *)__entry->caller_ip)
120);
121
122#define DEFINE_PERAG_REF_EVENT(name) \
123DEFINE_EVENT(xfs_perag_class, name, \
124 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
125 unsigned long caller_ip), \
126 TP_ARGS(mp, agno, refcount, caller_ip))
127DEFINE_PERAG_REF_EVENT(xfs_perag_get);
Dave Chinner65d0f202010-09-24 18:40:15 +1000128DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000129DEFINE_PERAG_REF_EVENT(xfs_perag_put);
Dave Chinner16fd5362010-07-20 09:43:39 +1000130DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
131DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000132
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000133TRACE_EVENT(xfs_attr_list_node_descend,
134 TP_PROTO(struct xfs_attr_list_context *ctx,
135 struct xfs_da_node_entry *btree),
136 TP_ARGS(ctx, btree),
137 TP_STRUCT__entry(
138 __field(dev_t, dev)
139 __field(xfs_ino_t, ino)
140 __field(u32, hashval)
141 __field(u32, blkno)
142 __field(u32, offset)
143 __field(void *, alist)
144 __field(int, bufsize)
145 __field(int, count)
146 __field(int, firstu)
147 __field(int, dupcnt)
148 __field(int, flags)
149 __field(u32, bt_hashval)
150 __field(u32, bt_before)
151 ),
152 TP_fast_assign(
153 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
154 __entry->ino = ctx->dp->i_ino;
155 __entry->hashval = ctx->cursor->hashval;
156 __entry->blkno = ctx->cursor->blkno;
157 __entry->offset = ctx->cursor->offset;
158 __entry->alist = ctx->alist;
159 __entry->bufsize = ctx->bufsize;
160 __entry->count = ctx->count;
161 __entry->firstu = ctx->firstu;
162 __entry->flags = ctx->flags;
163 __entry->bt_hashval = be32_to_cpu(btree->hashval);
164 __entry->bt_before = be32_to_cpu(btree->before);
165 ),
166 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
167 "alist 0x%p size %u count %u firstu %u flags %d %s "
168 "node hashval %u, node before %u",
169 MAJOR(__entry->dev), MINOR(__entry->dev),
170 __entry->ino,
171 __entry->hashval,
172 __entry->blkno,
173 __entry->offset,
174 __entry->dupcnt,
175 __entry->alist,
176 __entry->bufsize,
177 __entry->count,
178 __entry->firstu,
179 __entry->flags,
180 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
181 __entry->bt_hashval,
182 __entry->bt_before)
183);
184
185TRACE_EVENT(xfs_iext_insert,
186 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
187 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
188 TP_ARGS(ip, idx, r, state, caller_ip),
189 TP_STRUCT__entry(
190 __field(dev_t, dev)
191 __field(xfs_ino_t, ino)
192 __field(xfs_extnum_t, idx)
193 __field(xfs_fileoff_t, startoff)
194 __field(xfs_fsblock_t, startblock)
195 __field(xfs_filblks_t, blockcount)
196 __field(xfs_exntst_t, state)
197 __field(int, bmap_state)
198 __field(unsigned long, caller_ip)
199 ),
200 TP_fast_assign(
201 __entry->dev = VFS_I(ip)->i_sb->s_dev;
202 __entry->ino = ip->i_ino;
203 __entry->idx = idx;
204 __entry->startoff = r->br_startoff;
205 __entry->startblock = r->br_startblock;
206 __entry->blockcount = r->br_blockcount;
207 __entry->state = r->br_state;
208 __entry->bmap_state = state;
209 __entry->caller_ip = caller_ip;
210 ),
211 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000212 "offset %lld block %lld count %lld flag %d caller %pf",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000213 MAJOR(__entry->dev), MINOR(__entry->dev),
214 __entry->ino,
215 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
216 (long)__entry->idx,
217 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000218 (__int64_t)__entry->startblock,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000219 __entry->blockcount,
220 __entry->state,
221 (char *)__entry->caller_ip)
222);
223
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000224DECLARE_EVENT_CLASS(xfs_bmap_class,
225 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
226 unsigned long caller_ip),
227 TP_ARGS(ip, idx, state, caller_ip),
228 TP_STRUCT__entry(
229 __field(dev_t, dev)
230 __field(xfs_ino_t, ino)
231 __field(xfs_extnum_t, idx)
232 __field(xfs_fileoff_t, startoff)
233 __field(xfs_fsblock_t, startblock)
234 __field(xfs_filblks_t, blockcount)
235 __field(xfs_exntst_t, state)
236 __field(int, bmap_state)
237 __field(unsigned long, caller_ip)
238 ),
239 TP_fast_assign(
240 struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ?
241 ip->i_afp : &ip->i_df;
242 struct xfs_bmbt_irec r;
243
244 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
245 __entry->dev = VFS_I(ip)->i_sb->s_dev;
246 __entry->ino = ip->i_ino;
247 __entry->idx = idx;
248 __entry->startoff = r.br_startoff;
249 __entry->startblock = r.br_startblock;
250 __entry->blockcount = r.br_blockcount;
251 __entry->state = r.br_state;
252 __entry->bmap_state = state;
253 __entry->caller_ip = caller_ip;
254 ),
255 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000256 "offset %lld block %lld count %lld flag %d caller %pf",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000257 MAJOR(__entry->dev), MINOR(__entry->dev),
258 __entry->ino,
259 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
260 (long)__entry->idx,
261 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000262 (__int64_t)__entry->startblock,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000263 __entry->blockcount,
264 __entry->state,
265 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000266)
267
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000268#define DEFINE_BMAP_EVENT(name) \
269DEFINE_EVENT(xfs_bmap_class, name, \
270 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
271 unsigned long caller_ip), \
272 TP_ARGS(ip, idx, state, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000273DEFINE_BMAP_EVENT(xfs_iext_remove);
274DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
275DEFINE_BMAP_EVENT(xfs_bmap_post_update);
276DEFINE_BMAP_EVENT(xfs_extlist);
277
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000278DECLARE_EVENT_CLASS(xfs_buf_class,
279 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
280 TP_ARGS(bp, caller_ip),
281 TP_STRUCT__entry(
282 __field(dev_t, dev)
283 __field(xfs_daddr_t, bno)
284 __field(size_t, buffer_length)
285 __field(int, hold)
286 __field(int, pincount)
287 __field(unsigned, lockval)
288 __field(unsigned, flags)
289 __field(unsigned long, caller_ip)
290 ),
291 TP_fast_assign(
292 __entry->dev = bp->b_target->bt_dev;
293 __entry->bno = bp->b_bn;
294 __entry->buffer_length = bp->b_buffer_length;
295 __entry->hold = atomic_read(&bp->b_hold);
296 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200297 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000298 __entry->flags = bp->b_flags;
299 __entry->caller_ip = caller_ip;
300 ),
301 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
302 "lock %d flags %s caller %pf",
303 MAJOR(__entry->dev), MINOR(__entry->dev),
304 (unsigned long long)__entry->bno,
305 __entry->buffer_length,
306 __entry->hold,
307 __entry->pincount,
308 __entry->lockval,
309 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
310 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000311)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000312
313#define DEFINE_BUF_EVENT(name) \
314DEFINE_EVENT(xfs_buf_class, name, \
315 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
316 TP_ARGS(bp, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000317DEFINE_BUF_EVENT(xfs_buf_init);
318DEFINE_BUF_EVENT(xfs_buf_free);
319DEFINE_BUF_EVENT(xfs_buf_hold);
320DEFINE_BUF_EVENT(xfs_buf_rele);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000321DEFINE_BUF_EVENT(xfs_buf_iodone);
322DEFINE_BUF_EVENT(xfs_buf_iorequest);
323DEFINE_BUF_EVENT(xfs_buf_bawrite);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000324DEFINE_BUF_EVENT(xfs_buf_lock);
325DEFINE_BUF_EVENT(xfs_buf_lock_done);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200326DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000327DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000328DEFINE_BUF_EVENT(xfs_buf_iowait);
329DEFINE_BUF_EVENT(xfs_buf_iowait_done);
330DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000331DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000332DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Dave Chinner686865f2010-09-24 20:07:47 +1000333DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000334DEFINE_BUF_EVENT(xfs_bdstrat_shut);
335DEFINE_BUF_EVENT(xfs_buf_item_relse);
336DEFINE_BUF_EVENT(xfs_buf_item_iodone);
337DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
338DEFINE_BUF_EVENT(xfs_buf_error_relse);
339DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
340DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
341
342/* not really buffer traces, but the buf provides useful information */
343DEFINE_BUF_EVENT(xfs_btree_corrupt);
344DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
345DEFINE_BUF_EVENT(xfs_reset_dqcounts);
346DEFINE_BUF_EVENT(xfs_inode_item_push);
347
348/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000349DECLARE_EVENT_CLASS(xfs_buf_flags_class,
350 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
351 TP_ARGS(bp, flags, caller_ip),
352 TP_STRUCT__entry(
353 __field(dev_t, dev)
354 __field(xfs_daddr_t, bno)
355 __field(size_t, buffer_length)
356 __field(int, hold)
357 __field(int, pincount)
358 __field(unsigned, lockval)
359 __field(unsigned, flags)
360 __field(unsigned long, caller_ip)
361 ),
362 TP_fast_assign(
363 __entry->dev = bp->b_target->bt_dev;
364 __entry->bno = bp->b_bn;
365 __entry->buffer_length = bp->b_buffer_length;
366 __entry->flags = flags;
367 __entry->hold = atomic_read(&bp->b_hold);
368 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200369 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000370 __entry->caller_ip = caller_ip;
371 ),
372 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
373 "lock %d flags %s caller %pf",
374 MAJOR(__entry->dev), MINOR(__entry->dev),
375 (unsigned long long)__entry->bno,
376 __entry->buffer_length,
377 __entry->hold,
378 __entry->pincount,
379 __entry->lockval,
380 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
381 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000382)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000383
384#define DEFINE_BUF_FLAGS_EVENT(name) \
385DEFINE_EVENT(xfs_buf_flags_class, name, \
386 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
387 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000388DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
389DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
390DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
391
392TRACE_EVENT(xfs_buf_ioerror,
393 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
394 TP_ARGS(bp, error, caller_ip),
395 TP_STRUCT__entry(
396 __field(dev_t, dev)
397 __field(xfs_daddr_t, bno)
398 __field(size_t, buffer_length)
399 __field(unsigned, flags)
400 __field(int, hold)
401 __field(int, pincount)
402 __field(unsigned, lockval)
403 __field(int, error)
404 __field(unsigned long, caller_ip)
405 ),
406 TP_fast_assign(
407 __entry->dev = bp->b_target->bt_dev;
408 __entry->bno = bp->b_bn;
409 __entry->buffer_length = bp->b_buffer_length;
410 __entry->hold = atomic_read(&bp->b_hold);
411 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200412 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000413 __entry->error = error;
414 __entry->flags = bp->b_flags;
415 __entry->caller_ip = caller_ip;
416 ),
417 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
418 "lock %d error %d flags %s caller %pf",
419 MAJOR(__entry->dev), MINOR(__entry->dev),
420 (unsigned long long)__entry->bno,
421 __entry->buffer_length,
422 __entry->hold,
423 __entry->pincount,
424 __entry->lockval,
425 __entry->error,
426 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
427 (void *)__entry->caller_ip)
428);
429
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000430DECLARE_EVENT_CLASS(xfs_buf_item_class,
431 TP_PROTO(struct xfs_buf_log_item *bip),
432 TP_ARGS(bip),
433 TP_STRUCT__entry(
434 __field(dev_t, dev)
435 __field(xfs_daddr_t, buf_bno)
436 __field(size_t, buf_len)
437 __field(int, buf_hold)
438 __field(int, buf_pincount)
439 __field(int, buf_lockval)
440 __field(unsigned, buf_flags)
441 __field(unsigned, bli_recur)
442 __field(int, bli_refcount)
443 __field(unsigned, bli_flags)
444 __field(void *, li_desc)
445 __field(unsigned, li_flags)
446 ),
447 TP_fast_assign(
448 __entry->dev = bip->bli_buf->b_target->bt_dev;
449 __entry->bli_flags = bip->bli_flags;
450 __entry->bli_recur = bip->bli_recur;
451 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
452 __entry->buf_bno = bip->bli_buf->b_bn;
453 __entry->buf_len = bip->bli_buf->b_buffer_length;
454 __entry->buf_flags = bip->bli_buf->b_flags;
455 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
456 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200457 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000458 __entry->li_desc = bip->bli_item.li_desc;
459 __entry->li_flags = bip->bli_item.li_flags;
460 ),
461 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
462 "lock %d flags %s recur %d refcount %d bliflags %s "
463 "lidesc 0x%p liflags %s",
464 MAJOR(__entry->dev), MINOR(__entry->dev),
465 (unsigned long long)__entry->buf_bno,
466 __entry->buf_len,
467 __entry->buf_hold,
468 __entry->buf_pincount,
469 __entry->buf_lockval,
470 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
471 __entry->bli_recur,
472 __entry->bli_refcount,
473 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
474 __entry->li_desc,
475 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000476)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000477
478#define DEFINE_BUF_ITEM_EVENT(name) \
479DEFINE_EVENT(xfs_buf_item_class, name, \
480 TP_PROTO(struct xfs_buf_log_item *bip), \
481 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000482DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
483DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
484DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
485DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
486DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
487DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
488DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000489DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
490DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
491DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
492DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
493DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
494DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
495DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
496DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
497DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
498DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
499DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
500DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
501DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
502DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
503DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
504DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
505
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000506DECLARE_EVENT_CLASS(xfs_lock_class,
507 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
508 unsigned long caller_ip),
509 TP_ARGS(ip, lock_flags, caller_ip),
510 TP_STRUCT__entry(
511 __field(dev_t, dev)
512 __field(xfs_ino_t, ino)
513 __field(int, lock_flags)
514 __field(unsigned long, caller_ip)
515 ),
516 TP_fast_assign(
517 __entry->dev = VFS_I(ip)->i_sb->s_dev;
518 __entry->ino = ip->i_ino;
519 __entry->lock_flags = lock_flags;
520 __entry->caller_ip = caller_ip;
521 ),
522 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf",
523 MAJOR(__entry->dev), MINOR(__entry->dev),
524 __entry->ino,
525 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
526 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000527)
528
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000529#define DEFINE_LOCK_EVENT(name) \
530DEFINE_EVENT(xfs_lock_class, name, \
531 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
532 unsigned long caller_ip), \
533 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000534DEFINE_LOCK_EVENT(xfs_ilock);
535DEFINE_LOCK_EVENT(xfs_ilock_nowait);
536DEFINE_LOCK_EVENT(xfs_ilock_demote);
537DEFINE_LOCK_EVENT(xfs_iunlock);
538
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000539DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000540 TP_PROTO(struct xfs_inode *ip),
541 TP_ARGS(ip),
542 TP_STRUCT__entry(
543 __field(dev_t, dev)
544 __field(xfs_ino_t, ino)
545 ),
546 TP_fast_assign(
547 __entry->dev = VFS_I(ip)->i_sb->s_dev;
548 __entry->ino = ip->i_ino;
549 ),
550 TP_printk("dev %d:%d ino 0x%llx",
551 MAJOR(__entry->dev), MINOR(__entry->dev),
552 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000553)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000554
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000555#define DEFINE_INODE_EVENT(name) \
556DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000557 TP_PROTO(struct xfs_inode *ip), \
558 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000559DEFINE_INODE_EVENT(xfs_iget_skip);
560DEFINE_INODE_EVENT(xfs_iget_reclaim);
561DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
562DEFINE_INODE_EVENT(xfs_iget_hit);
563DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000564
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000565DEFINE_INODE_EVENT(xfs_getattr);
566DEFINE_INODE_EVENT(xfs_setattr);
567DEFINE_INODE_EVENT(xfs_readlink);
568DEFINE_INODE_EVENT(xfs_alloc_file_space);
569DEFINE_INODE_EVENT(xfs_free_file_space);
570DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000571#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200572DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000573#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000574DEFINE_INODE_EVENT(xfs_vm_bmap);
575DEFINE_INODE_EVENT(xfs_file_ioctl);
576DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
577DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000578DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000579DEFINE_INODE_EVENT(xfs_file_fsync);
580DEFINE_INODE_EVENT(xfs_destroy_inode);
Christoph Hellwig8a9c9982012-02-29 09:53:52 +0000581DEFINE_INODE_EVENT(xfs_dirty_inode);
Al Virob57922d2010-06-07 14:34:48 -0400582DEFINE_INODE_EVENT(xfs_evict_inode);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000583
584DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
585DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
586
587DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000588 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
589 TP_ARGS(ip, caller_ip),
590 TP_STRUCT__entry(
591 __field(dev_t, dev)
592 __field(xfs_ino_t, ino)
593 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100594 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000595 __field(unsigned long, caller_ip)
596 ),
597 TP_fast_assign(
598 __entry->dev = VFS_I(ip)->i_sb->s_dev;
599 __entry->ino = ip->i_ino;
600 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100601 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000602 __entry->caller_ip = caller_ip;
603 ),
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100604 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pf",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000605 MAJOR(__entry->dev), MINOR(__entry->dev),
606 __entry->ino,
607 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100608 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000609 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000610)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000611
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000612#define DEFINE_IREF_EVENT(name) \
613DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000614 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
615 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000616DEFINE_IREF_EVENT(xfs_ihold);
617DEFINE_IREF_EVENT(xfs_irele);
618DEFINE_IREF_EVENT(xfs_inode_pin);
619DEFINE_IREF_EVENT(xfs_inode_unpin);
620DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100621
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000622DECLARE_EVENT_CLASS(xfs_namespace_class,
623 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
624 TP_ARGS(dp, name),
625 TP_STRUCT__entry(
626 __field(dev_t, dev)
627 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000628 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000629 __dynamic_array(char, name, name->len)
630 ),
631 TP_fast_assign(
632 __entry->dev = VFS_I(dp)->i_sb->s_dev;
633 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000634 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000635 memcpy(__get_str(name), name->name, name->len);
636 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000637 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000638 MAJOR(__entry->dev), MINOR(__entry->dev),
639 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000640 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000641 __get_str(name))
642)
643
644#define DEFINE_NAMESPACE_EVENT(name) \
645DEFINE_EVENT(xfs_namespace_class, name, \
646 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
647 TP_ARGS(dp, name))
648DEFINE_NAMESPACE_EVENT(xfs_remove);
649DEFINE_NAMESPACE_EVENT(xfs_link);
650DEFINE_NAMESPACE_EVENT(xfs_lookup);
651DEFINE_NAMESPACE_EVENT(xfs_create);
652DEFINE_NAMESPACE_EVENT(xfs_symlink);
653
654TRACE_EVENT(xfs_rename,
655 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
656 struct xfs_name *src_name, struct xfs_name *target_name),
657 TP_ARGS(src_dp, target_dp, src_name, target_name),
658 TP_STRUCT__entry(
659 __field(dev_t, dev)
660 __field(xfs_ino_t, src_dp_ino)
661 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000662 __field(int, src_namelen)
663 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000664 __dynamic_array(char, src_name, src_name->len)
665 __dynamic_array(char, target_name, target_name->len)
666 ),
667 TP_fast_assign(
668 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
669 __entry->src_dp_ino = src_dp->i_ino;
670 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000671 __entry->src_namelen = src_name->len;
672 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000673 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000674 memcpy(__get_str(target_name), target_name->name,
675 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000676 ),
677 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000678 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000679 MAJOR(__entry->dev), MINOR(__entry->dev),
680 __entry->src_dp_ino,
681 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000682 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000683 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000684 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000685 __get_str(target_name))
686)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000687
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000688DECLARE_EVENT_CLASS(xfs_dquot_class,
689 TP_PROTO(struct xfs_dquot *dqp),
690 TP_ARGS(dqp),
691 TP_STRUCT__entry(
692 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000693 __field(u32, id)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000694 __field(unsigned, flags)
695 __field(unsigned, nrefs)
696 __field(unsigned long long, res_bcount)
697 __field(unsigned long long, bcount)
698 __field(unsigned long long, icount)
699 __field(unsigned long long, blk_hardlimit)
700 __field(unsigned long long, blk_softlimit)
701 __field(unsigned long long, ino_hardlimit)
702 __field(unsigned long long, ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000703 ), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000704 TP_fast_assign(
705 __entry->dev = dqp->q_mount->m_super->s_dev;
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000706 __entry->id = be32_to_cpu(dqp->q_core.d_id);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000707 __entry->flags = dqp->dq_flags;
708 __entry->nrefs = dqp->q_nrefs;
709 __entry->res_bcount = dqp->q_res_bcount;
710 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
711 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
712 __entry->blk_hardlimit =
713 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
714 __entry->blk_softlimit =
715 be64_to_cpu(dqp->q_core.d_blk_softlimit);
716 __entry->ino_hardlimit =
717 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
718 __entry->ino_softlimit =
719 be64_to_cpu(dqp->q_core.d_ino_softlimit);
720 ),
721 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000722 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
723 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000724 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000725 __entry->id,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000726 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
727 __entry->nrefs,
728 __entry->res_bcount,
729 __entry->bcount,
730 __entry->blk_hardlimit,
731 __entry->blk_softlimit,
732 __entry->icount,
733 __entry->ino_hardlimit,
734 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000735)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000736
737#define DEFINE_DQUOT_EVENT(name) \
738DEFINE_EVENT(xfs_dquot_class, name, \
739 TP_PROTO(struct xfs_dquot *dqp), \
740 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000741DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000742DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
743DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b2012-02-01 13:57:20 +0000744DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
745DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000746DEFINE_DQUOT_EVENT(xfs_dqattach_found);
747DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000748DEFINE_DQUOT_EVENT(xfs_dqalloc);
749DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
750DEFINE_DQUOT_EVENT(xfs_dqread);
751DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000752DEFINE_DQUOT_EVENT(xfs_dqget_hit);
753DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000754DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
755DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000756DEFINE_DQUOT_EVENT(xfs_dqput);
757DEFINE_DQUOT_EVENT(xfs_dqput_wait);
758DEFINE_DQUOT_EVENT(xfs_dqput_free);
759DEFINE_DQUOT_EVENT(xfs_dqrele);
760DEFINE_DQUOT_EVENT(xfs_dqflush);
761DEFINE_DQUOT_EVENT(xfs_dqflush_force);
762DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000763
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000764DECLARE_EVENT_CLASS(xfs_loggrant_class,
765 TP_PROTO(struct log *log, struct xlog_ticket *tic),
766 TP_ARGS(log, tic),
767 TP_STRUCT__entry(
768 __field(dev_t, dev)
769 __field(unsigned, trans_type)
770 __field(char, ocnt)
771 __field(char, cnt)
772 __field(int, curr_res)
773 __field(int, unit_res)
774 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +1100775 __field(int, reserveq)
776 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000777 __field(int, grant_reserve_cycle)
778 __field(int, grant_reserve_bytes)
779 __field(int, grant_write_cycle)
780 __field(int, grant_write_bytes)
781 __field(int, curr_cycle)
782 __field(int, curr_block)
783 __field(xfs_lsn_t, tail_lsn)
784 ),
785 TP_fast_assign(
786 __entry->dev = log->l_mp->m_super->s_dev;
787 __entry->trans_type = tic->t_trans_type;
788 __entry->ocnt = tic->t_ocnt;
789 __entry->cnt = tic->t_cnt;
790 __entry->curr_res = tic->t_curr_res;
791 __entry->unit_res = tic->t_unit_res;
792 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +0000793 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
794 __entry->writeq = list_empty(&log->l_write_head.waiters);
795 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100796 &__entry->grant_reserve_cycle,
797 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +0000798 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100799 &__entry->grant_write_cycle,
800 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000801 __entry->curr_cycle = log->l_curr_cycle;
802 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +1100803 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000804 ),
805 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +1100806 "t_unit_res %u t_flags %s reserveq %s "
807 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000808 "grant_reserve_bytes %d grant_write_cycle %d "
809 "grant_write_bytes %d curr_cycle %d curr_block %d "
810 "tail_cycle %d tail_block %d",
811 MAJOR(__entry->dev), MINOR(__entry->dev),
812 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
813 __entry->ocnt,
814 __entry->cnt,
815 __entry->curr_res,
816 __entry->unit_res,
817 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +1100818 __entry->reserveq ? "empty" : "active",
819 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000820 __entry->grant_reserve_cycle,
821 __entry->grant_reserve_bytes,
822 __entry->grant_write_cycle,
823 __entry->grant_write_bytes,
824 __entry->curr_cycle,
825 __entry->curr_block,
826 CYCLE_LSN(__entry->tail_lsn),
827 BLOCK_LSN(__entry->tail_lsn)
828 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000829)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000830
831#define DEFINE_LOGGRANT_EVENT(name) \
832DEFINE_EVENT(xfs_loggrant_class, name, \
833 TP_PROTO(struct log *log, struct xlog_ticket *tic), \
834 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000835DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
836DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000837DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +0000838DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
839DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +1100840DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +0000841DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
842DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
843DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
844DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000845DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
846DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
847DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
848DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
849DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
850DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
851
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000852DECLARE_EVENT_CLASS(xfs_log_item_class,
853 TP_PROTO(struct xfs_log_item *lip),
854 TP_ARGS(lip),
855 TP_STRUCT__entry(
856 __field(dev_t, dev)
857 __field(void *, lip)
858 __field(uint, type)
859 __field(uint, flags)
860 __field(xfs_lsn_t, lsn)
861 ),
862 TP_fast_assign(
863 __entry->dev = lip->li_mountp->m_super->s_dev;
864 __entry->lip = lip;
865 __entry->type = lip->li_type;
866 __entry->flags = lip->li_flags;
867 __entry->lsn = lip->li_lsn;
868 ),
869 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
870 MAJOR(__entry->dev), MINOR(__entry->dev),
871 __entry->lip,
872 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
873 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
874 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
875)
876
877#define DEFINE_LOG_ITEM_EVENT(name) \
878DEFINE_EVENT(xfs_log_item_class, name, \
879 TP_PROTO(struct xfs_log_item *lip), \
880 TP_ARGS(lip))
881DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000882DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
883DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000884DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000885
886
Li Zefanf8adb4d2010-05-24 08:25:57 +0000887DECLARE_EVENT_CLASS(xfs_file_class,
888 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags),
889 TP_ARGS(ip, count, offset, flags),
890 TP_STRUCT__entry(
891 __field(dev_t, dev)
892 __field(xfs_ino_t, ino)
893 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000894 __field(loff_t, offset)
895 __field(size_t, count)
896 __field(int, flags)
897 ),
898 TP_fast_assign(
899 __entry->dev = VFS_I(ip)->i_sb->s_dev;
900 __entry->ino = ip->i_ino;
901 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +0000902 __entry->offset = offset;
903 __entry->count = count;
904 __entry->flags = flags;
905 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +0000906 TP_printk("dev %d:%d ino 0x%llx size 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +0000907 "offset 0x%llx count 0x%zx ioflags %s",
908 MAJOR(__entry->dev), MINOR(__entry->dev),
909 __entry->ino,
910 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +0000911 __entry->offset,
912 __entry->count,
913 __print_flags(__entry->flags, "|", XFS_IO_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000914)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000915
916#define DEFINE_RW_EVENT(name) \
917DEFINE_EVENT(xfs_file_class, name, \
918 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
919 TP_ARGS(ip, count, offset, flags))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000920DEFINE_RW_EVENT(xfs_file_read);
921DEFINE_RW_EVENT(xfs_file_buffered_write);
922DEFINE_RW_EVENT(xfs_file_direct_write);
923DEFINE_RW_EVENT(xfs_file_splice_read);
924DEFINE_RW_EVENT(xfs_file_splice_write);
925
Li Zefanf8adb4d2010-05-24 08:25:57 +0000926DECLARE_EVENT_CLASS(xfs_page_class,
927 TP_PROTO(struct inode *inode, struct page *page, unsigned long off),
928 TP_ARGS(inode, page, off),
929 TP_STRUCT__entry(
930 __field(dev_t, dev)
931 __field(xfs_ino_t, ino)
932 __field(pgoff_t, pgoff)
933 __field(loff_t, size)
934 __field(unsigned long, offset)
935 __field(int, delalloc)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000936 __field(int, unwritten)
937 ),
938 TP_fast_assign(
Christoph Hellwig20cb52e2010-06-24 09:46:01 +1000939 int delalloc = -1, unwritten = -1;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000940
Li Zefanf8adb4d2010-05-24 08:25:57 +0000941 if (page_has_buffers(page))
Christoph Hellwig20cb52e2010-06-24 09:46:01 +1000942 xfs_count_page_state(page, &delalloc, &unwritten);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000943 __entry->dev = inode->i_sb->s_dev;
944 __entry->ino = XFS_I(inode)->i_ino;
945 __entry->pgoff = page_offset(page);
946 __entry->size = i_size_read(inode);
947 __entry->offset = off;
948 __entry->delalloc = delalloc;
Li Zefanf8adb4d2010-05-24 08:25:57 +0000949 __entry->unwritten = unwritten;
950 ),
951 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
Christoph Hellwig20cb52e2010-06-24 09:46:01 +1000952 "delalloc %d unwritten %d",
Li Zefanf8adb4d2010-05-24 08:25:57 +0000953 MAJOR(__entry->dev), MINOR(__entry->dev),
954 __entry->ino,
955 __entry->pgoff,
956 __entry->size,
957 __entry->offset,
958 __entry->delalloc,
Li Zefanf8adb4d2010-05-24 08:25:57 +0000959 __entry->unwritten)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000960)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000961
962#define DEFINE_PAGE_EVENT(name) \
963DEFINE_EVENT(xfs_page_class, name, \
964 TP_PROTO(struct inode *inode, struct page *page, unsigned long off), \
965 TP_ARGS(inode, page, off))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000966DEFINE_PAGE_EVENT(xfs_writepage);
967DEFINE_PAGE_EVENT(xfs_releasepage);
968DEFINE_PAGE_EVENT(xfs_invalidatepage);
969
Christoph Hellwiga206c812010-12-10 08:42:20 +0000970DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +0000971 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwiga206c812010-12-10 08:42:20 +0000972 int type, struct xfs_bmbt_irec *irec),
973 TP_ARGS(ip, offset, count, type, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +0000974 TP_STRUCT__entry(
975 __field(dev_t, dev)
976 __field(xfs_ino_t, ino)
977 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000978 __field(loff_t, offset)
979 __field(size_t, count)
Christoph Hellwiga206c812010-12-10 08:42:20 +0000980 __field(int, type)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000981 __field(xfs_fileoff_t, startoff)
982 __field(xfs_fsblock_t, startblock)
983 __field(xfs_filblks_t, blockcount)
984 ),
985 TP_fast_assign(
986 __entry->dev = VFS_I(ip)->i_sb->s_dev;
987 __entry->ino = ip->i_ino;
988 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +0000989 __entry->offset = offset;
990 __entry->count = count;
Christoph Hellwiga206c812010-12-10 08:42:20 +0000991 __entry->type = type;
Li Zefanf8adb4d2010-05-24 08:25:57 +0000992 __entry->startoff = irec ? irec->br_startoff : 0;
993 __entry->startblock = irec ? irec->br_startblock : 0;
994 __entry->blockcount = irec ? irec->br_blockcount : 0;
995 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +0000996 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
997 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +0000998 MAJOR(__entry->dev), MINOR(__entry->dev),
999 __entry->ino,
1000 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001001 __entry->offset,
1002 __entry->count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001003 __print_symbolic(__entry->type, XFS_IO_TYPES),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001004 __entry->startoff,
1005 (__int64_t)__entry->startblock,
1006 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001007)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001008
1009#define DEFINE_IOMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001010DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001011 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001012 int type, struct xfs_bmbt_irec *irec), \
1013 TP_ARGS(ip, offset, count, type, irec))
1014DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1015DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1016DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1017DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001018
Li Zefanf8adb4d2010-05-24 08:25:57 +00001019DECLARE_EVENT_CLASS(xfs_simple_io_class,
1020 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1021 TP_ARGS(ip, offset, count),
1022 TP_STRUCT__entry(
1023 __field(dev_t, dev)
1024 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001025 __field(loff_t, isize)
1026 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001027 __field(loff_t, offset)
1028 __field(size_t, count)
1029 ),
1030 TP_fast_assign(
1031 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1032 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001033 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001034 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001035 __entry->offset = offset;
1036 __entry->count = count;
1037 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001038 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001039 "offset 0x%llx count %zd",
1040 MAJOR(__entry->dev), MINOR(__entry->dev),
1041 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001042 __entry->isize,
1043 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001044 __entry->offset,
1045 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001046);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001047
1048#define DEFINE_SIMPLE_IO_EVENT(name) \
1049DEFINE_EVENT(xfs_simple_io_class, name, \
1050 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1051 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001052DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1053DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Christoph Hellwiga206c812010-12-10 08:42:20 +00001054DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001055DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001056
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001057DECLARE_EVENT_CLASS(xfs_itrunc_class,
1058 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1059 TP_ARGS(ip, new_size),
1060 TP_STRUCT__entry(
1061 __field(dev_t, dev)
1062 __field(xfs_ino_t, ino)
1063 __field(xfs_fsize_t, size)
1064 __field(xfs_fsize_t, new_size)
1065 ),
1066 TP_fast_assign(
1067 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1068 __entry->ino = ip->i_ino;
1069 __entry->size = ip->i_d.di_size;
1070 __entry->new_size = new_size;
1071 ),
1072 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1073 MAJOR(__entry->dev), MINOR(__entry->dev),
1074 __entry->ino,
1075 __entry->size,
1076 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001077)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001078
1079#define DEFINE_ITRUNC_EVENT(name) \
1080DEFINE_EVENT(xfs_itrunc_class, name, \
1081 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1082 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001083DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1084DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001085
1086TRACE_EVENT(xfs_pagecache_inval,
1087 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1088 TP_ARGS(ip, start, finish),
1089 TP_STRUCT__entry(
1090 __field(dev_t, dev)
1091 __field(xfs_ino_t, ino)
1092 __field(xfs_fsize_t, size)
1093 __field(xfs_off_t, start)
1094 __field(xfs_off_t, finish)
1095 ),
1096 TP_fast_assign(
1097 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1098 __entry->ino = ip->i_ino;
1099 __entry->size = ip->i_d.di_size;
1100 __entry->start = start;
1101 __entry->finish = finish;
1102 ),
1103 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1104 MAJOR(__entry->dev), MINOR(__entry->dev),
1105 __entry->ino,
1106 __entry->size,
1107 __entry->start,
1108 __entry->finish)
1109);
1110
1111TRACE_EVENT(xfs_bunmap,
1112 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1113 int flags, unsigned long caller_ip),
1114 TP_ARGS(ip, bno, len, flags, caller_ip),
1115 TP_STRUCT__entry(
1116 __field(dev_t, dev)
1117 __field(xfs_ino_t, ino)
1118 __field(xfs_fsize_t, size)
1119 __field(xfs_fileoff_t, bno)
1120 __field(xfs_filblks_t, len)
1121 __field(unsigned long, caller_ip)
1122 __field(int, flags)
1123 ),
1124 TP_fast_assign(
1125 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1126 __entry->ino = ip->i_ino;
1127 __entry->size = ip->i_d.di_size;
1128 __entry->bno = bno;
1129 __entry->len = len;
1130 __entry->caller_ip = caller_ip;
1131 __entry->flags = flags;
1132 ),
1133 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1134 "flags %s caller %pf",
1135 MAJOR(__entry->dev), MINOR(__entry->dev),
1136 __entry->ino,
1137 __entry->size,
1138 __entry->bno,
1139 __entry->len,
1140 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1141 (void *)__entry->caller_ip)
1142
1143);
1144
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001145DECLARE_EVENT_CLASS(xfs_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001146 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1147 xfs_agblock_t agbno, xfs_extlen_t len),
1148 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001149 TP_STRUCT__entry(
1150 __field(dev_t, dev)
1151 __field(xfs_agnumber_t, agno)
1152 __field(xfs_agblock_t, agbno)
1153 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001154 ),
1155 TP_fast_assign(
1156 __entry->dev = mp->m_super->s_dev;
1157 __entry->agno = agno;
1158 __entry->agbno = agbno;
1159 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001160 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001161 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001162 MAJOR(__entry->dev), MINOR(__entry->dev),
1163 __entry->agno,
1164 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001165 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001166);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001167#define DEFINE_BUSY_EVENT(name) \
1168DEFINE_EVENT(xfs_busy_class, name, \
1169 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1170 xfs_agblock_t agbno, xfs_extlen_t len), \
1171 TP_ARGS(mp, agno, agbno, len))
1172DEFINE_BUSY_EVENT(xfs_alloc_busy);
1173DEFINE_BUSY_EVENT(xfs_alloc_busy_enomem);
1174DEFINE_BUSY_EVENT(xfs_alloc_busy_force);
1175DEFINE_BUSY_EVENT(xfs_alloc_busy_reuse);
1176DEFINE_BUSY_EVENT(xfs_alloc_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001177
Christoph Hellwige26f0502011-04-24 19:06:15 +00001178TRACE_EVENT(xfs_alloc_busy_trim,
1179 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1180 xfs_agblock_t agbno, xfs_extlen_t len,
1181 xfs_agblock_t tbno, xfs_extlen_t tlen),
1182 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1183 TP_STRUCT__entry(
1184 __field(dev_t, dev)
1185 __field(xfs_agnumber_t, agno)
1186 __field(xfs_agblock_t, agbno)
1187 __field(xfs_extlen_t, len)
1188 __field(xfs_agblock_t, tbno)
1189 __field(xfs_extlen_t, tlen)
1190 ),
1191 TP_fast_assign(
1192 __entry->dev = mp->m_super->s_dev;
1193 __entry->agno = agno;
1194 __entry->agbno = agbno;
1195 __entry->len = len;
1196 __entry->tbno = tbno;
1197 __entry->tlen = tlen;
1198 ),
1199 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1200 MAJOR(__entry->dev), MINOR(__entry->dev),
1201 __entry->agno,
1202 __entry->agbno,
1203 __entry->len,
1204 __entry->tbno,
1205 __entry->tlen)
1206);
1207
Dave Chinnered3b4d62010-05-21 12:07:08 +10001208TRACE_EVENT(xfs_trans_commit_lsn,
1209 TP_PROTO(struct xfs_trans *trans),
1210 TP_ARGS(trans),
1211 TP_STRUCT__entry(
1212 __field(dev_t, dev)
1213 __field(struct xfs_trans *, tp)
1214 __field(xfs_lsn_t, lsn)
1215 ),
1216 TP_fast_assign(
1217 __entry->dev = trans->t_mountp->m_super->s_dev;
1218 __entry->tp = trans;
1219 __entry->lsn = trans->t_commit_lsn;
1220 ),
1221 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1222 MAJOR(__entry->dev), MINOR(__entry->dev),
1223 __entry->tp,
Dave Chinnerfd45e4782010-01-02 02:38:56 +00001224 __entry->lsn)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001225);
1226
1227TRACE_EVENT(xfs_agf,
1228 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1229 unsigned long caller_ip),
1230 TP_ARGS(mp, agf, flags, caller_ip),
1231 TP_STRUCT__entry(
1232 __field(dev_t, dev)
1233 __field(xfs_agnumber_t, agno)
1234 __field(int, flags)
1235 __field(__u32, length)
1236 __field(__u32, bno_root)
1237 __field(__u32, cnt_root)
1238 __field(__u32, bno_level)
1239 __field(__u32, cnt_level)
1240 __field(__u32, flfirst)
1241 __field(__u32, fllast)
1242 __field(__u32, flcount)
1243 __field(__u32, freeblks)
1244 __field(__u32, longest)
1245 __field(unsigned long, caller_ip)
1246 ),
1247 TP_fast_assign(
1248 __entry->dev = mp->m_super->s_dev;
1249 __entry->agno = be32_to_cpu(agf->agf_seqno),
1250 __entry->flags = flags;
1251 __entry->length = be32_to_cpu(agf->agf_length),
1252 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1253 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1254 __entry->bno_level =
1255 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1256 __entry->cnt_level =
1257 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1258 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1259 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1260 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1261 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1262 __entry->longest = be32_to_cpu(agf->agf_longest);
1263 __entry->caller_ip = caller_ip;
1264 ),
1265 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1266 "levels b %u c %u flfirst %u fllast %u flcount %u "
1267 "freeblks %u longest %u caller %pf",
1268 MAJOR(__entry->dev), MINOR(__entry->dev),
1269 __entry->agno,
1270 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1271 __entry->length,
1272 __entry->bno_root,
1273 __entry->cnt_root,
1274 __entry->bno_level,
1275 __entry->cnt_level,
1276 __entry->flfirst,
1277 __entry->fllast,
1278 __entry->flcount,
1279 __entry->freeblks,
1280 __entry->longest,
1281 (void *)__entry->caller_ip)
1282);
1283
1284TRACE_EVENT(xfs_free_extent,
1285 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1286 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1287 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1288 TP_STRUCT__entry(
1289 __field(dev_t, dev)
1290 __field(xfs_agnumber_t, agno)
1291 __field(xfs_agblock_t, agbno)
1292 __field(xfs_extlen_t, len)
1293 __field(int, isfl)
1294 __field(int, haveleft)
1295 __field(int, haveright)
1296 ),
1297 TP_fast_assign(
1298 __entry->dev = mp->m_super->s_dev;
1299 __entry->agno = agno;
1300 __entry->agbno = agbno;
1301 __entry->len = len;
1302 __entry->isfl = isfl;
1303 __entry->haveleft = haveleft;
1304 __entry->haveright = haveright;
1305 ),
1306 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1307 MAJOR(__entry->dev), MINOR(__entry->dev),
1308 __entry->agno,
1309 __entry->agbno,
1310 __entry->len,
1311 __entry->isfl,
1312 __entry->haveleft ?
1313 (__entry->haveright ? "both" : "left") :
1314 (__entry->haveright ? "right" : "none"))
1315
1316);
1317
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001318DECLARE_EVENT_CLASS(xfs_alloc_class,
1319 TP_PROTO(struct xfs_alloc_arg *args),
1320 TP_ARGS(args),
1321 TP_STRUCT__entry(
1322 __field(dev_t, dev)
1323 __field(xfs_agnumber_t, agno)
1324 __field(xfs_agblock_t, agbno)
1325 __field(xfs_extlen_t, minlen)
1326 __field(xfs_extlen_t, maxlen)
1327 __field(xfs_extlen_t, mod)
1328 __field(xfs_extlen_t, prod)
1329 __field(xfs_extlen_t, minleft)
1330 __field(xfs_extlen_t, total)
1331 __field(xfs_extlen_t, alignment)
1332 __field(xfs_extlen_t, minalignslop)
1333 __field(xfs_extlen_t, len)
1334 __field(short, type)
1335 __field(short, otype)
1336 __field(char, wasdel)
1337 __field(char, wasfromfl)
1338 __field(char, isfl)
1339 __field(char, userdata)
1340 __field(xfs_fsblock_t, firstblock)
1341 ),
1342 TP_fast_assign(
1343 __entry->dev = args->mp->m_super->s_dev;
1344 __entry->agno = args->agno;
1345 __entry->agbno = args->agbno;
1346 __entry->minlen = args->minlen;
1347 __entry->maxlen = args->maxlen;
1348 __entry->mod = args->mod;
1349 __entry->prod = args->prod;
1350 __entry->minleft = args->minleft;
1351 __entry->total = args->total;
1352 __entry->alignment = args->alignment;
1353 __entry->minalignslop = args->minalignslop;
1354 __entry->len = args->len;
1355 __entry->type = args->type;
1356 __entry->otype = args->otype;
1357 __entry->wasdel = args->wasdel;
1358 __entry->wasfromfl = args->wasfromfl;
1359 __entry->isfl = args->isfl;
1360 __entry->userdata = args->userdata;
1361 __entry->firstblock = args->firstblock;
1362 ),
1363 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1364 "prod %u minleft %u total %u alignment %u minalignslop %u "
1365 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1366 "userdata %d firstblock 0x%llx",
1367 MAJOR(__entry->dev), MINOR(__entry->dev),
1368 __entry->agno,
1369 __entry->agbno,
1370 __entry->minlen,
1371 __entry->maxlen,
1372 __entry->mod,
1373 __entry->prod,
1374 __entry->minleft,
1375 __entry->total,
1376 __entry->alignment,
1377 __entry->minalignslop,
1378 __entry->len,
1379 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1380 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1381 __entry->wasdel,
1382 __entry->wasfromfl,
1383 __entry->isfl,
1384 __entry->userdata,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001385 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001386)
1387
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001388#define DEFINE_ALLOC_EVENT(name) \
1389DEFINE_EVENT(xfs_alloc_class, name, \
1390 TP_PROTO(struct xfs_alloc_arg *args), \
1391 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001392DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001393DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001394DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1395DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1396DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1397DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1398DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1399DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001400DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1401DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001402DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1403DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1404DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1405DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1406DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001407DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001408DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1409DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1410DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1411DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1412DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1413DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1414DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1415DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1416DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1417
Dave Chinner5a5881c2012-03-22 05:15:13 +00001418DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001419 TP_PROTO(struct xfs_da_args *args),
1420 TP_ARGS(args),
1421 TP_STRUCT__entry(
1422 __field(dev_t, dev)
1423 __field(xfs_ino_t, ino)
1424 __dynamic_array(char, name, args->namelen)
1425 __field(int, namelen)
1426 __field(xfs_dahash_t, hashval)
1427 __field(xfs_ino_t, inumber)
1428 __field(int, op_flags)
1429 ),
1430 TP_fast_assign(
1431 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1432 __entry->ino = args->dp->i_ino;
1433 if (args->namelen)
1434 memcpy(__get_str(name), args->name, args->namelen);
1435 __entry->namelen = args->namelen;
1436 __entry->hashval = args->hashval;
1437 __entry->inumber = args->inumber;
1438 __entry->op_flags = args->op_flags;
1439 ),
1440 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1441 "inumber 0x%llx op_flags %s",
1442 MAJOR(__entry->dev), MINOR(__entry->dev),
1443 __entry->ino,
1444 __entry->namelen,
1445 __entry->namelen ? __get_str(name) : NULL,
1446 __entry->namelen,
1447 __entry->hashval,
1448 __entry->inumber,
1449 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001450)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001451
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001452#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001453DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001454 TP_PROTO(struct xfs_da_args *args), \
1455 TP_ARGS(args))
1456DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1457DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1458DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1459DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1460DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1461DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1462DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1463DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1464DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1465DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1466DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1467DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1468DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1469DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1470DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1471DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1472DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1473DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1474DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1475DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1476DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1477DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1478DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1479DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1480DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1481
Dave Chinner5a5881c2012-03-22 05:15:13 +00001482#define DEFINE_ATTR_EVENT(name) \
1483DEFINE_EVENT(xfs_da_class, name, \
1484 TP_PROTO(struct xfs_da_args *args), \
1485 TP_ARGS(args))
1486DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1487DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1488DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1489DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1490DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1491DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
1492DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1493
1494DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1495DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1496DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
1497DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1498DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
1499DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1500DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
1501DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1502DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1503DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1504DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1505DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1506DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1507DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1508DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1509DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1510DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1511DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
1512
1513DEFINE_ATTR_EVENT(xfs_attr_node_addname);
1514DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
1515DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1516DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1517
1518#define DEFINE_DA_EVENT(name) \
1519DEFINE_EVENT(xfs_da_class, name, \
1520 TP_PROTO(struct xfs_da_args *args), \
1521 TP_ARGS(args))
1522DEFINE_DA_EVENT(xfs_da_split);
1523DEFINE_DA_EVENT(xfs_da_join);
1524DEFINE_DA_EVENT(xfs_da_link_before);
1525DEFINE_DA_EVENT(xfs_da_link_after);
1526DEFINE_DA_EVENT(xfs_da_unlink_back);
1527DEFINE_DA_EVENT(xfs_da_unlink_forward);
1528DEFINE_DA_EVENT(xfs_da_root_split);
1529DEFINE_DA_EVENT(xfs_da_root_join);
1530DEFINE_DA_EVENT(xfs_da_node_add);
1531DEFINE_DA_EVENT(xfs_da_node_create);
1532DEFINE_DA_EVENT(xfs_da_node_split);
1533DEFINE_DA_EVENT(xfs_da_node_remove);
1534DEFINE_DA_EVENT(xfs_da_node_rebalance);
1535DEFINE_DA_EVENT(xfs_da_node_unbalance);
1536DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1537DEFINE_DA_EVENT(xfs_da_grow_inode);
1538DEFINE_DA_EVENT(xfs_da_shrink_inode);
1539
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001540DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1541 TP_PROTO(struct xfs_da_args *args, int idx),
1542 TP_ARGS(args, idx),
1543 TP_STRUCT__entry(
1544 __field(dev_t, dev)
1545 __field(xfs_ino_t, ino)
1546 __field(int, op_flags)
1547 __field(int, idx)
1548 ),
1549 TP_fast_assign(
1550 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1551 __entry->ino = args->dp->i_ino;
1552 __entry->op_flags = args->op_flags;
1553 __entry->idx = idx;
1554 ),
1555 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1556 MAJOR(__entry->dev), MINOR(__entry->dev),
1557 __entry->ino,
1558 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1559 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001560)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001561
1562#define DEFINE_DIR2_SPACE_EVENT(name) \
1563DEFINE_EVENT(xfs_dir2_space_class, name, \
1564 TP_PROTO(struct xfs_da_args *args, int idx), \
1565 TP_ARGS(args, idx))
1566DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1567DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1568DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1569DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001570
1571TRACE_EVENT(xfs_dir2_leafn_moveents,
1572 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1573 TP_ARGS(args, src_idx, dst_idx, count),
1574 TP_STRUCT__entry(
1575 __field(dev_t, dev)
1576 __field(xfs_ino_t, ino)
1577 __field(int, op_flags)
1578 __field(int, src_idx)
1579 __field(int, dst_idx)
1580 __field(int, count)
1581 ),
1582 TP_fast_assign(
1583 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1584 __entry->ino = args->dp->i_ino;
1585 __entry->op_flags = args->op_flags;
1586 __entry->src_idx = src_idx;
1587 __entry->dst_idx = dst_idx;
1588 __entry->count = count;
1589 ),
1590 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1591 "src_idx %d dst_idx %d count %d",
1592 MAJOR(__entry->dev), MINOR(__entry->dev),
1593 __entry->ino,
1594 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1595 __entry->src_idx,
1596 __entry->dst_idx,
1597 __entry->count)
1598);
1599
Dave Chinner3a85cd92010-01-14 01:33:55 +00001600#define XFS_SWAPEXT_INODES \
1601 { 0, "target" }, \
1602 { 1, "temp" }
1603
1604#define XFS_INODE_FORMAT_STR \
1605 { 0, "invalid" }, \
1606 { 1, "local" }, \
1607 { 2, "extent" }, \
1608 { 3, "btree" }
1609
1610DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1611 TP_PROTO(struct xfs_inode *ip, int which),
1612 TP_ARGS(ip, which),
1613 TP_STRUCT__entry(
1614 __field(dev_t, dev)
1615 __field(int, which)
1616 __field(xfs_ino_t, ino)
1617 __field(int, format)
1618 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00001619 __field(int, broot_size)
1620 __field(int, fork_off)
1621 ),
1622 TP_fast_assign(
1623 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1624 __entry->which = which;
1625 __entry->ino = ip->i_ino;
1626 __entry->format = ip->i_d.di_format;
1627 __entry->nex = ip->i_d.di_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00001628 __entry->broot_size = ip->i_df.if_broot_bytes;
1629 __entry->fork_off = XFS_IFORK_BOFF(ip);
1630 ),
1631 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00001632 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00001633 MAJOR(__entry->dev), MINOR(__entry->dev),
1634 __entry->ino,
1635 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1636 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1637 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00001638 __entry->broot_size,
1639 __entry->fork_off)
1640)
1641
1642#define DEFINE_SWAPEXT_EVENT(name) \
1643DEFINE_EVENT(xfs_swap_extent_class, name, \
1644 TP_PROTO(struct xfs_inode *ip, int which), \
1645 TP_ARGS(ip, which))
1646
1647DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1648DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1649
Dave Chinner9abbc532010-04-13 15:06:46 +10001650DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
1651 TP_PROTO(struct log *log, struct xlog_recover *trans,
1652 struct xlog_recover_item *item, int pass),
1653 TP_ARGS(log, trans, item, pass),
1654 TP_STRUCT__entry(
1655 __field(dev_t, dev)
1656 __field(unsigned long, item)
1657 __field(xlog_tid_t, tid)
1658 __field(int, type)
1659 __field(int, pass)
1660 __field(int, count)
1661 __field(int, total)
1662 ),
1663 TP_fast_assign(
1664 __entry->dev = log->l_mp->m_super->s_dev;
1665 __entry->item = (unsigned long)item;
1666 __entry->tid = trans->r_log_tid;
1667 __entry->type = ITEM_TYPE(item);
1668 __entry->pass = pass;
1669 __entry->count = item->ri_cnt;
1670 __entry->total = item->ri_total;
1671 ),
1672 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
1673 "item region count/total %d/%d",
1674 MAJOR(__entry->dev), MINOR(__entry->dev),
1675 __entry->tid,
1676 __entry->pass,
1677 (void *)__entry->item,
1678 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1679 __entry->count,
1680 __entry->total)
1681)
1682
1683#define DEFINE_LOG_RECOVER_ITEM(name) \
1684DEFINE_EVENT(xfs_log_recover_item_class, name, \
1685 TP_PROTO(struct log *log, struct xlog_recover *trans, \
1686 struct xlog_recover_item *item, int pass), \
1687 TP_ARGS(log, trans, item, pass))
1688
1689DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
1690DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
1691DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
1692DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
1693DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
1694
1695DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
1696 TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f),
1697 TP_ARGS(log, buf_f),
1698 TP_STRUCT__entry(
1699 __field(dev_t, dev)
1700 __field(__int64_t, blkno)
1701 __field(unsigned short, len)
1702 __field(unsigned short, flags)
1703 __field(unsigned short, size)
1704 __field(unsigned int, map_size)
1705 ),
1706 TP_fast_assign(
1707 __entry->dev = log->l_mp->m_super->s_dev;
1708 __entry->blkno = buf_f->blf_blkno;
1709 __entry->len = buf_f->blf_len;
1710 __entry->flags = buf_f->blf_flags;
1711 __entry->size = buf_f->blf_size;
1712 __entry->map_size = buf_f->blf_map_size;
1713 ),
1714 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
1715 "map_size %d",
1716 MAJOR(__entry->dev), MINOR(__entry->dev),
1717 __entry->blkno,
1718 __entry->len,
1719 __entry->flags,
1720 __entry->size,
1721 __entry->map_size)
1722)
1723
1724#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
1725DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
1726 TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f), \
1727 TP_ARGS(log, buf_f))
1728
1729DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
1730DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
1731DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
1732DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
1733DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
1734DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
1735DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
1736DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
1737
1738DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
1739 TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f),
1740 TP_ARGS(log, in_f),
1741 TP_STRUCT__entry(
1742 __field(dev_t, dev)
1743 __field(xfs_ino_t, ino)
1744 __field(unsigned short, size)
1745 __field(int, fields)
1746 __field(unsigned short, asize)
1747 __field(unsigned short, dsize)
1748 __field(__int64_t, blkno)
1749 __field(int, len)
1750 __field(int, boffset)
1751 ),
1752 TP_fast_assign(
1753 __entry->dev = log->l_mp->m_super->s_dev;
1754 __entry->ino = in_f->ilf_ino;
1755 __entry->size = in_f->ilf_size;
1756 __entry->fields = in_f->ilf_fields;
1757 __entry->asize = in_f->ilf_asize;
1758 __entry->dsize = in_f->ilf_dsize;
1759 __entry->blkno = in_f->ilf_blkno;
1760 __entry->len = in_f->ilf_len;
1761 __entry->boffset = in_f->ilf_boffset;
1762 ),
1763 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
1764 "dsize %d, blkno 0x%llx, len %d, boffset %d",
1765 MAJOR(__entry->dev), MINOR(__entry->dev),
1766 __entry->ino,
1767 __entry->size,
1768 __entry->fields,
1769 __entry->asize,
1770 __entry->dsize,
1771 __entry->blkno,
1772 __entry->len,
1773 __entry->boffset)
1774)
1775#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
1776DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
1777 TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f), \
1778 TP_ARGS(log, in_f))
1779
1780DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
1781DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
1782DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
1783
Christoph Hellwiga46db602011-01-07 13:02:04 +00001784DECLARE_EVENT_CLASS(xfs_discard_class,
1785 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1786 xfs_agblock_t agbno, xfs_extlen_t len),
1787 TP_ARGS(mp, agno, agbno, len),
1788 TP_STRUCT__entry(
1789 __field(dev_t, dev)
1790 __field(xfs_agnumber_t, agno)
1791 __field(xfs_agblock_t, agbno)
1792 __field(xfs_extlen_t, len)
1793 ),
1794 TP_fast_assign(
1795 __entry->dev = mp->m_super->s_dev;
1796 __entry->agno = agno;
1797 __entry->agbno = agbno;
1798 __entry->len = len;
1799 ),
1800 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
1801 MAJOR(__entry->dev), MINOR(__entry->dev),
1802 __entry->agno,
1803 __entry->agbno,
1804 __entry->len)
1805)
1806
1807#define DEFINE_DISCARD_EVENT(name) \
1808DEFINE_EVENT(xfs_discard_class, name, \
1809 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1810 xfs_agblock_t agbno, xfs_extlen_t len), \
1811 TP_ARGS(mp, agno, agbno, len))
1812DEFINE_DISCARD_EVENT(xfs_discard_extent);
1813DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
1814DEFINE_DISCARD_EVENT(xfs_discard_exclude);
1815DEFINE_DISCARD_EVENT(xfs_discard_busy);
1816
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001817#endif /* _TRACE_XFS_H */
1818
1819#undef TRACE_INCLUDE_PATH
1820#define TRACE_INCLUDE_PATH .
1821#define TRACE_INCLUDE_FILE xfs_trace
1822#include <trace/define_trace.h>