blob: 152f82782630222321bcd234b20c0ffb0a626e34 [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 Hellwigb94acd42014-04-23 07:11:52 +1000541DECLARE_EVENT_CLASS(xfs_filestream_class,
542 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
543 TP_ARGS(ip, agno),
544 TP_STRUCT__entry(
545 __field(dev_t, dev)
546 __field(xfs_ino_t, ino)
547 __field(xfs_agnumber_t, agno)
548 __field(int, streams)
549 ),
550 TP_fast_assign(
551 __entry->dev = VFS_I(ip)->i_sb->s_dev;
552 __entry->ino = ip->i_ino;
553 __entry->agno = agno;
554 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
555 ),
556 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
557 MAJOR(__entry->dev), MINOR(__entry->dev),
558 __entry->ino,
559 __entry->agno,
560 __entry->streams)
561)
562#define DEFINE_FILESTREAM_EVENT(name) \
563DEFINE_EVENT(xfs_filestream_class, name, \
564 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
565 TP_ARGS(ip, agno))
566DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
567DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
568DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
569
570TRACE_EVENT(xfs_filestream_pick,
571 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
572 xfs_extlen_t free, int nscan),
573 TP_ARGS(ip, agno, free, nscan),
574 TP_STRUCT__entry(
575 __field(dev_t, dev)
576 __field(xfs_ino_t, ino)
577 __field(xfs_agnumber_t, agno)
578 __field(int, streams)
579 __field(xfs_extlen_t, free)
580 __field(int, nscan)
581 ),
582 TP_fast_assign(
583 __entry->dev = VFS_I(ip)->i_sb->s_dev;
584 __entry->ino = ip->i_ino;
585 __entry->agno = agno;
586 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
587 __entry->free = free;
588 __entry->nscan = nscan;
589 ),
590 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
591 MAJOR(__entry->dev), MINOR(__entry->dev),
592 __entry->ino,
593 __entry->agno,
594 __entry->streams,
595 __entry->free,
596 __entry->nscan)
597);
598
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000599DECLARE_EVENT_CLASS(xfs_lock_class,
600 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
601 unsigned long caller_ip),
602 TP_ARGS(ip, lock_flags, caller_ip),
603 TP_STRUCT__entry(
604 __field(dev_t, dev)
605 __field(xfs_ino_t, ino)
606 __field(int, lock_flags)
607 __field(unsigned long, caller_ip)
608 ),
609 TP_fast_assign(
610 __entry->dev = VFS_I(ip)->i_sb->s_dev;
611 __entry->ino = ip->i_ino;
612 __entry->lock_flags = lock_flags;
613 __entry->caller_ip = caller_ip;
614 ),
615 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf",
616 MAJOR(__entry->dev), MINOR(__entry->dev),
617 __entry->ino,
618 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
619 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000620)
621
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000622#define DEFINE_LOCK_EVENT(name) \
623DEFINE_EVENT(xfs_lock_class, name, \
624 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
625 unsigned long caller_ip), \
626 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000627DEFINE_LOCK_EVENT(xfs_ilock);
628DEFINE_LOCK_EVENT(xfs_ilock_nowait);
629DEFINE_LOCK_EVENT(xfs_ilock_demote);
630DEFINE_LOCK_EVENT(xfs_iunlock);
631
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000632DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000633 TP_PROTO(struct xfs_inode *ip),
634 TP_ARGS(ip),
635 TP_STRUCT__entry(
636 __field(dev_t, dev)
637 __field(xfs_ino_t, ino)
638 ),
639 TP_fast_assign(
640 __entry->dev = VFS_I(ip)->i_sb->s_dev;
641 __entry->ino = ip->i_ino;
642 ),
643 TP_printk("dev %d:%d ino 0x%llx",
644 MAJOR(__entry->dev), MINOR(__entry->dev),
645 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000646)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000647
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000648#define DEFINE_INODE_EVENT(name) \
649DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000650 TP_PROTO(struct xfs_inode *ip), \
651 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000652DEFINE_INODE_EVENT(xfs_iget_skip);
653DEFINE_INODE_EVENT(xfs_iget_reclaim);
654DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
655DEFINE_INODE_EVENT(xfs_iget_hit);
656DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000657
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000658DEFINE_INODE_EVENT(xfs_getattr);
659DEFINE_INODE_EVENT(xfs_setattr);
660DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500661DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000662DEFINE_INODE_EVENT(xfs_alloc_file_space);
663DEFINE_INODE_EVENT(xfs_free_file_space);
Dave Chinner897b73b2014-04-14 18:15:11 +1000664DEFINE_INODE_EVENT(xfs_zero_file_space);
Namjae Jeone1d8fb82014-02-24 10:58:19 +1100665DEFINE_INODE_EVENT(xfs_collapse_file_space);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000666DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000667#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200668DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000669#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000670DEFINE_INODE_EVENT(xfs_vm_bmap);
671DEFINE_INODE_EVENT(xfs_file_ioctl);
672DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
673DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000674DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000675DEFINE_INODE_EVENT(xfs_file_fsync);
676DEFINE_INODE_EVENT(xfs_destroy_inode);
Al Virob57922d2010-06-07 14:34:48 -0400677DEFINE_INODE_EVENT(xfs_evict_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400678DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000679
680DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
681DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
682
Brian Foster27b52862012-11-06 09:50:38 -0500683DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
684DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500685DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Brian Foster27b52862012-11-06 09:50:38 -0500686
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000687DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000688 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
689 TP_ARGS(ip, caller_ip),
690 TP_STRUCT__entry(
691 __field(dev_t, dev)
692 __field(xfs_ino_t, ino)
693 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100694 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000695 __field(unsigned long, caller_ip)
696 ),
697 TP_fast_assign(
698 __entry->dev = VFS_I(ip)->i_sb->s_dev;
699 __entry->ino = ip->i_ino;
700 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100701 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000702 __entry->caller_ip = caller_ip;
703 ),
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100704 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pf",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000705 MAJOR(__entry->dev), MINOR(__entry->dev),
706 __entry->ino,
707 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100708 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000709 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000710)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000711
Brian Foster19cb7e32013-03-18 10:51:48 -0400712TRACE_EVENT(xfs_iomap_prealloc_size,
713 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
714 unsigned int writeio_blocks),
715 TP_ARGS(ip, blocks, shift, writeio_blocks),
716 TP_STRUCT__entry(
717 __field(dev_t, dev)
718 __field(xfs_ino_t, ino)
719 __field(xfs_fsblock_t, blocks)
720 __field(int, shift)
721 __field(unsigned int, writeio_blocks)
722 ),
723 TP_fast_assign(
724 __entry->dev = VFS_I(ip)->i_sb->s_dev;
725 __entry->ino = ip->i_ino;
726 __entry->blocks = blocks;
727 __entry->shift = shift;
728 __entry->writeio_blocks = writeio_blocks;
729 ),
730 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
731 "m_writeio_blocks %u",
732 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
733 __entry->blocks, __entry->shift, __entry->writeio_blocks)
734)
735
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000736#define DEFINE_IREF_EVENT(name) \
737DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000738 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
739 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000740DEFINE_IREF_EVENT(xfs_ihold);
741DEFINE_IREF_EVENT(xfs_irele);
742DEFINE_IREF_EVENT(xfs_inode_pin);
743DEFINE_IREF_EVENT(xfs_inode_unpin);
744DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100745
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000746DECLARE_EVENT_CLASS(xfs_namespace_class,
747 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
748 TP_ARGS(dp, name),
749 TP_STRUCT__entry(
750 __field(dev_t, dev)
751 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000752 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000753 __dynamic_array(char, name, name->len)
754 ),
755 TP_fast_assign(
756 __entry->dev = VFS_I(dp)->i_sb->s_dev;
757 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000758 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000759 memcpy(__get_str(name), name->name, name->len);
760 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000761 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000762 MAJOR(__entry->dev), MINOR(__entry->dev),
763 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000764 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000765 __get_str(name))
766)
767
768#define DEFINE_NAMESPACE_EVENT(name) \
769DEFINE_EVENT(xfs_namespace_class, name, \
770 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
771 TP_ARGS(dp, name))
772DEFINE_NAMESPACE_EVENT(xfs_remove);
773DEFINE_NAMESPACE_EVENT(xfs_link);
774DEFINE_NAMESPACE_EVENT(xfs_lookup);
775DEFINE_NAMESPACE_EVENT(xfs_create);
776DEFINE_NAMESPACE_EVENT(xfs_symlink);
777
778TRACE_EVENT(xfs_rename,
779 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
780 struct xfs_name *src_name, struct xfs_name *target_name),
781 TP_ARGS(src_dp, target_dp, src_name, target_name),
782 TP_STRUCT__entry(
783 __field(dev_t, dev)
784 __field(xfs_ino_t, src_dp_ino)
785 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000786 __field(int, src_namelen)
787 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000788 __dynamic_array(char, src_name, src_name->len)
789 __dynamic_array(char, target_name, target_name->len)
790 ),
791 TP_fast_assign(
792 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
793 __entry->src_dp_ino = src_dp->i_ino;
794 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000795 __entry->src_namelen = src_name->len;
796 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000797 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000798 memcpy(__get_str(target_name), target_name->name,
799 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000800 ),
801 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000802 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000803 MAJOR(__entry->dev), MINOR(__entry->dev),
804 __entry->src_dp_ino,
805 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000806 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000807 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000808 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000809 __get_str(target_name))
810)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000811
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000812DECLARE_EVENT_CLASS(xfs_dquot_class,
813 TP_PROTO(struct xfs_dquot *dqp),
814 TP_ARGS(dqp),
815 TP_STRUCT__entry(
816 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000817 __field(u32, id)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000818 __field(unsigned, flags)
819 __field(unsigned, nrefs)
820 __field(unsigned long long, res_bcount)
821 __field(unsigned long long, bcount)
822 __field(unsigned long long, icount)
823 __field(unsigned long long, blk_hardlimit)
824 __field(unsigned long long, blk_softlimit)
825 __field(unsigned long long, ino_hardlimit)
826 __field(unsigned long long, ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000827 ), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000828 TP_fast_assign(
829 __entry->dev = dqp->q_mount->m_super->s_dev;
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000830 __entry->id = be32_to_cpu(dqp->q_core.d_id);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000831 __entry->flags = dqp->dq_flags;
832 __entry->nrefs = dqp->q_nrefs;
833 __entry->res_bcount = dqp->q_res_bcount;
834 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
835 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
836 __entry->blk_hardlimit =
837 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
838 __entry->blk_softlimit =
839 be64_to_cpu(dqp->q_core.d_blk_softlimit);
840 __entry->ino_hardlimit =
841 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
842 __entry->ino_softlimit =
843 be64_to_cpu(dqp->q_core.d_ino_softlimit);
844 ),
845 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000846 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
847 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000848 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000849 __entry->id,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000850 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
851 __entry->nrefs,
852 __entry->res_bcount,
853 __entry->bcount,
854 __entry->blk_hardlimit,
855 __entry->blk_softlimit,
856 __entry->icount,
857 __entry->ino_hardlimit,
858 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000859)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000860
861#define DEFINE_DQUOT_EVENT(name) \
862DEFINE_EVENT(xfs_dquot_class, name, \
863 TP_PROTO(struct xfs_dquot *dqp), \
864 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000865DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000866DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
867DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b2012-02-01 13:57:20 +0000868DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
869DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000870DEFINE_DQUOT_EVENT(xfs_dqattach_found);
871DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000872DEFINE_DQUOT_EVENT(xfs_dqalloc);
873DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
874DEFINE_DQUOT_EVENT(xfs_dqread);
875DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000876DEFINE_DQUOT_EVENT(xfs_dqget_hit);
877DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000878DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
879DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000880DEFINE_DQUOT_EVENT(xfs_dqput);
881DEFINE_DQUOT_EVENT(xfs_dqput_wait);
882DEFINE_DQUOT_EVENT(xfs_dqput_free);
883DEFINE_DQUOT_EVENT(xfs_dqrele);
884DEFINE_DQUOT_EVENT(xfs_dqflush);
885DEFINE_DQUOT_EVENT(xfs_dqflush_force);
886DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000887
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000888DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -0500889 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000890 TP_ARGS(log, tic),
891 TP_STRUCT__entry(
892 __field(dev_t, dev)
893 __field(unsigned, trans_type)
894 __field(char, ocnt)
895 __field(char, cnt)
896 __field(int, curr_res)
897 __field(int, unit_res)
898 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +1100899 __field(int, reserveq)
900 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000901 __field(int, grant_reserve_cycle)
902 __field(int, grant_reserve_bytes)
903 __field(int, grant_write_cycle)
904 __field(int, grant_write_bytes)
905 __field(int, curr_cycle)
906 __field(int, curr_block)
907 __field(xfs_lsn_t, tail_lsn)
908 ),
909 TP_fast_assign(
910 __entry->dev = log->l_mp->m_super->s_dev;
911 __entry->trans_type = tic->t_trans_type;
912 __entry->ocnt = tic->t_ocnt;
913 __entry->cnt = tic->t_cnt;
914 __entry->curr_res = tic->t_curr_res;
915 __entry->unit_res = tic->t_unit_res;
916 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +0000917 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
918 __entry->writeq = list_empty(&log->l_write_head.waiters);
919 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100920 &__entry->grant_reserve_cycle,
921 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +0000922 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100923 &__entry->grant_write_cycle,
924 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000925 __entry->curr_cycle = log->l_curr_cycle;
926 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +1100927 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000928 ),
929 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +1100930 "t_unit_res %u t_flags %s reserveq %s "
931 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000932 "grant_reserve_bytes %d grant_write_cycle %d "
933 "grant_write_bytes %d curr_cycle %d curr_block %d "
934 "tail_cycle %d tail_block %d",
935 MAJOR(__entry->dev), MINOR(__entry->dev),
936 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
937 __entry->ocnt,
938 __entry->cnt,
939 __entry->curr_res,
940 __entry->unit_res,
941 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +1100942 __entry->reserveq ? "empty" : "active",
943 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000944 __entry->grant_reserve_cycle,
945 __entry->grant_reserve_bytes,
946 __entry->grant_write_cycle,
947 __entry->grant_write_bytes,
948 __entry->curr_cycle,
949 __entry->curr_block,
950 CYCLE_LSN(__entry->tail_lsn),
951 BLOCK_LSN(__entry->tail_lsn)
952 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000953)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000954
955#define DEFINE_LOGGRANT_EVENT(name) \
956DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -0500957 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000958 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000959DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
960DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000961DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +0000962DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
963DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +1100964DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +0000965DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
966DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
967DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
968DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000969DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
970DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
971DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
972DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
973DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
974DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
975
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000976DECLARE_EVENT_CLASS(xfs_log_item_class,
977 TP_PROTO(struct xfs_log_item *lip),
978 TP_ARGS(lip),
979 TP_STRUCT__entry(
980 __field(dev_t, dev)
981 __field(void *, lip)
982 __field(uint, type)
983 __field(uint, flags)
984 __field(xfs_lsn_t, lsn)
985 ),
986 TP_fast_assign(
987 __entry->dev = lip->li_mountp->m_super->s_dev;
988 __entry->lip = lip;
989 __entry->type = lip->li_type;
990 __entry->flags = lip->li_flags;
991 __entry->lsn = lip->li_lsn;
992 ),
993 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
994 MAJOR(__entry->dev), MINOR(__entry->dev),
995 __entry->lip,
996 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
997 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
998 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
999)
1000
Dave Chinner14c26c62012-04-24 16:33:31 +10001001TRACE_EVENT(xfs_log_force,
1002 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn),
1003 TP_ARGS(mp, lsn),
1004 TP_STRUCT__entry(
1005 __field(dev_t, dev)
1006 __field(xfs_lsn_t, lsn)
1007 ),
1008 TP_fast_assign(
1009 __entry->dev = mp->m_super->s_dev;
1010 __entry->lsn = lsn;
1011 ),
1012 TP_printk("dev %d:%d lsn 0x%llx",
1013 MAJOR(__entry->dev), MINOR(__entry->dev),
1014 __entry->lsn)
1015)
1016
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001017#define DEFINE_LOG_ITEM_EVENT(name) \
1018DEFINE_EVENT(xfs_log_item_class, name, \
1019 TP_PROTO(struct xfs_log_item *lip), \
1020 TP_ARGS(lip))
1021DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001022DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1023DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +10001024DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001025
Dave Chinner750b9c92013-11-01 15:27:18 +11001026DECLARE_EVENT_CLASS(xfs_ail_class,
1027 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1028 TP_ARGS(lip, old_lsn, new_lsn),
1029 TP_STRUCT__entry(
1030 __field(dev_t, dev)
1031 __field(void *, lip)
1032 __field(uint, type)
1033 __field(uint, flags)
1034 __field(xfs_lsn_t, old_lsn)
1035 __field(xfs_lsn_t, new_lsn)
1036 ),
1037 TP_fast_assign(
1038 __entry->dev = lip->li_mountp->m_super->s_dev;
1039 __entry->lip = lip;
1040 __entry->type = lip->li_type;
1041 __entry->flags = lip->li_flags;
1042 __entry->old_lsn = old_lsn;
1043 __entry->new_lsn = new_lsn;
1044 ),
1045 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
1046 MAJOR(__entry->dev), MINOR(__entry->dev),
1047 __entry->lip,
1048 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1049 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1050 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1051 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1052)
1053
1054#define DEFINE_AIL_EVENT(name) \
1055DEFINE_EVENT(xfs_ail_class, name, \
1056 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1057 TP_ARGS(lip, old_lsn, new_lsn))
1058DEFINE_AIL_EVENT(xfs_ail_insert);
1059DEFINE_AIL_EVENT(xfs_ail_move);
1060DEFINE_AIL_EVENT(xfs_ail_delete);
1061
1062TRACE_EVENT(xfs_log_assign_tail_lsn,
1063 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1064 TP_ARGS(log, new_lsn),
1065 TP_STRUCT__entry(
1066 __field(dev_t, dev)
1067 __field(xfs_lsn_t, new_lsn)
1068 __field(xfs_lsn_t, old_lsn)
1069 __field(xfs_lsn_t, last_sync_lsn)
1070 ),
1071 TP_fast_assign(
1072 __entry->dev = log->l_mp->m_super->s_dev;
1073 __entry->new_lsn = new_lsn;
1074 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1075 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1076 ),
1077 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1078 MAJOR(__entry->dev), MINOR(__entry->dev),
1079 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1080 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1081 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1082)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001083
Li Zefanf8adb4d2010-05-24 08:25:57 +00001084DECLARE_EVENT_CLASS(xfs_file_class,
1085 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags),
1086 TP_ARGS(ip, count, offset, flags),
1087 TP_STRUCT__entry(
1088 __field(dev_t, dev)
1089 __field(xfs_ino_t, ino)
1090 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001091 __field(loff_t, offset)
1092 __field(size_t, count)
1093 __field(int, flags)
1094 ),
1095 TP_fast_assign(
1096 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1097 __entry->ino = ip->i_ino;
1098 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001099 __entry->offset = offset;
1100 __entry->count = count;
1101 __entry->flags = flags;
1102 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001103 TP_printk("dev %d:%d ino 0x%llx size 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001104 "offset 0x%llx count 0x%zx ioflags %s",
1105 MAJOR(__entry->dev), MINOR(__entry->dev),
1106 __entry->ino,
1107 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001108 __entry->offset,
1109 __entry->count,
1110 __print_flags(__entry->flags, "|", XFS_IO_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001111)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001112
1113#define DEFINE_RW_EVENT(name) \
1114DEFINE_EVENT(xfs_file_class, name, \
1115 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
1116 TP_ARGS(ip, count, offset, flags))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001117DEFINE_RW_EVENT(xfs_file_read);
1118DEFINE_RW_EVENT(xfs_file_buffered_write);
1119DEFINE_RW_EVENT(xfs_file_direct_write);
1120DEFINE_RW_EVENT(xfs_file_splice_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001121
Li Zefanf8adb4d2010-05-24 08:25:57 +00001122DECLARE_EVENT_CLASS(xfs_page_class,
Lukas Czerner34097df2013-05-21 23:58:01 -04001123 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1124 unsigned int len),
1125 TP_ARGS(inode, page, off, len),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001126 TP_STRUCT__entry(
1127 __field(dev_t, dev)
1128 __field(xfs_ino_t, ino)
1129 __field(pgoff_t, pgoff)
1130 __field(loff_t, size)
1131 __field(unsigned long, offset)
Lukas Czerner34097df2013-05-21 23:58:01 -04001132 __field(unsigned int, length)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001133 __field(int, delalloc)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001134 __field(int, unwritten)
1135 ),
1136 TP_fast_assign(
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001137 int delalloc = -1, unwritten = -1;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001138
Li Zefanf8adb4d2010-05-24 08:25:57 +00001139 if (page_has_buffers(page))
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001140 xfs_count_page_state(page, &delalloc, &unwritten);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001141 __entry->dev = inode->i_sb->s_dev;
1142 __entry->ino = XFS_I(inode)->i_ino;
1143 __entry->pgoff = page_offset(page);
1144 __entry->size = i_size_read(inode);
1145 __entry->offset = off;
Lukas Czerner34097df2013-05-21 23:58:01 -04001146 __entry->length = len;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001147 __entry->delalloc = delalloc;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001148 __entry->unwritten = unwritten;
1149 ),
1150 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
Lukas Czerner34097df2013-05-21 23:58:01 -04001151 "length %x delalloc %d unwritten %d",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001152 MAJOR(__entry->dev), MINOR(__entry->dev),
1153 __entry->ino,
1154 __entry->pgoff,
1155 __entry->size,
1156 __entry->offset,
Lukas Czerner34097df2013-05-21 23:58:01 -04001157 __entry->length,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001158 __entry->delalloc,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001159 __entry->unwritten)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001160)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001161
1162#define DEFINE_PAGE_EVENT(name) \
1163DEFINE_EVENT(xfs_page_class, name, \
Lukas Czerner34097df2013-05-21 23:58:01 -04001164 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1165 unsigned int len), \
1166 TP_ARGS(inode, page, off, len))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001167DEFINE_PAGE_EVENT(xfs_writepage);
1168DEFINE_PAGE_EVENT(xfs_releasepage);
1169DEFINE_PAGE_EVENT(xfs_invalidatepage);
1170
Christoph Hellwiga206c812010-12-10 08:42:20 +00001171DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001172 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001173 int type, struct xfs_bmbt_irec *irec),
1174 TP_ARGS(ip, offset, count, type, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001175 TP_STRUCT__entry(
1176 __field(dev_t, dev)
1177 __field(xfs_ino_t, ino)
1178 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001179 __field(loff_t, offset)
1180 __field(size_t, count)
Christoph Hellwiga206c812010-12-10 08:42:20 +00001181 __field(int, type)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001182 __field(xfs_fileoff_t, startoff)
1183 __field(xfs_fsblock_t, startblock)
1184 __field(xfs_filblks_t, blockcount)
1185 ),
1186 TP_fast_assign(
1187 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1188 __entry->ino = ip->i_ino;
1189 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001190 __entry->offset = offset;
1191 __entry->count = count;
Christoph Hellwiga206c812010-12-10 08:42:20 +00001192 __entry->type = type;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001193 __entry->startoff = irec ? irec->br_startoff : 0;
1194 __entry->startblock = irec ? irec->br_startblock : 0;
1195 __entry->blockcount = irec ? irec->br_blockcount : 0;
1196 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001197 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1198 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001199 MAJOR(__entry->dev), MINOR(__entry->dev),
1200 __entry->ino,
1201 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001202 __entry->offset,
1203 __entry->count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001204 __print_symbolic(__entry->type, XFS_IO_TYPES),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001205 __entry->startoff,
1206 (__int64_t)__entry->startblock,
1207 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001208)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001209
1210#define DEFINE_IOMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001211DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001212 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001213 int type, struct xfs_bmbt_irec *irec), \
1214 TP_ARGS(ip, offset, count, type, irec))
1215DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1216DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1217DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1218DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001219
Li Zefanf8adb4d2010-05-24 08:25:57 +00001220DECLARE_EVENT_CLASS(xfs_simple_io_class,
1221 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1222 TP_ARGS(ip, offset, count),
1223 TP_STRUCT__entry(
1224 __field(dev_t, dev)
1225 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001226 __field(loff_t, isize)
1227 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001228 __field(loff_t, offset)
1229 __field(size_t, count)
1230 ),
1231 TP_fast_assign(
1232 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1233 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001234 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001235 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001236 __entry->offset = offset;
1237 __entry->count = count;
1238 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001239 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001240 "offset 0x%llx count %zd",
1241 MAJOR(__entry->dev), MINOR(__entry->dev),
1242 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001243 __entry->isize,
1244 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001245 __entry->offset,
1246 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001247);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001248
1249#define DEFINE_SIMPLE_IO_EVENT(name) \
1250DEFINE_EVENT(xfs_simple_io_class, name, \
1251 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1252 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001253DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1254DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Christoph Hellwiga206c812010-12-10 08:42:20 +00001255DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001256DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001257
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001258DECLARE_EVENT_CLASS(xfs_itrunc_class,
1259 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1260 TP_ARGS(ip, new_size),
1261 TP_STRUCT__entry(
1262 __field(dev_t, dev)
1263 __field(xfs_ino_t, ino)
1264 __field(xfs_fsize_t, size)
1265 __field(xfs_fsize_t, new_size)
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->new_size = new_size;
1272 ),
1273 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1274 MAJOR(__entry->dev), MINOR(__entry->dev),
1275 __entry->ino,
1276 __entry->size,
1277 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001278)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001279
1280#define DEFINE_ITRUNC_EVENT(name) \
1281DEFINE_EVENT(xfs_itrunc_class, name, \
1282 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1283 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001284DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1285DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001286
1287TRACE_EVENT(xfs_pagecache_inval,
1288 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1289 TP_ARGS(ip, start, finish),
1290 TP_STRUCT__entry(
1291 __field(dev_t, dev)
1292 __field(xfs_ino_t, ino)
1293 __field(xfs_fsize_t, size)
1294 __field(xfs_off_t, start)
1295 __field(xfs_off_t, finish)
1296 ),
1297 TP_fast_assign(
1298 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1299 __entry->ino = ip->i_ino;
1300 __entry->size = ip->i_d.di_size;
1301 __entry->start = start;
1302 __entry->finish = finish;
1303 ),
1304 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1305 MAJOR(__entry->dev), MINOR(__entry->dev),
1306 __entry->ino,
1307 __entry->size,
1308 __entry->start,
1309 __entry->finish)
1310);
1311
1312TRACE_EVENT(xfs_bunmap,
1313 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1314 int flags, unsigned long caller_ip),
1315 TP_ARGS(ip, bno, len, flags, caller_ip),
1316 TP_STRUCT__entry(
1317 __field(dev_t, dev)
1318 __field(xfs_ino_t, ino)
1319 __field(xfs_fsize_t, size)
1320 __field(xfs_fileoff_t, bno)
1321 __field(xfs_filblks_t, len)
1322 __field(unsigned long, caller_ip)
1323 __field(int, flags)
1324 ),
1325 TP_fast_assign(
1326 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1327 __entry->ino = ip->i_ino;
1328 __entry->size = ip->i_d.di_size;
1329 __entry->bno = bno;
1330 __entry->len = len;
1331 __entry->caller_ip = caller_ip;
1332 __entry->flags = flags;
1333 ),
1334 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1335 "flags %s caller %pf",
1336 MAJOR(__entry->dev), MINOR(__entry->dev),
1337 __entry->ino,
1338 __entry->size,
1339 __entry->bno,
1340 __entry->len,
1341 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1342 (void *)__entry->caller_ip)
1343
1344);
1345
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001346DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001347 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1348 xfs_agblock_t agbno, xfs_extlen_t len),
1349 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001350 TP_STRUCT__entry(
1351 __field(dev_t, dev)
1352 __field(xfs_agnumber_t, agno)
1353 __field(xfs_agblock_t, agbno)
1354 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001355 ),
1356 TP_fast_assign(
1357 __entry->dev = mp->m_super->s_dev;
1358 __entry->agno = agno;
1359 __entry->agbno = agbno;
1360 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001361 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001362 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001363 MAJOR(__entry->dev), MINOR(__entry->dev),
1364 __entry->agno,
1365 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001366 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001367);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001368#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001369DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001370 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1371 xfs_agblock_t agbno, xfs_extlen_t len), \
1372 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001373DEFINE_BUSY_EVENT(xfs_extent_busy);
1374DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1375DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1376DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1377DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001378
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001379TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001380 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1381 xfs_agblock_t agbno, xfs_extlen_t len,
1382 xfs_agblock_t tbno, xfs_extlen_t tlen),
1383 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1384 TP_STRUCT__entry(
1385 __field(dev_t, dev)
1386 __field(xfs_agnumber_t, agno)
1387 __field(xfs_agblock_t, agbno)
1388 __field(xfs_extlen_t, len)
1389 __field(xfs_agblock_t, tbno)
1390 __field(xfs_extlen_t, tlen)
1391 ),
1392 TP_fast_assign(
1393 __entry->dev = mp->m_super->s_dev;
1394 __entry->agno = agno;
1395 __entry->agbno = agbno;
1396 __entry->len = len;
1397 __entry->tbno = tbno;
1398 __entry->tlen = tlen;
1399 ),
1400 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1401 MAJOR(__entry->dev), MINOR(__entry->dev),
1402 __entry->agno,
1403 __entry->agbno,
1404 __entry->len,
1405 __entry->tbno,
1406 __entry->tlen)
1407);
1408
Dave Chinnered3b4d62010-05-21 12:07:08 +10001409TRACE_EVENT(xfs_trans_commit_lsn,
1410 TP_PROTO(struct xfs_trans *trans),
1411 TP_ARGS(trans),
1412 TP_STRUCT__entry(
1413 __field(dev_t, dev)
1414 __field(struct xfs_trans *, tp)
1415 __field(xfs_lsn_t, lsn)
1416 ),
1417 TP_fast_assign(
1418 __entry->dev = trans->t_mountp->m_super->s_dev;
1419 __entry->tp = trans;
1420 __entry->lsn = trans->t_commit_lsn;
1421 ),
1422 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1423 MAJOR(__entry->dev), MINOR(__entry->dev),
1424 __entry->tp,
Dave Chinnerfd45e4782010-01-02 02:38:56 +00001425 __entry->lsn)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001426);
1427
1428TRACE_EVENT(xfs_agf,
1429 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1430 unsigned long caller_ip),
1431 TP_ARGS(mp, agf, flags, caller_ip),
1432 TP_STRUCT__entry(
1433 __field(dev_t, dev)
1434 __field(xfs_agnumber_t, agno)
1435 __field(int, flags)
1436 __field(__u32, length)
1437 __field(__u32, bno_root)
1438 __field(__u32, cnt_root)
1439 __field(__u32, bno_level)
1440 __field(__u32, cnt_level)
1441 __field(__u32, flfirst)
1442 __field(__u32, fllast)
1443 __field(__u32, flcount)
1444 __field(__u32, freeblks)
1445 __field(__u32, longest)
1446 __field(unsigned long, caller_ip)
1447 ),
1448 TP_fast_assign(
1449 __entry->dev = mp->m_super->s_dev;
1450 __entry->agno = be32_to_cpu(agf->agf_seqno),
1451 __entry->flags = flags;
1452 __entry->length = be32_to_cpu(agf->agf_length),
1453 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1454 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1455 __entry->bno_level =
1456 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1457 __entry->cnt_level =
1458 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1459 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1460 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1461 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1462 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1463 __entry->longest = be32_to_cpu(agf->agf_longest);
1464 __entry->caller_ip = caller_ip;
1465 ),
1466 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1467 "levels b %u c %u flfirst %u fllast %u flcount %u "
1468 "freeblks %u longest %u caller %pf",
1469 MAJOR(__entry->dev), MINOR(__entry->dev),
1470 __entry->agno,
1471 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1472 __entry->length,
1473 __entry->bno_root,
1474 __entry->cnt_root,
1475 __entry->bno_level,
1476 __entry->cnt_level,
1477 __entry->flfirst,
1478 __entry->fllast,
1479 __entry->flcount,
1480 __entry->freeblks,
1481 __entry->longest,
1482 (void *)__entry->caller_ip)
1483);
1484
1485TRACE_EVENT(xfs_free_extent,
1486 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1487 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1488 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1489 TP_STRUCT__entry(
1490 __field(dev_t, dev)
1491 __field(xfs_agnumber_t, agno)
1492 __field(xfs_agblock_t, agbno)
1493 __field(xfs_extlen_t, len)
1494 __field(int, isfl)
1495 __field(int, haveleft)
1496 __field(int, haveright)
1497 ),
1498 TP_fast_assign(
1499 __entry->dev = mp->m_super->s_dev;
1500 __entry->agno = agno;
1501 __entry->agbno = agbno;
1502 __entry->len = len;
1503 __entry->isfl = isfl;
1504 __entry->haveleft = haveleft;
1505 __entry->haveright = haveright;
1506 ),
1507 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1508 MAJOR(__entry->dev), MINOR(__entry->dev),
1509 __entry->agno,
1510 __entry->agbno,
1511 __entry->len,
1512 __entry->isfl,
1513 __entry->haveleft ?
1514 (__entry->haveright ? "both" : "left") :
1515 (__entry->haveright ? "right" : "none"))
1516
1517);
1518
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001519DECLARE_EVENT_CLASS(xfs_alloc_class,
1520 TP_PROTO(struct xfs_alloc_arg *args),
1521 TP_ARGS(args),
1522 TP_STRUCT__entry(
1523 __field(dev_t, dev)
1524 __field(xfs_agnumber_t, agno)
1525 __field(xfs_agblock_t, agbno)
1526 __field(xfs_extlen_t, minlen)
1527 __field(xfs_extlen_t, maxlen)
1528 __field(xfs_extlen_t, mod)
1529 __field(xfs_extlen_t, prod)
1530 __field(xfs_extlen_t, minleft)
1531 __field(xfs_extlen_t, total)
1532 __field(xfs_extlen_t, alignment)
1533 __field(xfs_extlen_t, minalignslop)
1534 __field(xfs_extlen_t, len)
1535 __field(short, type)
1536 __field(short, otype)
1537 __field(char, wasdel)
1538 __field(char, wasfromfl)
1539 __field(char, isfl)
1540 __field(char, userdata)
1541 __field(xfs_fsblock_t, firstblock)
1542 ),
1543 TP_fast_assign(
1544 __entry->dev = args->mp->m_super->s_dev;
1545 __entry->agno = args->agno;
1546 __entry->agbno = args->agbno;
1547 __entry->minlen = args->minlen;
1548 __entry->maxlen = args->maxlen;
1549 __entry->mod = args->mod;
1550 __entry->prod = args->prod;
1551 __entry->minleft = args->minleft;
1552 __entry->total = args->total;
1553 __entry->alignment = args->alignment;
1554 __entry->minalignslop = args->minalignslop;
1555 __entry->len = args->len;
1556 __entry->type = args->type;
1557 __entry->otype = args->otype;
1558 __entry->wasdel = args->wasdel;
1559 __entry->wasfromfl = args->wasfromfl;
1560 __entry->isfl = args->isfl;
1561 __entry->userdata = args->userdata;
1562 __entry->firstblock = args->firstblock;
1563 ),
1564 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1565 "prod %u minleft %u total %u alignment %u minalignslop %u "
1566 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1567 "userdata %d firstblock 0x%llx",
1568 MAJOR(__entry->dev), MINOR(__entry->dev),
1569 __entry->agno,
1570 __entry->agbno,
1571 __entry->minlen,
1572 __entry->maxlen,
1573 __entry->mod,
1574 __entry->prod,
1575 __entry->minleft,
1576 __entry->total,
1577 __entry->alignment,
1578 __entry->minalignslop,
1579 __entry->len,
1580 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1581 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1582 __entry->wasdel,
1583 __entry->wasfromfl,
1584 __entry->isfl,
1585 __entry->userdata,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001586 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001587)
1588
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001589#define DEFINE_ALLOC_EVENT(name) \
1590DEFINE_EVENT(xfs_alloc_class, name, \
1591 TP_PROTO(struct xfs_alloc_arg *args), \
1592 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001593DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001594DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001595DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1596DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1597DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1598DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1599DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1600DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001601DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1602DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001603DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1604DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1605DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1606DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1607DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001608DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001609DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1610DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1611DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1612DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1613DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1614DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1615DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1616DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1617DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1618
Dave Chinner5a5881c2012-03-22 05:15:13 +00001619DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001620 TP_PROTO(struct xfs_da_args *args),
1621 TP_ARGS(args),
1622 TP_STRUCT__entry(
1623 __field(dev_t, dev)
1624 __field(xfs_ino_t, ino)
1625 __dynamic_array(char, name, args->namelen)
1626 __field(int, namelen)
1627 __field(xfs_dahash_t, hashval)
1628 __field(xfs_ino_t, inumber)
1629 __field(int, op_flags)
1630 ),
1631 TP_fast_assign(
1632 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1633 __entry->ino = args->dp->i_ino;
1634 if (args->namelen)
1635 memcpy(__get_str(name), args->name, args->namelen);
1636 __entry->namelen = args->namelen;
1637 __entry->hashval = args->hashval;
1638 __entry->inumber = args->inumber;
1639 __entry->op_flags = args->op_flags;
1640 ),
1641 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1642 "inumber 0x%llx op_flags %s",
1643 MAJOR(__entry->dev), MINOR(__entry->dev),
1644 __entry->ino,
1645 __entry->namelen,
1646 __entry->namelen ? __get_str(name) : NULL,
1647 __entry->namelen,
1648 __entry->hashval,
1649 __entry->inumber,
1650 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001651)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001652
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001653#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001654DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001655 TP_PROTO(struct xfs_da_args *args), \
1656 TP_ARGS(args))
1657DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1658DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1659DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1660DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1661DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1662DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1663DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1664DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1665DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1666DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1667DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1668DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1669DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1670DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1671DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1672DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1673DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1674DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1675DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1676DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1677DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1678DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1679DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1680DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1681DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1682
Dave Chinneree732592012-11-12 22:53:53 +11001683DECLARE_EVENT_CLASS(xfs_attr_class,
1684 TP_PROTO(struct xfs_da_args *args),
1685 TP_ARGS(args),
1686 TP_STRUCT__entry(
1687 __field(dev_t, dev)
1688 __field(xfs_ino_t, ino)
1689 __dynamic_array(char, name, args->namelen)
1690 __field(int, namelen)
1691 __field(int, valuelen)
1692 __field(xfs_dahash_t, hashval)
1693 __field(int, op_flags)
1694 ),
1695 TP_fast_assign(
1696 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1697 __entry->ino = args->dp->i_ino;
1698 if (args->namelen)
1699 memcpy(__get_str(name), args->name, args->namelen);
1700 __entry->namelen = args->namelen;
1701 __entry->valuelen = args->valuelen;
1702 __entry->hashval = args->hashval;
1703 __entry->op_flags = args->op_flags;
1704 ),
1705 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1706 "hashval 0x%x op_flags %s",
1707 MAJOR(__entry->dev), MINOR(__entry->dev),
1708 __entry->ino,
1709 __entry->namelen,
1710 __entry->namelen ? __get_str(name) : NULL,
1711 __entry->namelen,
1712 __entry->valuelen,
1713 __entry->hashval,
1714 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1715)
1716
Dave Chinner5a5881c2012-03-22 05:15:13 +00001717#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11001718DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001719 TP_PROTO(struct xfs_da_args *args), \
1720 TP_ARGS(args))
1721DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1722DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1723DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1724DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1725DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1726DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
1727DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1728
1729DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1730DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1731DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11001732DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001733DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1734DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11001735DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1736DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001737DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1738DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11001739DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001740DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1741DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1742DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1743DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1744DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1745DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1746DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1747DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1748DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1749DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1750DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001751DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001752
1753DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11001754DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001755DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
1756DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1757DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1758
Dave Chinneree732592012-11-12 22:53:53 +11001759DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1760DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1761
1762DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1763DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1764DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1765
Dave Chinner5a5881c2012-03-22 05:15:13 +00001766#define DEFINE_DA_EVENT(name) \
1767DEFINE_EVENT(xfs_da_class, name, \
1768 TP_PROTO(struct xfs_da_args *args), \
1769 TP_ARGS(args))
1770DEFINE_DA_EVENT(xfs_da_split);
1771DEFINE_DA_EVENT(xfs_da_join);
1772DEFINE_DA_EVENT(xfs_da_link_before);
1773DEFINE_DA_EVENT(xfs_da_link_after);
1774DEFINE_DA_EVENT(xfs_da_unlink_back);
1775DEFINE_DA_EVENT(xfs_da_unlink_forward);
1776DEFINE_DA_EVENT(xfs_da_root_split);
1777DEFINE_DA_EVENT(xfs_da_root_join);
1778DEFINE_DA_EVENT(xfs_da_node_add);
1779DEFINE_DA_EVENT(xfs_da_node_create);
1780DEFINE_DA_EVENT(xfs_da_node_split);
1781DEFINE_DA_EVENT(xfs_da_node_remove);
1782DEFINE_DA_EVENT(xfs_da_node_rebalance);
1783DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001784DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001785DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1786DEFINE_DA_EVENT(xfs_da_grow_inode);
1787DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11001788DEFINE_DA_EVENT(xfs_da_fixhashpath);
1789DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001790
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001791DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1792 TP_PROTO(struct xfs_da_args *args, int idx),
1793 TP_ARGS(args, idx),
1794 TP_STRUCT__entry(
1795 __field(dev_t, dev)
1796 __field(xfs_ino_t, ino)
1797 __field(int, op_flags)
1798 __field(int, idx)
1799 ),
1800 TP_fast_assign(
1801 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1802 __entry->ino = args->dp->i_ino;
1803 __entry->op_flags = args->op_flags;
1804 __entry->idx = idx;
1805 ),
1806 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1807 MAJOR(__entry->dev), MINOR(__entry->dev),
1808 __entry->ino,
1809 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1810 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001811)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001812
1813#define DEFINE_DIR2_SPACE_EVENT(name) \
1814DEFINE_EVENT(xfs_dir2_space_class, name, \
1815 TP_PROTO(struct xfs_da_args *args, int idx), \
1816 TP_ARGS(args, idx))
1817DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1818DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1819DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1820DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001821
1822TRACE_EVENT(xfs_dir2_leafn_moveents,
1823 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1824 TP_ARGS(args, src_idx, dst_idx, count),
1825 TP_STRUCT__entry(
1826 __field(dev_t, dev)
1827 __field(xfs_ino_t, ino)
1828 __field(int, op_flags)
1829 __field(int, src_idx)
1830 __field(int, dst_idx)
1831 __field(int, count)
1832 ),
1833 TP_fast_assign(
1834 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1835 __entry->ino = args->dp->i_ino;
1836 __entry->op_flags = args->op_flags;
1837 __entry->src_idx = src_idx;
1838 __entry->dst_idx = dst_idx;
1839 __entry->count = count;
1840 ),
1841 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1842 "src_idx %d dst_idx %d count %d",
1843 MAJOR(__entry->dev), MINOR(__entry->dev),
1844 __entry->ino,
1845 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1846 __entry->src_idx,
1847 __entry->dst_idx,
1848 __entry->count)
1849);
1850
Dave Chinner3a85cd92010-01-14 01:33:55 +00001851#define XFS_SWAPEXT_INODES \
1852 { 0, "target" }, \
1853 { 1, "temp" }
1854
1855#define XFS_INODE_FORMAT_STR \
1856 { 0, "invalid" }, \
1857 { 1, "local" }, \
1858 { 2, "extent" }, \
1859 { 3, "btree" }
1860
1861DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1862 TP_PROTO(struct xfs_inode *ip, int which),
1863 TP_ARGS(ip, which),
1864 TP_STRUCT__entry(
1865 __field(dev_t, dev)
1866 __field(int, which)
1867 __field(xfs_ino_t, ino)
1868 __field(int, format)
1869 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00001870 __field(int, broot_size)
1871 __field(int, fork_off)
1872 ),
1873 TP_fast_assign(
1874 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1875 __entry->which = which;
1876 __entry->ino = ip->i_ino;
1877 __entry->format = ip->i_d.di_format;
1878 __entry->nex = ip->i_d.di_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00001879 __entry->broot_size = ip->i_df.if_broot_bytes;
1880 __entry->fork_off = XFS_IFORK_BOFF(ip);
1881 ),
1882 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00001883 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00001884 MAJOR(__entry->dev), MINOR(__entry->dev),
1885 __entry->ino,
1886 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1887 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1888 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00001889 __entry->broot_size,
1890 __entry->fork_off)
1891)
1892
1893#define DEFINE_SWAPEXT_EVENT(name) \
1894DEFINE_EVENT(xfs_swap_extent_class, name, \
1895 TP_PROTO(struct xfs_inode *ip, int which), \
1896 TP_ARGS(ip, which))
1897
1898DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1899DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1900
Dave Chinner9abbc532010-04-13 15:06:46 +10001901DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001902 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10001903 struct xlog_recover_item *item, int pass),
1904 TP_ARGS(log, trans, item, pass),
1905 TP_STRUCT__entry(
1906 __field(dev_t, dev)
1907 __field(unsigned long, item)
1908 __field(xlog_tid_t, tid)
1909 __field(int, type)
1910 __field(int, pass)
1911 __field(int, count)
1912 __field(int, total)
1913 ),
1914 TP_fast_assign(
1915 __entry->dev = log->l_mp->m_super->s_dev;
1916 __entry->item = (unsigned long)item;
1917 __entry->tid = trans->r_log_tid;
1918 __entry->type = ITEM_TYPE(item);
1919 __entry->pass = pass;
1920 __entry->count = item->ri_cnt;
1921 __entry->total = item->ri_total;
1922 ),
1923 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
1924 "item region count/total %d/%d",
1925 MAJOR(__entry->dev), MINOR(__entry->dev),
1926 __entry->tid,
1927 __entry->pass,
1928 (void *)__entry->item,
1929 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1930 __entry->count,
1931 __entry->total)
1932)
1933
1934#define DEFINE_LOG_RECOVER_ITEM(name) \
1935DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001936 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10001937 struct xlog_recover_item *item, int pass), \
1938 TP_ARGS(log, trans, item, pass))
1939
1940DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
1941DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
1942DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
1943DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
1944DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
1945
1946DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001947 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10001948 TP_ARGS(log, buf_f),
1949 TP_STRUCT__entry(
1950 __field(dev_t, dev)
1951 __field(__int64_t, blkno)
1952 __field(unsigned short, len)
1953 __field(unsigned short, flags)
1954 __field(unsigned short, size)
1955 __field(unsigned int, map_size)
1956 ),
1957 TP_fast_assign(
1958 __entry->dev = log->l_mp->m_super->s_dev;
1959 __entry->blkno = buf_f->blf_blkno;
1960 __entry->len = buf_f->blf_len;
1961 __entry->flags = buf_f->blf_flags;
1962 __entry->size = buf_f->blf_size;
1963 __entry->map_size = buf_f->blf_map_size;
1964 ),
1965 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
1966 "map_size %d",
1967 MAJOR(__entry->dev), MINOR(__entry->dev),
1968 __entry->blkno,
1969 __entry->len,
1970 __entry->flags,
1971 __entry->size,
1972 __entry->map_size)
1973)
1974
1975#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
1976DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001977 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10001978 TP_ARGS(log, buf_f))
1979
1980DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
1981DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
1982DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
1983DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
1984DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
1985DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
1986DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
1987DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
1988
1989DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001990 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10001991 TP_ARGS(log, in_f),
1992 TP_STRUCT__entry(
1993 __field(dev_t, dev)
1994 __field(xfs_ino_t, ino)
1995 __field(unsigned short, size)
1996 __field(int, fields)
1997 __field(unsigned short, asize)
1998 __field(unsigned short, dsize)
1999 __field(__int64_t, blkno)
2000 __field(int, len)
2001 __field(int, boffset)
2002 ),
2003 TP_fast_assign(
2004 __entry->dev = log->l_mp->m_super->s_dev;
2005 __entry->ino = in_f->ilf_ino;
2006 __entry->size = in_f->ilf_size;
2007 __entry->fields = in_f->ilf_fields;
2008 __entry->asize = in_f->ilf_asize;
2009 __entry->dsize = in_f->ilf_dsize;
2010 __entry->blkno = in_f->ilf_blkno;
2011 __entry->len = in_f->ilf_len;
2012 __entry->boffset = in_f->ilf_boffset;
2013 ),
2014 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2015 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2016 MAJOR(__entry->dev), MINOR(__entry->dev),
2017 __entry->ino,
2018 __entry->size,
2019 __entry->fields,
2020 __entry->asize,
2021 __entry->dsize,
2022 __entry->blkno,
2023 __entry->len,
2024 __entry->boffset)
2025)
2026#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2027DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002028 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002029 TP_ARGS(log, in_f))
2030
2031DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2032DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2033DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2034
Christoph Hellwiga46db602011-01-07 13:02:04 +00002035DECLARE_EVENT_CLASS(xfs_discard_class,
2036 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2037 xfs_agblock_t agbno, xfs_extlen_t len),
2038 TP_ARGS(mp, agno, agbno, len),
2039 TP_STRUCT__entry(
2040 __field(dev_t, dev)
2041 __field(xfs_agnumber_t, agno)
2042 __field(xfs_agblock_t, agbno)
2043 __field(xfs_extlen_t, len)
2044 ),
2045 TP_fast_assign(
2046 __entry->dev = mp->m_super->s_dev;
2047 __entry->agno = agno;
2048 __entry->agbno = agbno;
2049 __entry->len = len;
2050 ),
2051 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
2052 MAJOR(__entry->dev), MINOR(__entry->dev),
2053 __entry->agno,
2054 __entry->agbno,
2055 __entry->len)
2056)
2057
2058#define DEFINE_DISCARD_EVENT(name) \
2059DEFINE_EVENT(xfs_discard_class, name, \
2060 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2061 xfs_agblock_t agbno, xfs_extlen_t len), \
2062 TP_ARGS(mp, agno, agbno, len))
2063DEFINE_DISCARD_EVENT(xfs_discard_extent);
2064DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2065DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2066DEFINE_DISCARD_EVENT(xfs_discard_busy);
2067
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00002068#endif /* _TRACE_XFS_H */
2069
2070#undef TRACE_INCLUDE_PATH
2071#define TRACE_INCLUDE_PATH .
2072#define TRACE_INCLUDE_FILE xfs_trace
2073#include <trace/define_trace.h>