blob: a4ae41c179a8a66a5772914a61642b8a53be1c4b [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;
Mark Tinguelyad223e62012-06-14 09:22:15 -050034struct xlog;
Dave Chinner750b9c92013-11-01 15:27:18 +110035struct xlog_ticket;
Dave Chinner9abbc532010-04-13 15:06:46 +100036struct xlog_recover;
37struct xlog_recover_item;
38struct xfs_buf_log_format;
39struct xfs_inode_log_format;
Alex Elder1ed845d2012-08-01 09:56:49 -050040struct xfs_bmbt_irec;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000041
Christoph Hellwigea9a4882009-12-21 14:03:03 +000042DECLARE_EVENT_CLASS(xfs_attr_list_class,
43 TP_PROTO(struct xfs_attr_list_context *ctx),
44 TP_ARGS(ctx),
45 TP_STRUCT__entry(
46 __field(dev_t, dev)
47 __field(xfs_ino_t, ino)
48 __field(u32, hashval)
49 __field(u32, blkno)
50 __field(u32, offset)
51 __field(void *, alist)
52 __field(int, bufsize)
53 __field(int, count)
54 __field(int, firstu)
55 __field(int, dupcnt)
56 __field(int, flags)
57 ),
58 TP_fast_assign(
59 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
60 __entry->ino = ctx->dp->i_ino;
61 __entry->hashval = ctx->cursor->hashval;
62 __entry->blkno = ctx->cursor->blkno;
63 __entry->offset = ctx->cursor->offset;
64 __entry->alist = ctx->alist;
65 __entry->bufsize = ctx->bufsize;
66 __entry->count = ctx->count;
67 __entry->firstu = ctx->firstu;
68 __entry->flags = ctx->flags;
69 ),
70 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
71 "alist 0x%p size %u count %u firstu %u flags %d %s",
72 MAJOR(__entry->dev), MINOR(__entry->dev),
73 __entry->ino,
74 __entry->hashval,
75 __entry->blkno,
76 __entry->offset,
77 __entry->dupcnt,
78 __entry->alist,
79 __entry->bufsize,
80 __entry->count,
81 __entry->firstu,
82 __entry->flags,
83 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
84 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000085)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000086
87#define DEFINE_ATTR_LIST_EVENT(name) \
88DEFINE_EVENT(xfs_attr_list_class, name, \
89 TP_PROTO(struct xfs_attr_list_context *ctx), \
90 TP_ARGS(ctx))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000091DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
92DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
93DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
94DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
95DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
96DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
97DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
98DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
Dave Chinneree732592012-11-12 22:53:53 +110099DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
100DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000101
Li Zefanf8adb4d2010-05-24 08:25:57 +0000102DECLARE_EVENT_CLASS(xfs_perag_class,
103 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
104 unsigned long caller_ip),
105 TP_ARGS(mp, agno, refcount, caller_ip),
106 TP_STRUCT__entry(
107 __field(dev_t, dev)
108 __field(xfs_agnumber_t, agno)
109 __field(int, refcount)
110 __field(unsigned long, caller_ip)
111 ),
112 TP_fast_assign(
113 __entry->dev = mp->m_super->s_dev;
114 __entry->agno = agno;
115 __entry->refcount = refcount;
116 __entry->caller_ip = caller_ip;
117 ),
118 TP_printk("dev %d:%d agno %u refcount %d caller %pf",
119 MAJOR(__entry->dev), MINOR(__entry->dev),
120 __entry->agno,
121 __entry->refcount,
122 (char *)__entry->caller_ip)
123);
124
125#define DEFINE_PERAG_REF_EVENT(name) \
126DEFINE_EVENT(xfs_perag_class, name, \
127 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
128 unsigned long caller_ip), \
129 TP_ARGS(mp, agno, refcount, caller_ip))
130DEFINE_PERAG_REF_EVENT(xfs_perag_get);
Dave Chinner65d0f202010-09-24 18:40:15 +1000131DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000132DEFINE_PERAG_REF_EVENT(xfs_perag_put);
Dave Chinner16fd5362010-07-20 09:43:39 +1000133DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
134DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
Brian Foster27b52862012-11-06 09:50:38 -0500135DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
136DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000137
Dave Chinnerd1230312013-11-01 15:27:19 +1100138DECLARE_EVENT_CLASS(xfs_ag_class,
139 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
140 TP_ARGS(mp, agno),
141 TP_STRUCT__entry(
142 __field(dev_t, dev)
143 __field(xfs_agnumber_t, agno)
144 ),
145 TP_fast_assign(
146 __entry->dev = mp->m_super->s_dev;
147 __entry->agno = agno;
148 ),
149 TP_printk("dev %d:%d agno %u",
150 MAJOR(__entry->dev), MINOR(__entry->dev),
151 __entry->agno)
152);
153#define DEFINE_AG_EVENT(name) \
154DEFINE_EVENT(xfs_ag_class, name, \
155 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
156 TP_ARGS(mp, agno))
157
158DEFINE_AG_EVENT(xfs_read_agf);
159DEFINE_AG_EVENT(xfs_alloc_read_agf);
160DEFINE_AG_EVENT(xfs_read_agi);
161DEFINE_AG_EVENT(xfs_ialloc_read_agi);
162
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000163TRACE_EVENT(xfs_attr_list_node_descend,
164 TP_PROTO(struct xfs_attr_list_context *ctx,
165 struct xfs_da_node_entry *btree),
166 TP_ARGS(ctx, btree),
167 TP_STRUCT__entry(
168 __field(dev_t, dev)
169 __field(xfs_ino_t, ino)
170 __field(u32, hashval)
171 __field(u32, blkno)
172 __field(u32, offset)
173 __field(void *, alist)
174 __field(int, bufsize)
175 __field(int, count)
176 __field(int, firstu)
177 __field(int, dupcnt)
178 __field(int, flags)
179 __field(u32, bt_hashval)
180 __field(u32, bt_before)
181 ),
182 TP_fast_assign(
183 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
184 __entry->ino = ctx->dp->i_ino;
185 __entry->hashval = ctx->cursor->hashval;
186 __entry->blkno = ctx->cursor->blkno;
187 __entry->offset = ctx->cursor->offset;
188 __entry->alist = ctx->alist;
189 __entry->bufsize = ctx->bufsize;
190 __entry->count = ctx->count;
191 __entry->firstu = ctx->firstu;
192 __entry->flags = ctx->flags;
193 __entry->bt_hashval = be32_to_cpu(btree->hashval);
194 __entry->bt_before = be32_to_cpu(btree->before);
195 ),
196 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
197 "alist 0x%p size %u count %u firstu %u flags %d %s "
198 "node hashval %u, node before %u",
199 MAJOR(__entry->dev), MINOR(__entry->dev),
200 __entry->ino,
201 __entry->hashval,
202 __entry->blkno,
203 __entry->offset,
204 __entry->dupcnt,
205 __entry->alist,
206 __entry->bufsize,
207 __entry->count,
208 __entry->firstu,
209 __entry->flags,
210 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
211 __entry->bt_hashval,
212 __entry->bt_before)
213);
214
215TRACE_EVENT(xfs_iext_insert,
216 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
217 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
218 TP_ARGS(ip, idx, r, state, caller_ip),
219 TP_STRUCT__entry(
220 __field(dev_t, dev)
221 __field(xfs_ino_t, ino)
222 __field(xfs_extnum_t, idx)
223 __field(xfs_fileoff_t, startoff)
224 __field(xfs_fsblock_t, startblock)
225 __field(xfs_filblks_t, blockcount)
226 __field(xfs_exntst_t, state)
227 __field(int, bmap_state)
228 __field(unsigned long, caller_ip)
229 ),
230 TP_fast_assign(
231 __entry->dev = VFS_I(ip)->i_sb->s_dev;
232 __entry->ino = ip->i_ino;
233 __entry->idx = idx;
234 __entry->startoff = r->br_startoff;
235 __entry->startblock = r->br_startblock;
236 __entry->blockcount = r->br_blockcount;
237 __entry->state = r->br_state;
238 __entry->bmap_state = state;
239 __entry->caller_ip = caller_ip;
240 ),
241 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000242 "offset %lld block %lld count %lld flag %d caller %pf",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000243 MAJOR(__entry->dev), MINOR(__entry->dev),
244 __entry->ino,
245 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
246 (long)__entry->idx,
247 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000248 (__int64_t)__entry->startblock,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000249 __entry->blockcount,
250 __entry->state,
251 (char *)__entry->caller_ip)
252);
253
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000254DECLARE_EVENT_CLASS(xfs_bmap_class,
255 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
256 unsigned long caller_ip),
257 TP_ARGS(ip, idx, state, caller_ip),
258 TP_STRUCT__entry(
259 __field(dev_t, dev)
260 __field(xfs_ino_t, ino)
261 __field(xfs_extnum_t, idx)
262 __field(xfs_fileoff_t, startoff)
263 __field(xfs_fsblock_t, startblock)
264 __field(xfs_filblks_t, blockcount)
265 __field(xfs_exntst_t, state)
266 __field(int, bmap_state)
267 __field(unsigned long, caller_ip)
268 ),
269 TP_fast_assign(
270 struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ?
271 ip->i_afp : &ip->i_df;
272 struct xfs_bmbt_irec r;
273
274 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
275 __entry->dev = VFS_I(ip)->i_sb->s_dev;
276 __entry->ino = ip->i_ino;
277 __entry->idx = idx;
278 __entry->startoff = r.br_startoff;
279 __entry->startblock = r.br_startblock;
280 __entry->blockcount = r.br_blockcount;
281 __entry->state = r.br_state;
282 __entry->bmap_state = state;
283 __entry->caller_ip = caller_ip;
284 ),
285 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000286 "offset %lld block %lld count %lld flag %d caller %pf",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000287 MAJOR(__entry->dev), MINOR(__entry->dev),
288 __entry->ino,
289 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
290 (long)__entry->idx,
291 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000292 (__int64_t)__entry->startblock,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000293 __entry->blockcount,
294 __entry->state,
295 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000296)
297
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000298#define DEFINE_BMAP_EVENT(name) \
299DEFINE_EVENT(xfs_bmap_class, name, \
300 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
301 unsigned long caller_ip), \
302 TP_ARGS(ip, idx, state, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000303DEFINE_BMAP_EVENT(xfs_iext_remove);
304DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
305DEFINE_BMAP_EVENT(xfs_bmap_post_update);
306DEFINE_BMAP_EVENT(xfs_extlist);
307
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000308DECLARE_EVENT_CLASS(xfs_buf_class,
309 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
310 TP_ARGS(bp, caller_ip),
311 TP_STRUCT__entry(
312 __field(dev_t, dev)
313 __field(xfs_daddr_t, bno)
Dave Chinner4e94b712012-04-23 15:58:51 +1000314 __field(int, nblks)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000315 __field(int, hold)
316 __field(int, pincount)
317 __field(unsigned, lockval)
318 __field(unsigned, flags)
319 __field(unsigned long, caller_ip)
320 ),
321 TP_fast_assign(
322 __entry->dev = bp->b_target->bt_dev;
323 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000324 __entry->nblks = bp->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000325 __entry->hold = atomic_read(&bp->b_hold);
326 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200327 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000328 __entry->flags = bp->b_flags;
329 __entry->caller_ip = caller_ip;
330 ),
Dave Chinner4e94b712012-04-23 15:58:51 +1000331 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000332 "lock %d flags %s caller %pf",
333 MAJOR(__entry->dev), MINOR(__entry->dev),
334 (unsigned long long)__entry->bno,
Dave Chinner4e94b712012-04-23 15:58:51 +1000335 __entry->nblks,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000336 __entry->hold,
337 __entry->pincount,
338 __entry->lockval,
339 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
340 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000341)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000342
343#define DEFINE_BUF_EVENT(name) \
344DEFINE_EVENT(xfs_buf_class, name, \
345 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
346 TP_ARGS(bp, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000347DEFINE_BUF_EVENT(xfs_buf_init);
348DEFINE_BUF_EVENT(xfs_buf_free);
349DEFINE_BUF_EVENT(xfs_buf_hold);
350DEFINE_BUF_EVENT(xfs_buf_rele);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000351DEFINE_BUF_EVENT(xfs_buf_iodone);
352DEFINE_BUF_EVENT(xfs_buf_iorequest);
353DEFINE_BUF_EVENT(xfs_buf_bawrite);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000354DEFINE_BUF_EVENT(xfs_buf_lock);
355DEFINE_BUF_EVENT(xfs_buf_lock_done);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200356DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000357DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000358DEFINE_BUF_EVENT(xfs_buf_iowait);
359DEFINE_BUF_EVENT(xfs_buf_iowait_done);
360DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000361DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000362DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Dave Chinner686865f2010-09-24 20:07:47 +1000363DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000364DEFINE_BUF_EVENT(xfs_bdstrat_shut);
365DEFINE_BUF_EVENT(xfs_buf_item_relse);
366DEFINE_BUF_EVENT(xfs_buf_item_iodone);
367DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
368DEFINE_BUF_EVENT(xfs_buf_error_relse);
Dave Chinner9f878322013-01-21 23:53:55 +1100369DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000370DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
371DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
372
373/* not really buffer traces, but the buf provides useful information */
374DEFINE_BUF_EVENT(xfs_btree_corrupt);
375DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
376DEFINE_BUF_EVENT(xfs_reset_dqcounts);
377DEFINE_BUF_EVENT(xfs_inode_item_push);
378
379/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000380DECLARE_EVENT_CLASS(xfs_buf_flags_class,
381 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
382 TP_ARGS(bp, flags, caller_ip),
383 TP_STRUCT__entry(
384 __field(dev_t, dev)
385 __field(xfs_daddr_t, bno)
386 __field(size_t, buffer_length)
387 __field(int, hold)
388 __field(int, pincount)
389 __field(unsigned, lockval)
390 __field(unsigned, flags)
391 __field(unsigned long, caller_ip)
392 ),
393 TP_fast_assign(
394 __entry->dev = bp->b_target->bt_dev;
395 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000396 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000397 __entry->flags = flags;
398 __entry->hold = atomic_read(&bp->b_hold);
399 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200400 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000401 __entry->caller_ip = caller_ip;
402 ),
403 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
404 "lock %d flags %s caller %pf",
405 MAJOR(__entry->dev), MINOR(__entry->dev),
406 (unsigned long long)__entry->bno,
407 __entry->buffer_length,
408 __entry->hold,
409 __entry->pincount,
410 __entry->lockval,
411 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
412 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000413)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000414
415#define DEFINE_BUF_FLAGS_EVENT(name) \
416DEFINE_EVENT(xfs_buf_flags_class, name, \
417 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
418 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000419DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
420DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
421DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
422
423TRACE_EVENT(xfs_buf_ioerror,
424 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
425 TP_ARGS(bp, error, caller_ip),
426 TP_STRUCT__entry(
427 __field(dev_t, dev)
428 __field(xfs_daddr_t, bno)
429 __field(size_t, buffer_length)
430 __field(unsigned, flags)
431 __field(int, hold)
432 __field(int, pincount)
433 __field(unsigned, lockval)
434 __field(int, error)
435 __field(unsigned long, caller_ip)
436 ),
437 TP_fast_assign(
438 __entry->dev = bp->b_target->bt_dev;
439 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000440 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000441 __entry->hold = atomic_read(&bp->b_hold);
442 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200443 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000444 __entry->error = error;
445 __entry->flags = bp->b_flags;
446 __entry->caller_ip = caller_ip;
447 ),
448 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
449 "lock %d error %d flags %s caller %pf",
450 MAJOR(__entry->dev), MINOR(__entry->dev),
451 (unsigned long long)__entry->bno,
452 __entry->buffer_length,
453 __entry->hold,
454 __entry->pincount,
455 __entry->lockval,
456 __entry->error,
457 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
458 (void *)__entry->caller_ip)
459);
460
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000461DECLARE_EVENT_CLASS(xfs_buf_item_class,
462 TP_PROTO(struct xfs_buf_log_item *bip),
463 TP_ARGS(bip),
464 TP_STRUCT__entry(
465 __field(dev_t, dev)
466 __field(xfs_daddr_t, buf_bno)
467 __field(size_t, buf_len)
468 __field(int, buf_hold)
469 __field(int, buf_pincount)
470 __field(int, buf_lockval)
471 __field(unsigned, buf_flags)
472 __field(unsigned, bli_recur)
473 __field(int, bli_refcount)
474 __field(unsigned, bli_flags)
475 __field(void *, li_desc)
476 __field(unsigned, li_flags)
477 ),
478 TP_fast_assign(
479 __entry->dev = bip->bli_buf->b_target->bt_dev;
480 __entry->bli_flags = bip->bli_flags;
481 __entry->bli_recur = bip->bli_recur;
482 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
483 __entry->buf_bno = bip->bli_buf->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000484 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000485 __entry->buf_flags = bip->bli_buf->b_flags;
486 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
487 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200488 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000489 __entry->li_desc = bip->bli_item.li_desc;
490 __entry->li_flags = bip->bli_item.li_flags;
491 ),
492 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
493 "lock %d flags %s recur %d refcount %d bliflags %s "
494 "lidesc 0x%p liflags %s",
495 MAJOR(__entry->dev), MINOR(__entry->dev),
496 (unsigned long long)__entry->buf_bno,
497 __entry->buf_len,
498 __entry->buf_hold,
499 __entry->buf_pincount,
500 __entry->buf_lockval,
501 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
502 __entry->bli_recur,
503 __entry->bli_refcount,
504 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
505 __entry->li_desc,
506 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000507)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000508
509#define DEFINE_BUF_ITEM_EVENT(name) \
510DEFINE_EVENT(xfs_buf_item_class, name, \
511 TP_PROTO(struct xfs_buf_log_item *bip), \
512 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000513DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000514DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000515DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
516DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000517DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000518DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000519DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000520DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
521DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
522DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000523DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
524DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
525DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
526DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
527DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
528DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
529DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
530DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
531DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
532DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
533DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
534DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
535DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
536DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
537DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
538DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000539DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000540
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000541DECLARE_EVENT_CLASS(xfs_lock_class,
542 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
543 unsigned long caller_ip),
544 TP_ARGS(ip, lock_flags, caller_ip),
545 TP_STRUCT__entry(
546 __field(dev_t, dev)
547 __field(xfs_ino_t, ino)
548 __field(int, lock_flags)
549 __field(unsigned long, caller_ip)
550 ),
551 TP_fast_assign(
552 __entry->dev = VFS_I(ip)->i_sb->s_dev;
553 __entry->ino = ip->i_ino;
554 __entry->lock_flags = lock_flags;
555 __entry->caller_ip = caller_ip;
556 ),
557 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf",
558 MAJOR(__entry->dev), MINOR(__entry->dev),
559 __entry->ino,
560 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
561 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000562)
563
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000564#define DEFINE_LOCK_EVENT(name) \
565DEFINE_EVENT(xfs_lock_class, name, \
566 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
567 unsigned long caller_ip), \
568 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000569DEFINE_LOCK_EVENT(xfs_ilock);
570DEFINE_LOCK_EVENT(xfs_ilock_nowait);
571DEFINE_LOCK_EVENT(xfs_ilock_demote);
572DEFINE_LOCK_EVENT(xfs_iunlock);
573
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000574DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000575 TP_PROTO(struct xfs_inode *ip),
576 TP_ARGS(ip),
577 TP_STRUCT__entry(
578 __field(dev_t, dev)
579 __field(xfs_ino_t, ino)
580 ),
581 TP_fast_assign(
582 __entry->dev = VFS_I(ip)->i_sb->s_dev;
583 __entry->ino = ip->i_ino;
584 ),
585 TP_printk("dev %d:%d ino 0x%llx",
586 MAJOR(__entry->dev), MINOR(__entry->dev),
587 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000588)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000589
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000590#define DEFINE_INODE_EVENT(name) \
591DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000592 TP_PROTO(struct xfs_inode *ip), \
593 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000594DEFINE_INODE_EVENT(xfs_iget_skip);
595DEFINE_INODE_EVENT(xfs_iget_reclaim);
596DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
597DEFINE_INODE_EVENT(xfs_iget_hit);
598DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000599
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000600DEFINE_INODE_EVENT(xfs_getattr);
601DEFINE_INODE_EVENT(xfs_setattr);
602DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500603DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000604DEFINE_INODE_EVENT(xfs_alloc_file_space);
605DEFINE_INODE_EVENT(xfs_free_file_space);
Namjae Jeone1d8fb82014-02-24 10:58:19 +1100606DEFINE_INODE_EVENT(xfs_collapse_file_space);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000607DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000608#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200609DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000610#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000611DEFINE_INODE_EVENT(xfs_vm_bmap);
612DEFINE_INODE_EVENT(xfs_file_ioctl);
613DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
614DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000615DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000616DEFINE_INODE_EVENT(xfs_file_fsync);
617DEFINE_INODE_EVENT(xfs_destroy_inode);
Al Virob57922d2010-06-07 14:34:48 -0400618DEFINE_INODE_EVENT(xfs_evict_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400619DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000620
621DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
622DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
623
Brian Foster27b52862012-11-06 09:50:38 -0500624DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
625DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500626DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Brian Foster27b52862012-11-06 09:50:38 -0500627
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000628DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000629 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
630 TP_ARGS(ip, caller_ip),
631 TP_STRUCT__entry(
632 __field(dev_t, dev)
633 __field(xfs_ino_t, ino)
634 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100635 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000636 __field(unsigned long, caller_ip)
637 ),
638 TP_fast_assign(
639 __entry->dev = VFS_I(ip)->i_sb->s_dev;
640 __entry->ino = ip->i_ino;
641 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100642 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000643 __entry->caller_ip = caller_ip;
644 ),
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100645 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pf",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000646 MAJOR(__entry->dev), MINOR(__entry->dev),
647 __entry->ino,
648 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100649 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000650 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000651)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000652
Brian Foster19cb7e32013-03-18 10:51:48 -0400653TRACE_EVENT(xfs_iomap_prealloc_size,
654 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
655 unsigned int writeio_blocks),
656 TP_ARGS(ip, blocks, shift, writeio_blocks),
657 TP_STRUCT__entry(
658 __field(dev_t, dev)
659 __field(xfs_ino_t, ino)
660 __field(xfs_fsblock_t, blocks)
661 __field(int, shift)
662 __field(unsigned int, writeio_blocks)
663 ),
664 TP_fast_assign(
665 __entry->dev = VFS_I(ip)->i_sb->s_dev;
666 __entry->ino = ip->i_ino;
667 __entry->blocks = blocks;
668 __entry->shift = shift;
669 __entry->writeio_blocks = writeio_blocks;
670 ),
671 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
672 "m_writeio_blocks %u",
673 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
674 __entry->blocks, __entry->shift, __entry->writeio_blocks)
675)
676
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000677#define DEFINE_IREF_EVENT(name) \
678DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000679 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
680 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000681DEFINE_IREF_EVENT(xfs_ihold);
682DEFINE_IREF_EVENT(xfs_irele);
683DEFINE_IREF_EVENT(xfs_inode_pin);
684DEFINE_IREF_EVENT(xfs_inode_unpin);
685DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100686
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000687DECLARE_EVENT_CLASS(xfs_namespace_class,
688 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
689 TP_ARGS(dp, name),
690 TP_STRUCT__entry(
691 __field(dev_t, dev)
692 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000693 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000694 __dynamic_array(char, name, name->len)
695 ),
696 TP_fast_assign(
697 __entry->dev = VFS_I(dp)->i_sb->s_dev;
698 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000699 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000700 memcpy(__get_str(name), name->name, name->len);
701 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000702 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000703 MAJOR(__entry->dev), MINOR(__entry->dev),
704 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000705 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000706 __get_str(name))
707)
708
709#define DEFINE_NAMESPACE_EVENT(name) \
710DEFINE_EVENT(xfs_namespace_class, name, \
711 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
712 TP_ARGS(dp, name))
713DEFINE_NAMESPACE_EVENT(xfs_remove);
714DEFINE_NAMESPACE_EVENT(xfs_link);
715DEFINE_NAMESPACE_EVENT(xfs_lookup);
716DEFINE_NAMESPACE_EVENT(xfs_create);
717DEFINE_NAMESPACE_EVENT(xfs_symlink);
718
719TRACE_EVENT(xfs_rename,
720 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
721 struct xfs_name *src_name, struct xfs_name *target_name),
722 TP_ARGS(src_dp, target_dp, src_name, target_name),
723 TP_STRUCT__entry(
724 __field(dev_t, dev)
725 __field(xfs_ino_t, src_dp_ino)
726 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000727 __field(int, src_namelen)
728 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000729 __dynamic_array(char, src_name, src_name->len)
730 __dynamic_array(char, target_name, target_name->len)
731 ),
732 TP_fast_assign(
733 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
734 __entry->src_dp_ino = src_dp->i_ino;
735 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000736 __entry->src_namelen = src_name->len;
737 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000738 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000739 memcpy(__get_str(target_name), target_name->name,
740 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000741 ),
742 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000743 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000744 MAJOR(__entry->dev), MINOR(__entry->dev),
745 __entry->src_dp_ino,
746 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000747 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000748 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000749 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000750 __get_str(target_name))
751)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000752
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000753DECLARE_EVENT_CLASS(xfs_dquot_class,
754 TP_PROTO(struct xfs_dquot *dqp),
755 TP_ARGS(dqp),
756 TP_STRUCT__entry(
757 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000758 __field(u32, id)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000759 __field(unsigned, flags)
760 __field(unsigned, nrefs)
761 __field(unsigned long long, res_bcount)
762 __field(unsigned long long, bcount)
763 __field(unsigned long long, icount)
764 __field(unsigned long long, blk_hardlimit)
765 __field(unsigned long long, blk_softlimit)
766 __field(unsigned long long, ino_hardlimit)
767 __field(unsigned long long, ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000768 ), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000769 TP_fast_assign(
770 __entry->dev = dqp->q_mount->m_super->s_dev;
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000771 __entry->id = be32_to_cpu(dqp->q_core.d_id);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000772 __entry->flags = dqp->dq_flags;
773 __entry->nrefs = dqp->q_nrefs;
774 __entry->res_bcount = dqp->q_res_bcount;
775 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
776 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
777 __entry->blk_hardlimit =
778 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
779 __entry->blk_softlimit =
780 be64_to_cpu(dqp->q_core.d_blk_softlimit);
781 __entry->ino_hardlimit =
782 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
783 __entry->ino_softlimit =
784 be64_to_cpu(dqp->q_core.d_ino_softlimit);
785 ),
786 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000787 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
788 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000789 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000790 __entry->id,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000791 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
792 __entry->nrefs,
793 __entry->res_bcount,
794 __entry->bcount,
795 __entry->blk_hardlimit,
796 __entry->blk_softlimit,
797 __entry->icount,
798 __entry->ino_hardlimit,
799 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000800)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000801
802#define DEFINE_DQUOT_EVENT(name) \
803DEFINE_EVENT(xfs_dquot_class, name, \
804 TP_PROTO(struct xfs_dquot *dqp), \
805 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000806DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000807DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
808DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b2012-02-01 13:57:20 +0000809DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
810DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000811DEFINE_DQUOT_EVENT(xfs_dqattach_found);
812DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000813DEFINE_DQUOT_EVENT(xfs_dqalloc);
814DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
815DEFINE_DQUOT_EVENT(xfs_dqread);
816DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000817DEFINE_DQUOT_EVENT(xfs_dqget_hit);
818DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000819DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
820DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000821DEFINE_DQUOT_EVENT(xfs_dqput);
822DEFINE_DQUOT_EVENT(xfs_dqput_wait);
823DEFINE_DQUOT_EVENT(xfs_dqput_free);
824DEFINE_DQUOT_EVENT(xfs_dqrele);
825DEFINE_DQUOT_EVENT(xfs_dqflush);
826DEFINE_DQUOT_EVENT(xfs_dqflush_force);
827DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000828
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000829DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -0500830 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000831 TP_ARGS(log, tic),
832 TP_STRUCT__entry(
833 __field(dev_t, dev)
834 __field(unsigned, trans_type)
835 __field(char, ocnt)
836 __field(char, cnt)
837 __field(int, curr_res)
838 __field(int, unit_res)
839 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +1100840 __field(int, reserveq)
841 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000842 __field(int, grant_reserve_cycle)
843 __field(int, grant_reserve_bytes)
844 __field(int, grant_write_cycle)
845 __field(int, grant_write_bytes)
846 __field(int, curr_cycle)
847 __field(int, curr_block)
848 __field(xfs_lsn_t, tail_lsn)
849 ),
850 TP_fast_assign(
851 __entry->dev = log->l_mp->m_super->s_dev;
852 __entry->trans_type = tic->t_trans_type;
853 __entry->ocnt = tic->t_ocnt;
854 __entry->cnt = tic->t_cnt;
855 __entry->curr_res = tic->t_curr_res;
856 __entry->unit_res = tic->t_unit_res;
857 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +0000858 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
859 __entry->writeq = list_empty(&log->l_write_head.waiters);
860 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100861 &__entry->grant_reserve_cycle,
862 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +0000863 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100864 &__entry->grant_write_cycle,
865 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000866 __entry->curr_cycle = log->l_curr_cycle;
867 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +1100868 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000869 ),
870 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +1100871 "t_unit_res %u t_flags %s reserveq %s "
872 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000873 "grant_reserve_bytes %d grant_write_cycle %d "
874 "grant_write_bytes %d curr_cycle %d curr_block %d "
875 "tail_cycle %d tail_block %d",
876 MAJOR(__entry->dev), MINOR(__entry->dev),
877 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
878 __entry->ocnt,
879 __entry->cnt,
880 __entry->curr_res,
881 __entry->unit_res,
882 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +1100883 __entry->reserveq ? "empty" : "active",
884 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000885 __entry->grant_reserve_cycle,
886 __entry->grant_reserve_bytes,
887 __entry->grant_write_cycle,
888 __entry->grant_write_bytes,
889 __entry->curr_cycle,
890 __entry->curr_block,
891 CYCLE_LSN(__entry->tail_lsn),
892 BLOCK_LSN(__entry->tail_lsn)
893 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000894)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000895
896#define DEFINE_LOGGRANT_EVENT(name) \
897DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -0500898 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000899 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000900DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
901DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000902DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +0000903DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
904DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +1100905DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +0000906DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
907DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
908DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
909DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000910DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
911DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
912DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
913DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
914DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
915DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
916
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000917DECLARE_EVENT_CLASS(xfs_log_item_class,
918 TP_PROTO(struct xfs_log_item *lip),
919 TP_ARGS(lip),
920 TP_STRUCT__entry(
921 __field(dev_t, dev)
922 __field(void *, lip)
923 __field(uint, type)
924 __field(uint, flags)
925 __field(xfs_lsn_t, lsn)
926 ),
927 TP_fast_assign(
928 __entry->dev = lip->li_mountp->m_super->s_dev;
929 __entry->lip = lip;
930 __entry->type = lip->li_type;
931 __entry->flags = lip->li_flags;
932 __entry->lsn = lip->li_lsn;
933 ),
934 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
935 MAJOR(__entry->dev), MINOR(__entry->dev),
936 __entry->lip,
937 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
938 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
939 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
940)
941
Dave Chinner14c26c62012-04-24 16:33:31 +1000942TRACE_EVENT(xfs_log_force,
943 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn),
944 TP_ARGS(mp, lsn),
945 TP_STRUCT__entry(
946 __field(dev_t, dev)
947 __field(xfs_lsn_t, lsn)
948 ),
949 TP_fast_assign(
950 __entry->dev = mp->m_super->s_dev;
951 __entry->lsn = lsn;
952 ),
953 TP_printk("dev %d:%d lsn 0x%llx",
954 MAJOR(__entry->dev), MINOR(__entry->dev),
955 __entry->lsn)
956)
957
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000958#define DEFINE_LOG_ITEM_EVENT(name) \
959DEFINE_EVENT(xfs_log_item_class, name, \
960 TP_PROTO(struct xfs_log_item *lip), \
961 TP_ARGS(lip))
962DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000963DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
964DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000965DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000966
Dave Chinner750b9c92013-11-01 15:27:18 +1100967DECLARE_EVENT_CLASS(xfs_ail_class,
968 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
969 TP_ARGS(lip, old_lsn, new_lsn),
970 TP_STRUCT__entry(
971 __field(dev_t, dev)
972 __field(void *, lip)
973 __field(uint, type)
974 __field(uint, flags)
975 __field(xfs_lsn_t, old_lsn)
976 __field(xfs_lsn_t, new_lsn)
977 ),
978 TP_fast_assign(
979 __entry->dev = lip->li_mountp->m_super->s_dev;
980 __entry->lip = lip;
981 __entry->type = lip->li_type;
982 __entry->flags = lip->li_flags;
983 __entry->old_lsn = old_lsn;
984 __entry->new_lsn = new_lsn;
985 ),
986 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
987 MAJOR(__entry->dev), MINOR(__entry->dev),
988 __entry->lip,
989 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
990 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
991 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
992 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
993)
994
995#define DEFINE_AIL_EVENT(name) \
996DEFINE_EVENT(xfs_ail_class, name, \
997 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
998 TP_ARGS(lip, old_lsn, new_lsn))
999DEFINE_AIL_EVENT(xfs_ail_insert);
1000DEFINE_AIL_EVENT(xfs_ail_move);
1001DEFINE_AIL_EVENT(xfs_ail_delete);
1002
1003TRACE_EVENT(xfs_log_assign_tail_lsn,
1004 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1005 TP_ARGS(log, new_lsn),
1006 TP_STRUCT__entry(
1007 __field(dev_t, dev)
1008 __field(xfs_lsn_t, new_lsn)
1009 __field(xfs_lsn_t, old_lsn)
1010 __field(xfs_lsn_t, last_sync_lsn)
1011 ),
1012 TP_fast_assign(
1013 __entry->dev = log->l_mp->m_super->s_dev;
1014 __entry->new_lsn = new_lsn;
1015 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1016 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1017 ),
1018 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1019 MAJOR(__entry->dev), MINOR(__entry->dev),
1020 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1021 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1022 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1023)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001024
Li Zefanf8adb4d2010-05-24 08:25:57 +00001025DECLARE_EVENT_CLASS(xfs_file_class,
1026 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags),
1027 TP_ARGS(ip, count, offset, flags),
1028 TP_STRUCT__entry(
1029 __field(dev_t, dev)
1030 __field(xfs_ino_t, ino)
1031 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001032 __field(loff_t, offset)
1033 __field(size_t, count)
1034 __field(int, flags)
1035 ),
1036 TP_fast_assign(
1037 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1038 __entry->ino = ip->i_ino;
1039 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001040 __entry->offset = offset;
1041 __entry->count = count;
1042 __entry->flags = flags;
1043 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001044 TP_printk("dev %d:%d ino 0x%llx size 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001045 "offset 0x%llx count 0x%zx ioflags %s",
1046 MAJOR(__entry->dev), MINOR(__entry->dev),
1047 __entry->ino,
1048 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001049 __entry->offset,
1050 __entry->count,
1051 __print_flags(__entry->flags, "|", XFS_IO_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001052)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001053
1054#define DEFINE_RW_EVENT(name) \
1055DEFINE_EVENT(xfs_file_class, name, \
1056 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
1057 TP_ARGS(ip, count, offset, flags))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001058DEFINE_RW_EVENT(xfs_file_read);
1059DEFINE_RW_EVENT(xfs_file_buffered_write);
1060DEFINE_RW_EVENT(xfs_file_direct_write);
1061DEFINE_RW_EVENT(xfs_file_splice_read);
1062DEFINE_RW_EVENT(xfs_file_splice_write);
1063
Li Zefanf8adb4d2010-05-24 08:25:57 +00001064DECLARE_EVENT_CLASS(xfs_page_class,
Lukas Czerner34097df2013-05-21 23:58:01 -04001065 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1066 unsigned int len),
1067 TP_ARGS(inode, page, off, len),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001068 TP_STRUCT__entry(
1069 __field(dev_t, dev)
1070 __field(xfs_ino_t, ino)
1071 __field(pgoff_t, pgoff)
1072 __field(loff_t, size)
1073 __field(unsigned long, offset)
Lukas Czerner34097df2013-05-21 23:58:01 -04001074 __field(unsigned int, length)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001075 __field(int, delalloc)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001076 __field(int, unwritten)
1077 ),
1078 TP_fast_assign(
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001079 int delalloc = -1, unwritten = -1;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001080
Li Zefanf8adb4d2010-05-24 08:25:57 +00001081 if (page_has_buffers(page))
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001082 xfs_count_page_state(page, &delalloc, &unwritten);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001083 __entry->dev = inode->i_sb->s_dev;
1084 __entry->ino = XFS_I(inode)->i_ino;
1085 __entry->pgoff = page_offset(page);
1086 __entry->size = i_size_read(inode);
1087 __entry->offset = off;
Lukas Czerner34097df2013-05-21 23:58:01 -04001088 __entry->length = len;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001089 __entry->delalloc = delalloc;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001090 __entry->unwritten = unwritten;
1091 ),
1092 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
Lukas Czerner34097df2013-05-21 23:58:01 -04001093 "length %x delalloc %d unwritten %d",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001094 MAJOR(__entry->dev), MINOR(__entry->dev),
1095 __entry->ino,
1096 __entry->pgoff,
1097 __entry->size,
1098 __entry->offset,
Lukas Czerner34097df2013-05-21 23:58:01 -04001099 __entry->length,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001100 __entry->delalloc,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001101 __entry->unwritten)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001102)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001103
1104#define DEFINE_PAGE_EVENT(name) \
1105DEFINE_EVENT(xfs_page_class, name, \
Lukas Czerner34097df2013-05-21 23:58:01 -04001106 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1107 unsigned int len), \
1108 TP_ARGS(inode, page, off, len))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001109DEFINE_PAGE_EVENT(xfs_writepage);
1110DEFINE_PAGE_EVENT(xfs_releasepage);
1111DEFINE_PAGE_EVENT(xfs_invalidatepage);
1112
Christoph Hellwiga206c812010-12-10 08:42:20 +00001113DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001114 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001115 int type, struct xfs_bmbt_irec *irec),
1116 TP_ARGS(ip, offset, count, type, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001117 TP_STRUCT__entry(
1118 __field(dev_t, dev)
1119 __field(xfs_ino_t, ino)
1120 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001121 __field(loff_t, offset)
1122 __field(size_t, count)
Christoph Hellwiga206c812010-12-10 08:42:20 +00001123 __field(int, type)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001124 __field(xfs_fileoff_t, startoff)
1125 __field(xfs_fsblock_t, startblock)
1126 __field(xfs_filblks_t, blockcount)
1127 ),
1128 TP_fast_assign(
1129 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1130 __entry->ino = ip->i_ino;
1131 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001132 __entry->offset = offset;
1133 __entry->count = count;
Christoph Hellwiga206c812010-12-10 08:42:20 +00001134 __entry->type = type;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001135 __entry->startoff = irec ? irec->br_startoff : 0;
1136 __entry->startblock = irec ? irec->br_startblock : 0;
1137 __entry->blockcount = irec ? irec->br_blockcount : 0;
1138 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001139 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1140 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001141 MAJOR(__entry->dev), MINOR(__entry->dev),
1142 __entry->ino,
1143 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001144 __entry->offset,
1145 __entry->count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001146 __print_symbolic(__entry->type, XFS_IO_TYPES),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001147 __entry->startoff,
1148 (__int64_t)__entry->startblock,
1149 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001150)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001151
1152#define DEFINE_IOMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001153DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001154 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001155 int type, struct xfs_bmbt_irec *irec), \
1156 TP_ARGS(ip, offset, count, type, irec))
1157DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1158DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1159DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1160DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001161
Li Zefanf8adb4d2010-05-24 08:25:57 +00001162DECLARE_EVENT_CLASS(xfs_simple_io_class,
1163 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1164 TP_ARGS(ip, offset, count),
1165 TP_STRUCT__entry(
1166 __field(dev_t, dev)
1167 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001168 __field(loff_t, isize)
1169 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001170 __field(loff_t, offset)
1171 __field(size_t, count)
1172 ),
1173 TP_fast_assign(
1174 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1175 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001176 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001177 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001178 __entry->offset = offset;
1179 __entry->count = count;
1180 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001181 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001182 "offset 0x%llx count %zd",
1183 MAJOR(__entry->dev), MINOR(__entry->dev),
1184 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001185 __entry->isize,
1186 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001187 __entry->offset,
1188 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001189);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001190
1191#define DEFINE_SIMPLE_IO_EVENT(name) \
1192DEFINE_EVENT(xfs_simple_io_class, name, \
1193 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1194 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001195DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1196DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Christoph Hellwiga206c812010-12-10 08:42:20 +00001197DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001198DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001199
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001200DECLARE_EVENT_CLASS(xfs_itrunc_class,
1201 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1202 TP_ARGS(ip, new_size),
1203 TP_STRUCT__entry(
1204 __field(dev_t, dev)
1205 __field(xfs_ino_t, ino)
1206 __field(xfs_fsize_t, size)
1207 __field(xfs_fsize_t, new_size)
1208 ),
1209 TP_fast_assign(
1210 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1211 __entry->ino = ip->i_ino;
1212 __entry->size = ip->i_d.di_size;
1213 __entry->new_size = new_size;
1214 ),
1215 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1216 MAJOR(__entry->dev), MINOR(__entry->dev),
1217 __entry->ino,
1218 __entry->size,
1219 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001220)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001221
1222#define DEFINE_ITRUNC_EVENT(name) \
1223DEFINE_EVENT(xfs_itrunc_class, name, \
1224 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1225 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001226DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1227DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001228
1229TRACE_EVENT(xfs_pagecache_inval,
1230 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1231 TP_ARGS(ip, start, finish),
1232 TP_STRUCT__entry(
1233 __field(dev_t, dev)
1234 __field(xfs_ino_t, ino)
1235 __field(xfs_fsize_t, size)
1236 __field(xfs_off_t, start)
1237 __field(xfs_off_t, finish)
1238 ),
1239 TP_fast_assign(
1240 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1241 __entry->ino = ip->i_ino;
1242 __entry->size = ip->i_d.di_size;
1243 __entry->start = start;
1244 __entry->finish = finish;
1245 ),
1246 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1247 MAJOR(__entry->dev), MINOR(__entry->dev),
1248 __entry->ino,
1249 __entry->size,
1250 __entry->start,
1251 __entry->finish)
1252);
1253
1254TRACE_EVENT(xfs_bunmap,
1255 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1256 int flags, unsigned long caller_ip),
1257 TP_ARGS(ip, bno, len, flags, caller_ip),
1258 TP_STRUCT__entry(
1259 __field(dev_t, dev)
1260 __field(xfs_ino_t, ino)
1261 __field(xfs_fsize_t, size)
1262 __field(xfs_fileoff_t, bno)
1263 __field(xfs_filblks_t, len)
1264 __field(unsigned long, caller_ip)
1265 __field(int, flags)
1266 ),
1267 TP_fast_assign(
1268 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1269 __entry->ino = ip->i_ino;
1270 __entry->size = ip->i_d.di_size;
1271 __entry->bno = bno;
1272 __entry->len = len;
1273 __entry->caller_ip = caller_ip;
1274 __entry->flags = flags;
1275 ),
1276 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1277 "flags %s caller %pf",
1278 MAJOR(__entry->dev), MINOR(__entry->dev),
1279 __entry->ino,
1280 __entry->size,
1281 __entry->bno,
1282 __entry->len,
1283 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1284 (void *)__entry->caller_ip)
1285
1286);
1287
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001288DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001289 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1290 xfs_agblock_t agbno, xfs_extlen_t len),
1291 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001292 TP_STRUCT__entry(
1293 __field(dev_t, dev)
1294 __field(xfs_agnumber_t, agno)
1295 __field(xfs_agblock_t, agbno)
1296 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001297 ),
1298 TP_fast_assign(
1299 __entry->dev = mp->m_super->s_dev;
1300 __entry->agno = agno;
1301 __entry->agbno = agbno;
1302 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001303 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001304 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001305 MAJOR(__entry->dev), MINOR(__entry->dev),
1306 __entry->agno,
1307 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001308 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001309);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001310#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001311DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001312 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1313 xfs_agblock_t agbno, xfs_extlen_t len), \
1314 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001315DEFINE_BUSY_EVENT(xfs_extent_busy);
1316DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1317DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1318DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1319DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001320
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001321TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001322 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1323 xfs_agblock_t agbno, xfs_extlen_t len,
1324 xfs_agblock_t tbno, xfs_extlen_t tlen),
1325 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1326 TP_STRUCT__entry(
1327 __field(dev_t, dev)
1328 __field(xfs_agnumber_t, agno)
1329 __field(xfs_agblock_t, agbno)
1330 __field(xfs_extlen_t, len)
1331 __field(xfs_agblock_t, tbno)
1332 __field(xfs_extlen_t, tlen)
1333 ),
1334 TP_fast_assign(
1335 __entry->dev = mp->m_super->s_dev;
1336 __entry->agno = agno;
1337 __entry->agbno = agbno;
1338 __entry->len = len;
1339 __entry->tbno = tbno;
1340 __entry->tlen = tlen;
1341 ),
1342 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1343 MAJOR(__entry->dev), MINOR(__entry->dev),
1344 __entry->agno,
1345 __entry->agbno,
1346 __entry->len,
1347 __entry->tbno,
1348 __entry->tlen)
1349);
1350
Dave Chinnered3b4d62010-05-21 12:07:08 +10001351TRACE_EVENT(xfs_trans_commit_lsn,
1352 TP_PROTO(struct xfs_trans *trans),
1353 TP_ARGS(trans),
1354 TP_STRUCT__entry(
1355 __field(dev_t, dev)
1356 __field(struct xfs_trans *, tp)
1357 __field(xfs_lsn_t, lsn)
1358 ),
1359 TP_fast_assign(
1360 __entry->dev = trans->t_mountp->m_super->s_dev;
1361 __entry->tp = trans;
1362 __entry->lsn = trans->t_commit_lsn;
1363 ),
1364 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1365 MAJOR(__entry->dev), MINOR(__entry->dev),
1366 __entry->tp,
Dave Chinnerfd45e4782010-01-02 02:38:56 +00001367 __entry->lsn)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001368);
1369
1370TRACE_EVENT(xfs_agf,
1371 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1372 unsigned long caller_ip),
1373 TP_ARGS(mp, agf, flags, caller_ip),
1374 TP_STRUCT__entry(
1375 __field(dev_t, dev)
1376 __field(xfs_agnumber_t, agno)
1377 __field(int, flags)
1378 __field(__u32, length)
1379 __field(__u32, bno_root)
1380 __field(__u32, cnt_root)
1381 __field(__u32, bno_level)
1382 __field(__u32, cnt_level)
1383 __field(__u32, flfirst)
1384 __field(__u32, fllast)
1385 __field(__u32, flcount)
1386 __field(__u32, freeblks)
1387 __field(__u32, longest)
1388 __field(unsigned long, caller_ip)
1389 ),
1390 TP_fast_assign(
1391 __entry->dev = mp->m_super->s_dev;
1392 __entry->agno = be32_to_cpu(agf->agf_seqno),
1393 __entry->flags = flags;
1394 __entry->length = be32_to_cpu(agf->agf_length),
1395 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1396 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1397 __entry->bno_level =
1398 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1399 __entry->cnt_level =
1400 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1401 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1402 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1403 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1404 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1405 __entry->longest = be32_to_cpu(agf->agf_longest);
1406 __entry->caller_ip = caller_ip;
1407 ),
1408 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1409 "levels b %u c %u flfirst %u fllast %u flcount %u "
1410 "freeblks %u longest %u caller %pf",
1411 MAJOR(__entry->dev), MINOR(__entry->dev),
1412 __entry->agno,
1413 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1414 __entry->length,
1415 __entry->bno_root,
1416 __entry->cnt_root,
1417 __entry->bno_level,
1418 __entry->cnt_level,
1419 __entry->flfirst,
1420 __entry->fllast,
1421 __entry->flcount,
1422 __entry->freeblks,
1423 __entry->longest,
1424 (void *)__entry->caller_ip)
1425);
1426
1427TRACE_EVENT(xfs_free_extent,
1428 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1429 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1430 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1431 TP_STRUCT__entry(
1432 __field(dev_t, dev)
1433 __field(xfs_agnumber_t, agno)
1434 __field(xfs_agblock_t, agbno)
1435 __field(xfs_extlen_t, len)
1436 __field(int, isfl)
1437 __field(int, haveleft)
1438 __field(int, haveright)
1439 ),
1440 TP_fast_assign(
1441 __entry->dev = mp->m_super->s_dev;
1442 __entry->agno = agno;
1443 __entry->agbno = agbno;
1444 __entry->len = len;
1445 __entry->isfl = isfl;
1446 __entry->haveleft = haveleft;
1447 __entry->haveright = haveright;
1448 ),
1449 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1450 MAJOR(__entry->dev), MINOR(__entry->dev),
1451 __entry->agno,
1452 __entry->agbno,
1453 __entry->len,
1454 __entry->isfl,
1455 __entry->haveleft ?
1456 (__entry->haveright ? "both" : "left") :
1457 (__entry->haveright ? "right" : "none"))
1458
1459);
1460
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001461DECLARE_EVENT_CLASS(xfs_alloc_class,
1462 TP_PROTO(struct xfs_alloc_arg *args),
1463 TP_ARGS(args),
1464 TP_STRUCT__entry(
1465 __field(dev_t, dev)
1466 __field(xfs_agnumber_t, agno)
1467 __field(xfs_agblock_t, agbno)
1468 __field(xfs_extlen_t, minlen)
1469 __field(xfs_extlen_t, maxlen)
1470 __field(xfs_extlen_t, mod)
1471 __field(xfs_extlen_t, prod)
1472 __field(xfs_extlen_t, minleft)
1473 __field(xfs_extlen_t, total)
1474 __field(xfs_extlen_t, alignment)
1475 __field(xfs_extlen_t, minalignslop)
1476 __field(xfs_extlen_t, len)
1477 __field(short, type)
1478 __field(short, otype)
1479 __field(char, wasdel)
1480 __field(char, wasfromfl)
1481 __field(char, isfl)
1482 __field(char, userdata)
1483 __field(xfs_fsblock_t, firstblock)
1484 ),
1485 TP_fast_assign(
1486 __entry->dev = args->mp->m_super->s_dev;
1487 __entry->agno = args->agno;
1488 __entry->agbno = args->agbno;
1489 __entry->minlen = args->minlen;
1490 __entry->maxlen = args->maxlen;
1491 __entry->mod = args->mod;
1492 __entry->prod = args->prod;
1493 __entry->minleft = args->minleft;
1494 __entry->total = args->total;
1495 __entry->alignment = args->alignment;
1496 __entry->minalignslop = args->minalignslop;
1497 __entry->len = args->len;
1498 __entry->type = args->type;
1499 __entry->otype = args->otype;
1500 __entry->wasdel = args->wasdel;
1501 __entry->wasfromfl = args->wasfromfl;
1502 __entry->isfl = args->isfl;
1503 __entry->userdata = args->userdata;
1504 __entry->firstblock = args->firstblock;
1505 ),
1506 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1507 "prod %u minleft %u total %u alignment %u minalignslop %u "
1508 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1509 "userdata %d firstblock 0x%llx",
1510 MAJOR(__entry->dev), MINOR(__entry->dev),
1511 __entry->agno,
1512 __entry->agbno,
1513 __entry->minlen,
1514 __entry->maxlen,
1515 __entry->mod,
1516 __entry->prod,
1517 __entry->minleft,
1518 __entry->total,
1519 __entry->alignment,
1520 __entry->minalignslop,
1521 __entry->len,
1522 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1523 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1524 __entry->wasdel,
1525 __entry->wasfromfl,
1526 __entry->isfl,
1527 __entry->userdata,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001528 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001529)
1530
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001531#define DEFINE_ALLOC_EVENT(name) \
1532DEFINE_EVENT(xfs_alloc_class, name, \
1533 TP_PROTO(struct xfs_alloc_arg *args), \
1534 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001535DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001536DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001537DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1538DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1539DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1540DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1541DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1542DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001543DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1544DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001545DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1546DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1547DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1548DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1549DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001550DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001551DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1552DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1553DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1554DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1555DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1556DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1557DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1558DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1559DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1560
Dave Chinner5a5881c2012-03-22 05:15:13 +00001561DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001562 TP_PROTO(struct xfs_da_args *args),
1563 TP_ARGS(args),
1564 TP_STRUCT__entry(
1565 __field(dev_t, dev)
1566 __field(xfs_ino_t, ino)
1567 __dynamic_array(char, name, args->namelen)
1568 __field(int, namelen)
1569 __field(xfs_dahash_t, hashval)
1570 __field(xfs_ino_t, inumber)
1571 __field(int, op_flags)
1572 ),
1573 TP_fast_assign(
1574 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1575 __entry->ino = args->dp->i_ino;
1576 if (args->namelen)
1577 memcpy(__get_str(name), args->name, args->namelen);
1578 __entry->namelen = args->namelen;
1579 __entry->hashval = args->hashval;
1580 __entry->inumber = args->inumber;
1581 __entry->op_flags = args->op_flags;
1582 ),
1583 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1584 "inumber 0x%llx op_flags %s",
1585 MAJOR(__entry->dev), MINOR(__entry->dev),
1586 __entry->ino,
1587 __entry->namelen,
1588 __entry->namelen ? __get_str(name) : NULL,
1589 __entry->namelen,
1590 __entry->hashval,
1591 __entry->inumber,
1592 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001593)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001594
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001595#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001596DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001597 TP_PROTO(struct xfs_da_args *args), \
1598 TP_ARGS(args))
1599DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1600DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1601DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1602DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1603DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1604DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1605DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1606DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1607DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1608DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1609DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1610DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1611DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1612DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1613DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1614DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1615DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1616DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1617DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1618DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1619DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1620DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1621DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1622DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1623DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1624
Dave Chinneree732592012-11-12 22:53:53 +11001625DECLARE_EVENT_CLASS(xfs_attr_class,
1626 TP_PROTO(struct xfs_da_args *args),
1627 TP_ARGS(args),
1628 TP_STRUCT__entry(
1629 __field(dev_t, dev)
1630 __field(xfs_ino_t, ino)
1631 __dynamic_array(char, name, args->namelen)
1632 __field(int, namelen)
1633 __field(int, valuelen)
1634 __field(xfs_dahash_t, hashval)
1635 __field(int, op_flags)
1636 ),
1637 TP_fast_assign(
1638 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1639 __entry->ino = args->dp->i_ino;
1640 if (args->namelen)
1641 memcpy(__get_str(name), args->name, args->namelen);
1642 __entry->namelen = args->namelen;
1643 __entry->valuelen = args->valuelen;
1644 __entry->hashval = args->hashval;
1645 __entry->op_flags = args->op_flags;
1646 ),
1647 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1648 "hashval 0x%x op_flags %s",
1649 MAJOR(__entry->dev), MINOR(__entry->dev),
1650 __entry->ino,
1651 __entry->namelen,
1652 __entry->namelen ? __get_str(name) : NULL,
1653 __entry->namelen,
1654 __entry->valuelen,
1655 __entry->hashval,
1656 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1657)
1658
Dave Chinner5a5881c2012-03-22 05:15:13 +00001659#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11001660DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001661 TP_PROTO(struct xfs_da_args *args), \
1662 TP_ARGS(args))
1663DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1664DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1665DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1666DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1667DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1668DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
1669DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1670
1671DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1672DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1673DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11001674DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001675DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1676DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11001677DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1678DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001679DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1680DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11001681DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001682DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1683DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1684DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1685DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1686DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1687DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1688DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1689DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1690DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1691DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1692DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001693DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001694
1695DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11001696DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001697DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
1698DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1699DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1700
Dave Chinneree732592012-11-12 22:53:53 +11001701DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1702DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1703
1704DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1705DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1706DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1707
Dave Chinner5a5881c2012-03-22 05:15:13 +00001708#define DEFINE_DA_EVENT(name) \
1709DEFINE_EVENT(xfs_da_class, name, \
1710 TP_PROTO(struct xfs_da_args *args), \
1711 TP_ARGS(args))
1712DEFINE_DA_EVENT(xfs_da_split);
1713DEFINE_DA_EVENT(xfs_da_join);
1714DEFINE_DA_EVENT(xfs_da_link_before);
1715DEFINE_DA_EVENT(xfs_da_link_after);
1716DEFINE_DA_EVENT(xfs_da_unlink_back);
1717DEFINE_DA_EVENT(xfs_da_unlink_forward);
1718DEFINE_DA_EVENT(xfs_da_root_split);
1719DEFINE_DA_EVENT(xfs_da_root_join);
1720DEFINE_DA_EVENT(xfs_da_node_add);
1721DEFINE_DA_EVENT(xfs_da_node_create);
1722DEFINE_DA_EVENT(xfs_da_node_split);
1723DEFINE_DA_EVENT(xfs_da_node_remove);
1724DEFINE_DA_EVENT(xfs_da_node_rebalance);
1725DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001726DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001727DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1728DEFINE_DA_EVENT(xfs_da_grow_inode);
1729DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11001730DEFINE_DA_EVENT(xfs_da_fixhashpath);
1731DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001732
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001733DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1734 TP_PROTO(struct xfs_da_args *args, int idx),
1735 TP_ARGS(args, idx),
1736 TP_STRUCT__entry(
1737 __field(dev_t, dev)
1738 __field(xfs_ino_t, ino)
1739 __field(int, op_flags)
1740 __field(int, idx)
1741 ),
1742 TP_fast_assign(
1743 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1744 __entry->ino = args->dp->i_ino;
1745 __entry->op_flags = args->op_flags;
1746 __entry->idx = idx;
1747 ),
1748 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1749 MAJOR(__entry->dev), MINOR(__entry->dev),
1750 __entry->ino,
1751 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1752 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001753)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001754
1755#define DEFINE_DIR2_SPACE_EVENT(name) \
1756DEFINE_EVENT(xfs_dir2_space_class, name, \
1757 TP_PROTO(struct xfs_da_args *args, int idx), \
1758 TP_ARGS(args, idx))
1759DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1760DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1761DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1762DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001763
1764TRACE_EVENT(xfs_dir2_leafn_moveents,
1765 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1766 TP_ARGS(args, src_idx, dst_idx, count),
1767 TP_STRUCT__entry(
1768 __field(dev_t, dev)
1769 __field(xfs_ino_t, ino)
1770 __field(int, op_flags)
1771 __field(int, src_idx)
1772 __field(int, dst_idx)
1773 __field(int, count)
1774 ),
1775 TP_fast_assign(
1776 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1777 __entry->ino = args->dp->i_ino;
1778 __entry->op_flags = args->op_flags;
1779 __entry->src_idx = src_idx;
1780 __entry->dst_idx = dst_idx;
1781 __entry->count = count;
1782 ),
1783 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1784 "src_idx %d dst_idx %d count %d",
1785 MAJOR(__entry->dev), MINOR(__entry->dev),
1786 __entry->ino,
1787 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1788 __entry->src_idx,
1789 __entry->dst_idx,
1790 __entry->count)
1791);
1792
Dave Chinner3a85cd92010-01-14 01:33:55 +00001793#define XFS_SWAPEXT_INODES \
1794 { 0, "target" }, \
1795 { 1, "temp" }
1796
1797#define XFS_INODE_FORMAT_STR \
1798 { 0, "invalid" }, \
1799 { 1, "local" }, \
1800 { 2, "extent" }, \
1801 { 3, "btree" }
1802
1803DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1804 TP_PROTO(struct xfs_inode *ip, int which),
1805 TP_ARGS(ip, which),
1806 TP_STRUCT__entry(
1807 __field(dev_t, dev)
1808 __field(int, which)
1809 __field(xfs_ino_t, ino)
1810 __field(int, format)
1811 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00001812 __field(int, broot_size)
1813 __field(int, fork_off)
1814 ),
1815 TP_fast_assign(
1816 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1817 __entry->which = which;
1818 __entry->ino = ip->i_ino;
1819 __entry->format = ip->i_d.di_format;
1820 __entry->nex = ip->i_d.di_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00001821 __entry->broot_size = ip->i_df.if_broot_bytes;
1822 __entry->fork_off = XFS_IFORK_BOFF(ip);
1823 ),
1824 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00001825 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00001826 MAJOR(__entry->dev), MINOR(__entry->dev),
1827 __entry->ino,
1828 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1829 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1830 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00001831 __entry->broot_size,
1832 __entry->fork_off)
1833)
1834
1835#define DEFINE_SWAPEXT_EVENT(name) \
1836DEFINE_EVENT(xfs_swap_extent_class, name, \
1837 TP_PROTO(struct xfs_inode *ip, int which), \
1838 TP_ARGS(ip, which))
1839
1840DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1841DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1842
Dave Chinner9abbc532010-04-13 15:06:46 +10001843DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001844 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10001845 struct xlog_recover_item *item, int pass),
1846 TP_ARGS(log, trans, item, pass),
1847 TP_STRUCT__entry(
1848 __field(dev_t, dev)
1849 __field(unsigned long, item)
1850 __field(xlog_tid_t, tid)
1851 __field(int, type)
1852 __field(int, pass)
1853 __field(int, count)
1854 __field(int, total)
1855 ),
1856 TP_fast_assign(
1857 __entry->dev = log->l_mp->m_super->s_dev;
1858 __entry->item = (unsigned long)item;
1859 __entry->tid = trans->r_log_tid;
1860 __entry->type = ITEM_TYPE(item);
1861 __entry->pass = pass;
1862 __entry->count = item->ri_cnt;
1863 __entry->total = item->ri_total;
1864 ),
1865 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
1866 "item region count/total %d/%d",
1867 MAJOR(__entry->dev), MINOR(__entry->dev),
1868 __entry->tid,
1869 __entry->pass,
1870 (void *)__entry->item,
1871 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1872 __entry->count,
1873 __entry->total)
1874)
1875
1876#define DEFINE_LOG_RECOVER_ITEM(name) \
1877DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001878 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10001879 struct xlog_recover_item *item, int pass), \
1880 TP_ARGS(log, trans, item, pass))
1881
1882DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
1883DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
1884DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
1885DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
1886DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
1887
1888DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001889 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10001890 TP_ARGS(log, buf_f),
1891 TP_STRUCT__entry(
1892 __field(dev_t, dev)
1893 __field(__int64_t, blkno)
1894 __field(unsigned short, len)
1895 __field(unsigned short, flags)
1896 __field(unsigned short, size)
1897 __field(unsigned int, map_size)
1898 ),
1899 TP_fast_assign(
1900 __entry->dev = log->l_mp->m_super->s_dev;
1901 __entry->blkno = buf_f->blf_blkno;
1902 __entry->len = buf_f->blf_len;
1903 __entry->flags = buf_f->blf_flags;
1904 __entry->size = buf_f->blf_size;
1905 __entry->map_size = buf_f->blf_map_size;
1906 ),
1907 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
1908 "map_size %d",
1909 MAJOR(__entry->dev), MINOR(__entry->dev),
1910 __entry->blkno,
1911 __entry->len,
1912 __entry->flags,
1913 __entry->size,
1914 __entry->map_size)
1915)
1916
1917#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
1918DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001919 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10001920 TP_ARGS(log, buf_f))
1921
1922DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
1923DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
1924DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
1925DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
1926DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
1927DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
1928DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
1929DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
1930
1931DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001932 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10001933 TP_ARGS(log, in_f),
1934 TP_STRUCT__entry(
1935 __field(dev_t, dev)
1936 __field(xfs_ino_t, ino)
1937 __field(unsigned short, size)
1938 __field(int, fields)
1939 __field(unsigned short, asize)
1940 __field(unsigned short, dsize)
1941 __field(__int64_t, blkno)
1942 __field(int, len)
1943 __field(int, boffset)
1944 ),
1945 TP_fast_assign(
1946 __entry->dev = log->l_mp->m_super->s_dev;
1947 __entry->ino = in_f->ilf_ino;
1948 __entry->size = in_f->ilf_size;
1949 __entry->fields = in_f->ilf_fields;
1950 __entry->asize = in_f->ilf_asize;
1951 __entry->dsize = in_f->ilf_dsize;
1952 __entry->blkno = in_f->ilf_blkno;
1953 __entry->len = in_f->ilf_len;
1954 __entry->boffset = in_f->ilf_boffset;
1955 ),
1956 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
1957 "dsize %d, blkno 0x%llx, len %d, boffset %d",
1958 MAJOR(__entry->dev), MINOR(__entry->dev),
1959 __entry->ino,
1960 __entry->size,
1961 __entry->fields,
1962 __entry->asize,
1963 __entry->dsize,
1964 __entry->blkno,
1965 __entry->len,
1966 __entry->boffset)
1967)
1968#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
1969DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001970 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10001971 TP_ARGS(log, in_f))
1972
1973DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
1974DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
1975DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
1976
Christoph Hellwiga46db602011-01-07 13:02:04 +00001977DECLARE_EVENT_CLASS(xfs_discard_class,
1978 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1979 xfs_agblock_t agbno, xfs_extlen_t len),
1980 TP_ARGS(mp, agno, agbno, len),
1981 TP_STRUCT__entry(
1982 __field(dev_t, dev)
1983 __field(xfs_agnumber_t, agno)
1984 __field(xfs_agblock_t, agbno)
1985 __field(xfs_extlen_t, len)
1986 ),
1987 TP_fast_assign(
1988 __entry->dev = mp->m_super->s_dev;
1989 __entry->agno = agno;
1990 __entry->agbno = agbno;
1991 __entry->len = len;
1992 ),
1993 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
1994 MAJOR(__entry->dev), MINOR(__entry->dev),
1995 __entry->agno,
1996 __entry->agbno,
1997 __entry->len)
1998)
1999
2000#define DEFINE_DISCARD_EVENT(name) \
2001DEFINE_EVENT(xfs_discard_class, name, \
2002 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2003 xfs_agblock_t agbno, xfs_extlen_t len), \
2004 TP_ARGS(mp, agno, agbno, len))
2005DEFINE_DISCARD_EVENT(xfs_discard_extent);
2006DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2007DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2008DEFINE_DISCARD_EVENT(xfs_discard_busy);
2009
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00002010#endif /* _TRACE_XFS_H */
2011
2012#undef TRACE_INCLUDE_PATH
2013#define TRACE_INCLUDE_PATH .
2014#define TRACE_INCLUDE_FILE xfs_trace
2015#include <trace/define_trace.h>