blob: 49403579887324b87c821bc7eb62b0114314ce20 [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);
331DEFINE_BUF_EVENT(xfs_buf_delwri_dequeue);
332DEFINE_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);
489DEFINE_BUF_ITEM_EVENT(xfs_buf_item_trylock);
490DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
491DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
492DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
493DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
Dave Chinnerd808f612010-02-02 10:13:42 +1100494DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pushbuf);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000495DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
496DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
497DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
498DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
499DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
500DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
501DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
502DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
503DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
504DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
505DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
506DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
507
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000508DECLARE_EVENT_CLASS(xfs_lock_class,
509 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
510 unsigned long caller_ip),
511 TP_ARGS(ip, lock_flags, caller_ip),
512 TP_STRUCT__entry(
513 __field(dev_t, dev)
514 __field(xfs_ino_t, ino)
515 __field(int, lock_flags)
516 __field(unsigned long, caller_ip)
517 ),
518 TP_fast_assign(
519 __entry->dev = VFS_I(ip)->i_sb->s_dev;
520 __entry->ino = ip->i_ino;
521 __entry->lock_flags = lock_flags;
522 __entry->caller_ip = caller_ip;
523 ),
524 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf",
525 MAJOR(__entry->dev), MINOR(__entry->dev),
526 __entry->ino,
527 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
528 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000529)
530
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000531#define DEFINE_LOCK_EVENT(name) \
532DEFINE_EVENT(xfs_lock_class, name, \
533 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
534 unsigned long caller_ip), \
535 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000536DEFINE_LOCK_EVENT(xfs_ilock);
537DEFINE_LOCK_EVENT(xfs_ilock_nowait);
538DEFINE_LOCK_EVENT(xfs_ilock_demote);
539DEFINE_LOCK_EVENT(xfs_iunlock);
540
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000541DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000542 TP_PROTO(struct xfs_inode *ip),
543 TP_ARGS(ip),
544 TP_STRUCT__entry(
545 __field(dev_t, dev)
546 __field(xfs_ino_t, ino)
547 ),
548 TP_fast_assign(
549 __entry->dev = VFS_I(ip)->i_sb->s_dev;
550 __entry->ino = ip->i_ino;
551 ),
552 TP_printk("dev %d:%d ino 0x%llx",
553 MAJOR(__entry->dev), MINOR(__entry->dev),
554 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000555)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000556
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000557#define DEFINE_INODE_EVENT(name) \
558DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000559 TP_PROTO(struct xfs_inode *ip), \
560 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000561DEFINE_INODE_EVENT(xfs_iget_skip);
562DEFINE_INODE_EVENT(xfs_iget_reclaim);
563DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
564DEFINE_INODE_EVENT(xfs_iget_hit);
565DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000566
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000567DEFINE_INODE_EVENT(xfs_getattr);
568DEFINE_INODE_EVENT(xfs_setattr);
569DEFINE_INODE_EVENT(xfs_readlink);
570DEFINE_INODE_EVENT(xfs_alloc_file_space);
571DEFINE_INODE_EVENT(xfs_free_file_space);
572DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000573#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200574DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000575#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000576DEFINE_INODE_EVENT(xfs_vm_bmap);
577DEFINE_INODE_EVENT(xfs_file_ioctl);
578DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
579DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000580DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000581DEFINE_INODE_EVENT(xfs_file_fsync);
582DEFINE_INODE_EVENT(xfs_destroy_inode);
583DEFINE_INODE_EVENT(xfs_write_inode);
Al Virob57922d2010-06-07 14:34:48 -0400584DEFINE_INODE_EVENT(xfs_evict_inode);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000585
586DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
587DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
588
589DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000590 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
591 TP_ARGS(ip, caller_ip),
592 TP_STRUCT__entry(
593 __field(dev_t, dev)
594 __field(xfs_ino_t, ino)
595 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100596 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000597 __field(unsigned long, caller_ip)
598 ),
599 TP_fast_assign(
600 __entry->dev = VFS_I(ip)->i_sb->s_dev;
601 __entry->ino = ip->i_ino;
602 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100603 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000604 __entry->caller_ip = caller_ip;
605 ),
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100606 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pf",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000607 MAJOR(__entry->dev), MINOR(__entry->dev),
608 __entry->ino,
609 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100610 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000611 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000612)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000613
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000614#define DEFINE_IREF_EVENT(name) \
615DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000616 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
617 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000618DEFINE_IREF_EVENT(xfs_ihold);
619DEFINE_IREF_EVENT(xfs_irele);
620DEFINE_IREF_EVENT(xfs_inode_pin);
621DEFINE_IREF_EVENT(xfs_inode_unpin);
622DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100623
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000624DECLARE_EVENT_CLASS(xfs_namespace_class,
625 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
626 TP_ARGS(dp, name),
627 TP_STRUCT__entry(
628 __field(dev_t, dev)
629 __field(xfs_ino_t, dp_ino)
630 __dynamic_array(char, name, name->len)
631 ),
632 TP_fast_assign(
633 __entry->dev = VFS_I(dp)->i_sb->s_dev;
634 __entry->dp_ino = dp->i_ino;
635 memcpy(__get_str(name), name->name, name->len);
636 ),
637 TP_printk("dev %d:%d dp ino 0x%llx name %s",
638 MAJOR(__entry->dev), MINOR(__entry->dev),
639 __entry->dp_ino,
640 __get_str(name))
641)
642
643#define DEFINE_NAMESPACE_EVENT(name) \
644DEFINE_EVENT(xfs_namespace_class, name, \
645 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
646 TP_ARGS(dp, name))
647DEFINE_NAMESPACE_EVENT(xfs_remove);
648DEFINE_NAMESPACE_EVENT(xfs_link);
649DEFINE_NAMESPACE_EVENT(xfs_lookup);
650DEFINE_NAMESPACE_EVENT(xfs_create);
651DEFINE_NAMESPACE_EVENT(xfs_symlink);
652
653TRACE_EVENT(xfs_rename,
654 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
655 struct xfs_name *src_name, struct xfs_name *target_name),
656 TP_ARGS(src_dp, target_dp, src_name, target_name),
657 TP_STRUCT__entry(
658 __field(dev_t, dev)
659 __field(xfs_ino_t, src_dp_ino)
660 __field(xfs_ino_t, target_dp_ino)
661 __dynamic_array(char, src_name, src_name->len)
662 __dynamic_array(char, target_name, target_name->len)
663 ),
664 TP_fast_assign(
665 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
666 __entry->src_dp_ino = src_dp->i_ino;
667 __entry->target_dp_ino = target_dp->i_ino;
668 memcpy(__get_str(src_name), src_name->name, src_name->len);
669 memcpy(__get_str(target_name), target_name->name, target_name->len);
670 ),
671 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
672 " src name %s target name %s",
673 MAJOR(__entry->dev), MINOR(__entry->dev),
674 __entry->src_dp_ino,
675 __entry->target_dp_ino,
676 __get_str(src_name),
677 __get_str(target_name))
678)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000679
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000680DECLARE_EVENT_CLASS(xfs_dquot_class,
681 TP_PROTO(struct xfs_dquot *dqp),
682 TP_ARGS(dqp),
683 TP_STRUCT__entry(
684 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000685 __field(u32, id)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000686 __field(unsigned, flags)
687 __field(unsigned, nrefs)
688 __field(unsigned long long, res_bcount)
689 __field(unsigned long long, bcount)
690 __field(unsigned long long, icount)
691 __field(unsigned long long, blk_hardlimit)
692 __field(unsigned long long, blk_softlimit)
693 __field(unsigned long long, ino_hardlimit)
694 __field(unsigned long long, ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000695 ), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000696 TP_fast_assign(
697 __entry->dev = dqp->q_mount->m_super->s_dev;
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000698 __entry->id = be32_to_cpu(dqp->q_core.d_id);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000699 __entry->flags = dqp->dq_flags;
700 __entry->nrefs = dqp->q_nrefs;
701 __entry->res_bcount = dqp->q_res_bcount;
702 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
703 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
704 __entry->blk_hardlimit =
705 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
706 __entry->blk_softlimit =
707 be64_to_cpu(dqp->q_core.d_blk_softlimit);
708 __entry->ino_hardlimit =
709 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
710 __entry->ino_softlimit =
711 be64_to_cpu(dqp->q_core.d_ino_softlimit);
712 ),
713 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000714 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
715 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000716 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000717 __entry->id,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000718 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
719 __entry->nrefs,
720 __entry->res_bcount,
721 __entry->bcount,
722 __entry->blk_hardlimit,
723 __entry->blk_softlimit,
724 __entry->icount,
725 __entry->ino_hardlimit,
726 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000727)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000728
729#define DEFINE_DQUOT_EVENT(name) \
730DEFINE_EVENT(xfs_dquot_class, name, \
731 TP_PROTO(struct xfs_dquot *dqp), \
732 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000733DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000734DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
735DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
736DEFINE_DQUOT_EVENT(xfs_dqreclaim_unlink);
737DEFINE_DQUOT_EVENT(xfs_dqattach_found);
738DEFINE_DQUOT_EVENT(xfs_dqattach_get);
739DEFINE_DQUOT_EVENT(xfs_dqinit);
740DEFINE_DQUOT_EVENT(xfs_dqreuse);
741DEFINE_DQUOT_EVENT(xfs_dqalloc);
742DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
743DEFINE_DQUOT_EVENT(xfs_dqread);
744DEFINE_DQUOT_EVENT(xfs_dqread_fail);
745DEFINE_DQUOT_EVENT(xfs_dqlookup_found);
746DEFINE_DQUOT_EVENT(xfs_dqlookup_want);
747DEFINE_DQUOT_EVENT(xfs_dqlookup_freelist);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000748DEFINE_DQUOT_EVENT(xfs_dqlookup_done);
749DEFINE_DQUOT_EVENT(xfs_dqget_hit);
750DEFINE_DQUOT_EVENT(xfs_dqget_miss);
751DEFINE_DQUOT_EVENT(xfs_dqput);
752DEFINE_DQUOT_EVENT(xfs_dqput_wait);
753DEFINE_DQUOT_EVENT(xfs_dqput_free);
754DEFINE_DQUOT_EVENT(xfs_dqrele);
755DEFINE_DQUOT_EVENT(xfs_dqflush);
756DEFINE_DQUOT_EVENT(xfs_dqflush_force);
757DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000758
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000759DECLARE_EVENT_CLASS(xfs_loggrant_class,
760 TP_PROTO(struct log *log, struct xlog_ticket *tic),
761 TP_ARGS(log, tic),
762 TP_STRUCT__entry(
763 __field(dev_t, dev)
764 __field(unsigned, trans_type)
765 __field(char, ocnt)
766 __field(char, cnt)
767 __field(int, curr_res)
768 __field(int, unit_res)
769 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +1100770 __field(int, reserveq)
771 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000772 __field(int, grant_reserve_cycle)
773 __field(int, grant_reserve_bytes)
774 __field(int, grant_write_cycle)
775 __field(int, grant_write_bytes)
776 __field(int, curr_cycle)
777 __field(int, curr_block)
778 __field(xfs_lsn_t, tail_lsn)
779 ),
780 TP_fast_assign(
781 __entry->dev = log->l_mp->m_super->s_dev;
782 __entry->trans_type = tic->t_trans_type;
783 __entry->ocnt = tic->t_ocnt;
784 __entry->cnt = tic->t_cnt;
785 __entry->curr_res = tic->t_curr_res;
786 __entry->unit_res = tic->t_unit_res;
787 __entry->flags = tic->t_flags;
Dave Chinner10547942010-12-21 12:02:25 +1100788 __entry->reserveq = list_empty(&log->l_reserveq);
789 __entry->writeq = list_empty(&log->l_writeq);
Dave Chinnera69ed032010-12-21 12:08:20 +1100790 xlog_crack_grant_head(&log->l_grant_reserve_head,
791 &__entry->grant_reserve_cycle,
792 &__entry->grant_reserve_bytes);
793 xlog_crack_grant_head(&log->l_grant_write_head,
794 &__entry->grant_write_cycle,
795 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000796 __entry->curr_cycle = log->l_curr_cycle;
797 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +1100798 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000799 ),
800 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +1100801 "t_unit_res %u t_flags %s reserveq %s "
802 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000803 "grant_reserve_bytes %d grant_write_cycle %d "
804 "grant_write_bytes %d curr_cycle %d curr_block %d "
805 "tail_cycle %d tail_block %d",
806 MAJOR(__entry->dev), MINOR(__entry->dev),
807 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
808 __entry->ocnt,
809 __entry->cnt,
810 __entry->curr_res,
811 __entry->unit_res,
812 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +1100813 __entry->reserveq ? "empty" : "active",
814 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000815 __entry->grant_reserve_cycle,
816 __entry->grant_reserve_bytes,
817 __entry->grant_write_cycle,
818 __entry->grant_write_bytes,
819 __entry->curr_cycle,
820 __entry->curr_block,
821 CYCLE_LSN(__entry->tail_lsn),
822 BLOCK_LSN(__entry->tail_lsn)
823 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000824)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000825
826#define DEFINE_LOGGRANT_EVENT(name) \
827DEFINE_EVENT(xfs_loggrant_class, name, \
828 TP_PROTO(struct log *log, struct xlog_ticket *tic), \
829 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000830DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
831DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
832DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
833DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
834DEFINE_LOGGRANT_EVENT(xfs_log_grant_enter);
835DEFINE_LOGGRANT_EVENT(xfs_log_grant_exit);
836DEFINE_LOGGRANT_EVENT(xfs_log_grant_error);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +0000837DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
838DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +1100839DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000840DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_enter);
841DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_exit);
842DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_error);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +0000843DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep);
844DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +1100845DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake_up);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000846DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
847DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
848DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
849DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
850DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
851DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
852
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000853DECLARE_EVENT_CLASS(xfs_log_item_class,
854 TP_PROTO(struct xfs_log_item *lip),
855 TP_ARGS(lip),
856 TP_STRUCT__entry(
857 __field(dev_t, dev)
858 __field(void *, lip)
859 __field(uint, type)
860 __field(uint, flags)
861 __field(xfs_lsn_t, lsn)
862 ),
863 TP_fast_assign(
864 __entry->dev = lip->li_mountp->m_super->s_dev;
865 __entry->lip = lip;
866 __entry->type = lip->li_type;
867 __entry->flags = lip->li_flags;
868 __entry->lsn = lip->li_lsn;
869 ),
870 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
871 MAJOR(__entry->dev), MINOR(__entry->dev),
872 __entry->lip,
873 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
874 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
875 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
876)
877
878#define DEFINE_LOG_ITEM_EVENT(name) \
879DEFINE_EVENT(xfs_log_item_class, name, \
880 TP_PROTO(struct xfs_log_item *lip), \
881 TP_ARGS(lip))
882DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
883DEFINE_LOG_ITEM_EVENT(xfs_ail_pushbuf);
884DEFINE_LOG_ITEM_EVENT(xfs_ail_pushbuf_pinned);
885DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
886DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
887
888
Li Zefanf8adb4d2010-05-24 08:25:57 +0000889DECLARE_EVENT_CLASS(xfs_file_class,
890 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags),
891 TP_ARGS(ip, count, offset, flags),
892 TP_STRUCT__entry(
893 __field(dev_t, dev)
894 __field(xfs_ino_t, ino)
895 __field(xfs_fsize_t, size)
896 __field(xfs_fsize_t, new_size)
897 __field(loff_t, offset)
898 __field(size_t, count)
899 __field(int, flags)
900 ),
901 TP_fast_assign(
902 __entry->dev = VFS_I(ip)->i_sb->s_dev;
903 __entry->ino = ip->i_ino;
904 __entry->size = ip->i_d.di_size;
905 __entry->new_size = ip->i_new_size;
906 __entry->offset = offset;
907 __entry->count = count;
908 __entry->flags = flags;
909 ),
910 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx "
911 "offset 0x%llx count 0x%zx ioflags %s",
912 MAJOR(__entry->dev), MINOR(__entry->dev),
913 __entry->ino,
914 __entry->size,
915 __entry->new_size,
916 __entry->offset,
917 __entry->count,
918 __print_flags(__entry->flags, "|", XFS_IO_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000919)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000920
921#define DEFINE_RW_EVENT(name) \
922DEFINE_EVENT(xfs_file_class, name, \
923 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
924 TP_ARGS(ip, count, offset, flags))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000925DEFINE_RW_EVENT(xfs_file_read);
926DEFINE_RW_EVENT(xfs_file_buffered_write);
927DEFINE_RW_EVENT(xfs_file_direct_write);
928DEFINE_RW_EVENT(xfs_file_splice_read);
929DEFINE_RW_EVENT(xfs_file_splice_write);
930
Li Zefanf8adb4d2010-05-24 08:25:57 +0000931DECLARE_EVENT_CLASS(xfs_page_class,
932 TP_PROTO(struct inode *inode, struct page *page, unsigned long off),
933 TP_ARGS(inode, page, off),
934 TP_STRUCT__entry(
935 __field(dev_t, dev)
936 __field(xfs_ino_t, ino)
937 __field(pgoff_t, pgoff)
938 __field(loff_t, size)
939 __field(unsigned long, offset)
940 __field(int, delalloc)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000941 __field(int, unwritten)
942 ),
943 TP_fast_assign(
Christoph Hellwig20cb52e2010-06-24 09:46:01 +1000944 int delalloc = -1, unwritten = -1;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000945
Li Zefanf8adb4d2010-05-24 08:25:57 +0000946 if (page_has_buffers(page))
Christoph Hellwig20cb52e2010-06-24 09:46:01 +1000947 xfs_count_page_state(page, &delalloc, &unwritten);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000948 __entry->dev = inode->i_sb->s_dev;
949 __entry->ino = XFS_I(inode)->i_ino;
950 __entry->pgoff = page_offset(page);
951 __entry->size = i_size_read(inode);
952 __entry->offset = off;
953 __entry->delalloc = delalloc;
Li Zefanf8adb4d2010-05-24 08:25:57 +0000954 __entry->unwritten = unwritten;
955 ),
956 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
Christoph Hellwig20cb52e2010-06-24 09:46:01 +1000957 "delalloc %d unwritten %d",
Li Zefanf8adb4d2010-05-24 08:25:57 +0000958 MAJOR(__entry->dev), MINOR(__entry->dev),
959 __entry->ino,
960 __entry->pgoff,
961 __entry->size,
962 __entry->offset,
963 __entry->delalloc,
Li Zefanf8adb4d2010-05-24 08:25:57 +0000964 __entry->unwritten)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000965)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000966
967#define DEFINE_PAGE_EVENT(name) \
968DEFINE_EVENT(xfs_page_class, name, \
969 TP_PROTO(struct inode *inode, struct page *page, unsigned long off), \
970 TP_ARGS(inode, page, off))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000971DEFINE_PAGE_EVENT(xfs_writepage);
972DEFINE_PAGE_EVENT(xfs_releasepage);
973DEFINE_PAGE_EVENT(xfs_invalidatepage);
974
Christoph Hellwiga206c812010-12-10 08:42:20 +0000975DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +0000976 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwiga206c812010-12-10 08:42:20 +0000977 int type, struct xfs_bmbt_irec *irec),
978 TP_ARGS(ip, offset, count, type, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +0000979 TP_STRUCT__entry(
980 __field(dev_t, dev)
981 __field(xfs_ino_t, ino)
982 __field(loff_t, size)
983 __field(loff_t, new_size)
984 __field(loff_t, offset)
985 __field(size_t, count)
Christoph Hellwiga206c812010-12-10 08:42:20 +0000986 __field(int, type)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000987 __field(xfs_fileoff_t, startoff)
988 __field(xfs_fsblock_t, startblock)
989 __field(xfs_filblks_t, blockcount)
990 ),
991 TP_fast_assign(
992 __entry->dev = VFS_I(ip)->i_sb->s_dev;
993 __entry->ino = ip->i_ino;
994 __entry->size = ip->i_d.di_size;
995 __entry->new_size = ip->i_new_size;
996 __entry->offset = offset;
997 __entry->count = count;
Christoph Hellwiga206c812010-12-10 08:42:20 +0000998 __entry->type = type;
Li Zefanf8adb4d2010-05-24 08:25:57 +0000999 __entry->startoff = irec ? irec->br_startoff : 0;
1000 __entry->startblock = irec ? irec->br_startblock : 0;
1001 __entry->blockcount = irec ? irec->br_blockcount : 0;
1002 ),
1003 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx "
Christoph Hellwiga206c812010-12-10 08:42:20 +00001004 "offset 0x%llx count %zd type %s "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001005 "startoff 0x%llx startblock %lld blockcount 0x%llx",
1006 MAJOR(__entry->dev), MINOR(__entry->dev),
1007 __entry->ino,
1008 __entry->size,
1009 __entry->new_size,
1010 __entry->offset,
1011 __entry->count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001012 __print_symbolic(__entry->type, XFS_IO_TYPES),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001013 __entry->startoff,
1014 (__int64_t)__entry->startblock,
1015 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001016)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001017
1018#define DEFINE_IOMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001019DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001020 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001021 int type, struct xfs_bmbt_irec *irec), \
1022 TP_ARGS(ip, offset, count, type, irec))
1023DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1024DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1025DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1026DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001027
Li Zefanf8adb4d2010-05-24 08:25:57 +00001028DECLARE_EVENT_CLASS(xfs_simple_io_class,
1029 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1030 TP_ARGS(ip, offset, count),
1031 TP_STRUCT__entry(
1032 __field(dev_t, dev)
1033 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001034 __field(loff_t, isize)
1035 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001036 __field(loff_t, new_size)
1037 __field(loff_t, offset)
1038 __field(size_t, count)
1039 ),
1040 TP_fast_assign(
1041 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1042 __entry->ino = ip->i_ino;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001043 __entry->isize = ip->i_size;
1044 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001045 __entry->new_size = ip->i_new_size;
1046 __entry->offset = offset;
1047 __entry->count = count;
1048 ),
Dave Chinner55fb25d52011-07-18 03:40:19 +00001049 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx new_size 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001050 "offset 0x%llx count %zd",
1051 MAJOR(__entry->dev), MINOR(__entry->dev),
1052 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001053 __entry->isize,
1054 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001055 __entry->new_size,
1056 __entry->offset,
1057 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001058);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001059
1060#define DEFINE_SIMPLE_IO_EVENT(name) \
1061DEFINE_EVENT(xfs_simple_io_class, name, \
1062 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1063 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001064DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1065DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Christoph Hellwiga206c812010-12-10 08:42:20 +00001066DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001067DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001068
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001069DECLARE_EVENT_CLASS(xfs_itrunc_class,
1070 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1071 TP_ARGS(ip, new_size),
1072 TP_STRUCT__entry(
1073 __field(dev_t, dev)
1074 __field(xfs_ino_t, ino)
1075 __field(xfs_fsize_t, size)
1076 __field(xfs_fsize_t, new_size)
1077 ),
1078 TP_fast_assign(
1079 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1080 __entry->ino = ip->i_ino;
1081 __entry->size = ip->i_d.di_size;
1082 __entry->new_size = new_size;
1083 ),
1084 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1085 MAJOR(__entry->dev), MINOR(__entry->dev),
1086 __entry->ino,
1087 __entry->size,
1088 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001089)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001090
1091#define DEFINE_ITRUNC_EVENT(name) \
1092DEFINE_EVENT(xfs_itrunc_class, name, \
1093 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1094 TP_ARGS(ip, new_size))
Christoph Hellwig8f04c472011-07-08 14:34:34 +02001095DEFINE_ITRUNC_EVENT(xfs_itruncate_data_start);
1096DEFINE_ITRUNC_EVENT(xfs_itruncate_data_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001097
1098TRACE_EVENT(xfs_pagecache_inval,
1099 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1100 TP_ARGS(ip, start, finish),
1101 TP_STRUCT__entry(
1102 __field(dev_t, dev)
1103 __field(xfs_ino_t, ino)
1104 __field(xfs_fsize_t, size)
1105 __field(xfs_off_t, start)
1106 __field(xfs_off_t, finish)
1107 ),
1108 TP_fast_assign(
1109 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1110 __entry->ino = ip->i_ino;
1111 __entry->size = ip->i_d.di_size;
1112 __entry->start = start;
1113 __entry->finish = finish;
1114 ),
1115 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1116 MAJOR(__entry->dev), MINOR(__entry->dev),
1117 __entry->ino,
1118 __entry->size,
1119 __entry->start,
1120 __entry->finish)
1121);
1122
1123TRACE_EVENT(xfs_bunmap,
1124 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1125 int flags, unsigned long caller_ip),
1126 TP_ARGS(ip, bno, len, flags, caller_ip),
1127 TP_STRUCT__entry(
1128 __field(dev_t, dev)
1129 __field(xfs_ino_t, ino)
1130 __field(xfs_fsize_t, size)
1131 __field(xfs_fileoff_t, bno)
1132 __field(xfs_filblks_t, len)
1133 __field(unsigned long, caller_ip)
1134 __field(int, flags)
1135 ),
1136 TP_fast_assign(
1137 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1138 __entry->ino = ip->i_ino;
1139 __entry->size = ip->i_d.di_size;
1140 __entry->bno = bno;
1141 __entry->len = len;
1142 __entry->caller_ip = caller_ip;
1143 __entry->flags = flags;
1144 ),
1145 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1146 "flags %s caller %pf",
1147 MAJOR(__entry->dev), MINOR(__entry->dev),
1148 __entry->ino,
1149 __entry->size,
1150 __entry->bno,
1151 __entry->len,
1152 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1153 (void *)__entry->caller_ip)
1154
1155);
1156
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001157DECLARE_EVENT_CLASS(xfs_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001158 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1159 xfs_agblock_t agbno, xfs_extlen_t len),
1160 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001161 TP_STRUCT__entry(
1162 __field(dev_t, dev)
1163 __field(xfs_agnumber_t, agno)
1164 __field(xfs_agblock_t, agbno)
1165 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001166 ),
1167 TP_fast_assign(
1168 __entry->dev = mp->m_super->s_dev;
1169 __entry->agno = agno;
1170 __entry->agbno = agbno;
1171 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001172 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001173 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001174 MAJOR(__entry->dev), MINOR(__entry->dev),
1175 __entry->agno,
1176 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001177 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001178);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001179#define DEFINE_BUSY_EVENT(name) \
1180DEFINE_EVENT(xfs_busy_class, name, \
1181 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1182 xfs_agblock_t agbno, xfs_extlen_t len), \
1183 TP_ARGS(mp, agno, agbno, len))
1184DEFINE_BUSY_EVENT(xfs_alloc_busy);
1185DEFINE_BUSY_EVENT(xfs_alloc_busy_enomem);
1186DEFINE_BUSY_EVENT(xfs_alloc_busy_force);
1187DEFINE_BUSY_EVENT(xfs_alloc_busy_reuse);
1188DEFINE_BUSY_EVENT(xfs_alloc_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001189
Christoph Hellwige26f0502011-04-24 19:06:15 +00001190TRACE_EVENT(xfs_alloc_busy_trim,
1191 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1192 xfs_agblock_t agbno, xfs_extlen_t len,
1193 xfs_agblock_t tbno, xfs_extlen_t tlen),
1194 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
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(xfs_agblock_t, tbno)
1201 __field(xfs_extlen_t, tlen)
1202 ),
1203 TP_fast_assign(
1204 __entry->dev = mp->m_super->s_dev;
1205 __entry->agno = agno;
1206 __entry->agbno = agbno;
1207 __entry->len = len;
1208 __entry->tbno = tbno;
1209 __entry->tlen = tlen;
1210 ),
1211 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1212 MAJOR(__entry->dev), MINOR(__entry->dev),
1213 __entry->agno,
1214 __entry->agbno,
1215 __entry->len,
1216 __entry->tbno,
1217 __entry->tlen)
1218);
1219
Dave Chinnered3b4d62010-05-21 12:07:08 +10001220TRACE_EVENT(xfs_trans_commit_lsn,
1221 TP_PROTO(struct xfs_trans *trans),
1222 TP_ARGS(trans),
1223 TP_STRUCT__entry(
1224 __field(dev_t, dev)
1225 __field(struct xfs_trans *, tp)
1226 __field(xfs_lsn_t, lsn)
1227 ),
1228 TP_fast_assign(
1229 __entry->dev = trans->t_mountp->m_super->s_dev;
1230 __entry->tp = trans;
1231 __entry->lsn = trans->t_commit_lsn;
1232 ),
1233 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1234 MAJOR(__entry->dev), MINOR(__entry->dev),
1235 __entry->tp,
Dave Chinnerfd45e4782010-01-02 02:38:56 +00001236 __entry->lsn)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001237);
1238
1239TRACE_EVENT(xfs_agf,
1240 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1241 unsigned long caller_ip),
1242 TP_ARGS(mp, agf, flags, caller_ip),
1243 TP_STRUCT__entry(
1244 __field(dev_t, dev)
1245 __field(xfs_agnumber_t, agno)
1246 __field(int, flags)
1247 __field(__u32, length)
1248 __field(__u32, bno_root)
1249 __field(__u32, cnt_root)
1250 __field(__u32, bno_level)
1251 __field(__u32, cnt_level)
1252 __field(__u32, flfirst)
1253 __field(__u32, fllast)
1254 __field(__u32, flcount)
1255 __field(__u32, freeblks)
1256 __field(__u32, longest)
1257 __field(unsigned long, caller_ip)
1258 ),
1259 TP_fast_assign(
1260 __entry->dev = mp->m_super->s_dev;
1261 __entry->agno = be32_to_cpu(agf->agf_seqno),
1262 __entry->flags = flags;
1263 __entry->length = be32_to_cpu(agf->agf_length),
1264 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1265 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1266 __entry->bno_level =
1267 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1268 __entry->cnt_level =
1269 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1270 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1271 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1272 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1273 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1274 __entry->longest = be32_to_cpu(agf->agf_longest);
1275 __entry->caller_ip = caller_ip;
1276 ),
1277 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1278 "levels b %u c %u flfirst %u fllast %u flcount %u "
1279 "freeblks %u longest %u caller %pf",
1280 MAJOR(__entry->dev), MINOR(__entry->dev),
1281 __entry->agno,
1282 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1283 __entry->length,
1284 __entry->bno_root,
1285 __entry->cnt_root,
1286 __entry->bno_level,
1287 __entry->cnt_level,
1288 __entry->flfirst,
1289 __entry->fllast,
1290 __entry->flcount,
1291 __entry->freeblks,
1292 __entry->longest,
1293 (void *)__entry->caller_ip)
1294);
1295
1296TRACE_EVENT(xfs_free_extent,
1297 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1298 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1299 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1300 TP_STRUCT__entry(
1301 __field(dev_t, dev)
1302 __field(xfs_agnumber_t, agno)
1303 __field(xfs_agblock_t, agbno)
1304 __field(xfs_extlen_t, len)
1305 __field(int, isfl)
1306 __field(int, haveleft)
1307 __field(int, haveright)
1308 ),
1309 TP_fast_assign(
1310 __entry->dev = mp->m_super->s_dev;
1311 __entry->agno = agno;
1312 __entry->agbno = agbno;
1313 __entry->len = len;
1314 __entry->isfl = isfl;
1315 __entry->haveleft = haveleft;
1316 __entry->haveright = haveright;
1317 ),
1318 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1319 MAJOR(__entry->dev), MINOR(__entry->dev),
1320 __entry->agno,
1321 __entry->agbno,
1322 __entry->len,
1323 __entry->isfl,
1324 __entry->haveleft ?
1325 (__entry->haveright ? "both" : "left") :
1326 (__entry->haveright ? "right" : "none"))
1327
1328);
1329
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001330DECLARE_EVENT_CLASS(xfs_alloc_class,
1331 TP_PROTO(struct xfs_alloc_arg *args),
1332 TP_ARGS(args),
1333 TP_STRUCT__entry(
1334 __field(dev_t, dev)
1335 __field(xfs_agnumber_t, agno)
1336 __field(xfs_agblock_t, agbno)
1337 __field(xfs_extlen_t, minlen)
1338 __field(xfs_extlen_t, maxlen)
1339 __field(xfs_extlen_t, mod)
1340 __field(xfs_extlen_t, prod)
1341 __field(xfs_extlen_t, minleft)
1342 __field(xfs_extlen_t, total)
1343 __field(xfs_extlen_t, alignment)
1344 __field(xfs_extlen_t, minalignslop)
1345 __field(xfs_extlen_t, len)
1346 __field(short, type)
1347 __field(short, otype)
1348 __field(char, wasdel)
1349 __field(char, wasfromfl)
1350 __field(char, isfl)
1351 __field(char, userdata)
1352 __field(xfs_fsblock_t, firstblock)
1353 ),
1354 TP_fast_assign(
1355 __entry->dev = args->mp->m_super->s_dev;
1356 __entry->agno = args->agno;
1357 __entry->agbno = args->agbno;
1358 __entry->minlen = args->minlen;
1359 __entry->maxlen = args->maxlen;
1360 __entry->mod = args->mod;
1361 __entry->prod = args->prod;
1362 __entry->minleft = args->minleft;
1363 __entry->total = args->total;
1364 __entry->alignment = args->alignment;
1365 __entry->minalignslop = args->minalignslop;
1366 __entry->len = args->len;
1367 __entry->type = args->type;
1368 __entry->otype = args->otype;
1369 __entry->wasdel = args->wasdel;
1370 __entry->wasfromfl = args->wasfromfl;
1371 __entry->isfl = args->isfl;
1372 __entry->userdata = args->userdata;
1373 __entry->firstblock = args->firstblock;
1374 ),
1375 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1376 "prod %u minleft %u total %u alignment %u minalignslop %u "
1377 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1378 "userdata %d firstblock 0x%llx",
1379 MAJOR(__entry->dev), MINOR(__entry->dev),
1380 __entry->agno,
1381 __entry->agbno,
1382 __entry->minlen,
1383 __entry->maxlen,
1384 __entry->mod,
1385 __entry->prod,
1386 __entry->minleft,
1387 __entry->total,
1388 __entry->alignment,
1389 __entry->minalignslop,
1390 __entry->len,
1391 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1392 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1393 __entry->wasdel,
1394 __entry->wasfromfl,
1395 __entry->isfl,
1396 __entry->userdata,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001397 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001398)
1399
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001400#define DEFINE_ALLOC_EVENT(name) \
1401DEFINE_EVENT(xfs_alloc_class, name, \
1402 TP_PROTO(struct xfs_alloc_arg *args), \
1403 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001404DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001405DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001406DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1407DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1408DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1409DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1410DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1411DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001412DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1413DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001414DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1415DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1416DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1417DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1418DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001419DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001420DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1421DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1422DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1423DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1424DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1425DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1426DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1427DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1428DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1429
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001430DECLARE_EVENT_CLASS(xfs_dir2_class,
1431 TP_PROTO(struct xfs_da_args *args),
1432 TP_ARGS(args),
1433 TP_STRUCT__entry(
1434 __field(dev_t, dev)
1435 __field(xfs_ino_t, ino)
1436 __dynamic_array(char, name, args->namelen)
1437 __field(int, namelen)
1438 __field(xfs_dahash_t, hashval)
1439 __field(xfs_ino_t, inumber)
1440 __field(int, op_flags)
1441 ),
1442 TP_fast_assign(
1443 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1444 __entry->ino = args->dp->i_ino;
1445 if (args->namelen)
1446 memcpy(__get_str(name), args->name, args->namelen);
1447 __entry->namelen = args->namelen;
1448 __entry->hashval = args->hashval;
1449 __entry->inumber = args->inumber;
1450 __entry->op_flags = args->op_flags;
1451 ),
1452 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1453 "inumber 0x%llx op_flags %s",
1454 MAJOR(__entry->dev), MINOR(__entry->dev),
1455 __entry->ino,
1456 __entry->namelen,
1457 __entry->namelen ? __get_str(name) : NULL,
1458 __entry->namelen,
1459 __entry->hashval,
1460 __entry->inumber,
1461 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001462)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001463
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001464#define DEFINE_DIR2_EVENT(name) \
1465DEFINE_EVENT(xfs_dir2_class, name, \
1466 TP_PROTO(struct xfs_da_args *args), \
1467 TP_ARGS(args))
1468DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1469DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1470DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1471DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1472DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1473DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1474DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1475DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1476DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1477DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1478DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1479DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1480DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1481DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1482DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1483DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1484DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1485DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1486DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1487DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1488DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1489DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1490DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1491DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1492DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1493
1494DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1495 TP_PROTO(struct xfs_da_args *args, int idx),
1496 TP_ARGS(args, idx),
1497 TP_STRUCT__entry(
1498 __field(dev_t, dev)
1499 __field(xfs_ino_t, ino)
1500 __field(int, op_flags)
1501 __field(int, idx)
1502 ),
1503 TP_fast_assign(
1504 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1505 __entry->ino = args->dp->i_ino;
1506 __entry->op_flags = args->op_flags;
1507 __entry->idx = idx;
1508 ),
1509 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1510 MAJOR(__entry->dev), MINOR(__entry->dev),
1511 __entry->ino,
1512 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1513 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001514)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001515
1516#define DEFINE_DIR2_SPACE_EVENT(name) \
1517DEFINE_EVENT(xfs_dir2_space_class, name, \
1518 TP_PROTO(struct xfs_da_args *args, int idx), \
1519 TP_ARGS(args, idx))
1520DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1521DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1522DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1523DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001524
1525TRACE_EVENT(xfs_dir2_leafn_moveents,
1526 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1527 TP_ARGS(args, src_idx, dst_idx, count),
1528 TP_STRUCT__entry(
1529 __field(dev_t, dev)
1530 __field(xfs_ino_t, ino)
1531 __field(int, op_flags)
1532 __field(int, src_idx)
1533 __field(int, dst_idx)
1534 __field(int, count)
1535 ),
1536 TP_fast_assign(
1537 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1538 __entry->ino = args->dp->i_ino;
1539 __entry->op_flags = args->op_flags;
1540 __entry->src_idx = src_idx;
1541 __entry->dst_idx = dst_idx;
1542 __entry->count = count;
1543 ),
1544 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1545 "src_idx %d dst_idx %d count %d",
1546 MAJOR(__entry->dev), MINOR(__entry->dev),
1547 __entry->ino,
1548 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1549 __entry->src_idx,
1550 __entry->dst_idx,
1551 __entry->count)
1552);
1553
Dave Chinner3a85cd92010-01-14 01:33:55 +00001554#define XFS_SWAPEXT_INODES \
1555 { 0, "target" }, \
1556 { 1, "temp" }
1557
1558#define XFS_INODE_FORMAT_STR \
1559 { 0, "invalid" }, \
1560 { 1, "local" }, \
1561 { 2, "extent" }, \
1562 { 3, "btree" }
1563
1564DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1565 TP_PROTO(struct xfs_inode *ip, int which),
1566 TP_ARGS(ip, which),
1567 TP_STRUCT__entry(
1568 __field(dev_t, dev)
1569 __field(int, which)
1570 __field(xfs_ino_t, ino)
1571 __field(int, format)
1572 __field(int, nex)
1573 __field(int, max_nex)
1574 __field(int, broot_size)
1575 __field(int, fork_off)
1576 ),
1577 TP_fast_assign(
1578 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1579 __entry->which = which;
1580 __entry->ino = ip->i_ino;
1581 __entry->format = ip->i_d.di_format;
1582 __entry->nex = ip->i_d.di_nextents;
1583 __entry->max_nex = ip->i_df.if_ext_max;
1584 __entry->broot_size = ip->i_df.if_broot_bytes;
1585 __entry->fork_off = XFS_IFORK_BOFF(ip);
1586 ),
1587 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1588 "Max in-fork extents %d, broot size %d, fork offset %d",
1589 MAJOR(__entry->dev), MINOR(__entry->dev),
1590 __entry->ino,
1591 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1592 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1593 __entry->nex,
1594 __entry->max_nex,
1595 __entry->broot_size,
1596 __entry->fork_off)
1597)
1598
1599#define DEFINE_SWAPEXT_EVENT(name) \
1600DEFINE_EVENT(xfs_swap_extent_class, name, \
1601 TP_PROTO(struct xfs_inode *ip, int which), \
1602 TP_ARGS(ip, which))
1603
1604DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1605DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1606
Dave Chinner9abbc532010-04-13 15:06:46 +10001607DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
1608 TP_PROTO(struct log *log, struct xlog_recover *trans,
1609 struct xlog_recover_item *item, int pass),
1610 TP_ARGS(log, trans, item, pass),
1611 TP_STRUCT__entry(
1612 __field(dev_t, dev)
1613 __field(unsigned long, item)
1614 __field(xlog_tid_t, tid)
1615 __field(int, type)
1616 __field(int, pass)
1617 __field(int, count)
1618 __field(int, total)
1619 ),
1620 TP_fast_assign(
1621 __entry->dev = log->l_mp->m_super->s_dev;
1622 __entry->item = (unsigned long)item;
1623 __entry->tid = trans->r_log_tid;
1624 __entry->type = ITEM_TYPE(item);
1625 __entry->pass = pass;
1626 __entry->count = item->ri_cnt;
1627 __entry->total = item->ri_total;
1628 ),
1629 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
1630 "item region count/total %d/%d",
1631 MAJOR(__entry->dev), MINOR(__entry->dev),
1632 __entry->tid,
1633 __entry->pass,
1634 (void *)__entry->item,
1635 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1636 __entry->count,
1637 __entry->total)
1638)
1639
1640#define DEFINE_LOG_RECOVER_ITEM(name) \
1641DEFINE_EVENT(xfs_log_recover_item_class, name, \
1642 TP_PROTO(struct log *log, struct xlog_recover *trans, \
1643 struct xlog_recover_item *item, int pass), \
1644 TP_ARGS(log, trans, item, pass))
1645
1646DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
1647DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
1648DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
1649DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
1650DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
1651
1652DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
1653 TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f),
1654 TP_ARGS(log, buf_f),
1655 TP_STRUCT__entry(
1656 __field(dev_t, dev)
1657 __field(__int64_t, blkno)
1658 __field(unsigned short, len)
1659 __field(unsigned short, flags)
1660 __field(unsigned short, size)
1661 __field(unsigned int, map_size)
1662 ),
1663 TP_fast_assign(
1664 __entry->dev = log->l_mp->m_super->s_dev;
1665 __entry->blkno = buf_f->blf_blkno;
1666 __entry->len = buf_f->blf_len;
1667 __entry->flags = buf_f->blf_flags;
1668 __entry->size = buf_f->blf_size;
1669 __entry->map_size = buf_f->blf_map_size;
1670 ),
1671 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
1672 "map_size %d",
1673 MAJOR(__entry->dev), MINOR(__entry->dev),
1674 __entry->blkno,
1675 __entry->len,
1676 __entry->flags,
1677 __entry->size,
1678 __entry->map_size)
1679)
1680
1681#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
1682DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
1683 TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f), \
1684 TP_ARGS(log, buf_f))
1685
1686DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
1687DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
1688DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
1689DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
1690DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
1691DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
1692DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
1693DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
1694
1695DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
1696 TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f),
1697 TP_ARGS(log, in_f),
1698 TP_STRUCT__entry(
1699 __field(dev_t, dev)
1700 __field(xfs_ino_t, ino)
1701 __field(unsigned short, size)
1702 __field(int, fields)
1703 __field(unsigned short, asize)
1704 __field(unsigned short, dsize)
1705 __field(__int64_t, blkno)
1706 __field(int, len)
1707 __field(int, boffset)
1708 ),
1709 TP_fast_assign(
1710 __entry->dev = log->l_mp->m_super->s_dev;
1711 __entry->ino = in_f->ilf_ino;
1712 __entry->size = in_f->ilf_size;
1713 __entry->fields = in_f->ilf_fields;
1714 __entry->asize = in_f->ilf_asize;
1715 __entry->dsize = in_f->ilf_dsize;
1716 __entry->blkno = in_f->ilf_blkno;
1717 __entry->len = in_f->ilf_len;
1718 __entry->boffset = in_f->ilf_boffset;
1719 ),
1720 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
1721 "dsize %d, blkno 0x%llx, len %d, boffset %d",
1722 MAJOR(__entry->dev), MINOR(__entry->dev),
1723 __entry->ino,
1724 __entry->size,
1725 __entry->fields,
1726 __entry->asize,
1727 __entry->dsize,
1728 __entry->blkno,
1729 __entry->len,
1730 __entry->boffset)
1731)
1732#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
1733DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
1734 TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f), \
1735 TP_ARGS(log, in_f))
1736
1737DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
1738DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
1739DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
1740
Christoph Hellwiga46db602011-01-07 13:02:04 +00001741DECLARE_EVENT_CLASS(xfs_discard_class,
1742 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1743 xfs_agblock_t agbno, xfs_extlen_t len),
1744 TP_ARGS(mp, agno, agbno, len),
1745 TP_STRUCT__entry(
1746 __field(dev_t, dev)
1747 __field(xfs_agnumber_t, agno)
1748 __field(xfs_agblock_t, agbno)
1749 __field(xfs_extlen_t, len)
1750 ),
1751 TP_fast_assign(
1752 __entry->dev = mp->m_super->s_dev;
1753 __entry->agno = agno;
1754 __entry->agbno = agbno;
1755 __entry->len = len;
1756 ),
1757 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
1758 MAJOR(__entry->dev), MINOR(__entry->dev),
1759 __entry->agno,
1760 __entry->agbno,
1761 __entry->len)
1762)
1763
1764#define DEFINE_DISCARD_EVENT(name) \
1765DEFINE_EVENT(xfs_discard_class, name, \
1766 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1767 xfs_agblock_t agbno, xfs_extlen_t len), \
1768 TP_ARGS(mp, agno, agbno, len))
1769DEFINE_DISCARD_EVENT(xfs_discard_extent);
1770DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
1771DEFINE_DISCARD_EVENT(xfs_discard_exclude);
1772DEFINE_DISCARD_EVENT(xfs_discard_busy);
1773
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001774#endif /* _TRACE_XFS_H */
1775
1776#undef TRACE_INCLUDE_PATH
1777#define TRACE_INCLUDE_PATH .
1778#define TRACE_INCLUDE_FILE xfs_trace
1779#include <trace/define_trace.h>