blob: 4e0a5773eee497d0bda05fd27eea4d2887a1ec69 [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);
Dave Chinner595bff72014-10-02 09:05:14 +1000352DEFINE_BUF_EVENT(xfs_buf_submit);
353DEFINE_BUF_EVENT(xfs_buf_submit_wait);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000354DEFINE_BUF_EVENT(xfs_buf_bawrite);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000355DEFINE_BUF_EVENT(xfs_buf_lock);
356DEFINE_BUF_EVENT(xfs_buf_lock_done);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200357DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000358DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000359DEFINE_BUF_EVENT(xfs_buf_iowait);
360DEFINE_BUF_EVENT(xfs_buf_iowait_done);
361DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000362DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000363DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Dave Chinner686865f2010-09-24 20:07:47 +1000364DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000365DEFINE_BUF_EVENT(xfs_bdstrat_shut);
366DEFINE_BUF_EVENT(xfs_buf_item_relse);
367DEFINE_BUF_EVENT(xfs_buf_item_iodone);
368DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
369DEFINE_BUF_EVENT(xfs_buf_error_relse);
Dave Chinner9f878322013-01-21 23:53:55 +1100370DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000371DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
372DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
373
374/* not really buffer traces, but the buf provides useful information */
375DEFINE_BUF_EVENT(xfs_btree_corrupt);
376DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
377DEFINE_BUF_EVENT(xfs_reset_dqcounts);
378DEFINE_BUF_EVENT(xfs_inode_item_push);
379
380/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000381DECLARE_EVENT_CLASS(xfs_buf_flags_class,
382 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
383 TP_ARGS(bp, flags, caller_ip),
384 TP_STRUCT__entry(
385 __field(dev_t, dev)
386 __field(xfs_daddr_t, bno)
387 __field(size_t, buffer_length)
388 __field(int, hold)
389 __field(int, pincount)
390 __field(unsigned, lockval)
391 __field(unsigned, flags)
392 __field(unsigned long, caller_ip)
393 ),
394 TP_fast_assign(
395 __entry->dev = bp->b_target->bt_dev;
396 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000397 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000398 __entry->flags = flags;
399 __entry->hold = atomic_read(&bp->b_hold);
400 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200401 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000402 __entry->caller_ip = caller_ip;
403 ),
404 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
405 "lock %d flags %s caller %pf",
406 MAJOR(__entry->dev), MINOR(__entry->dev),
407 (unsigned long long)__entry->bno,
408 __entry->buffer_length,
409 __entry->hold,
410 __entry->pincount,
411 __entry->lockval,
412 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
413 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000414)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000415
416#define DEFINE_BUF_FLAGS_EVENT(name) \
417DEFINE_EVENT(xfs_buf_flags_class, name, \
418 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
419 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000420DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
421DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
422DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
423
424TRACE_EVENT(xfs_buf_ioerror,
425 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
426 TP_ARGS(bp, error, caller_ip),
427 TP_STRUCT__entry(
428 __field(dev_t, dev)
429 __field(xfs_daddr_t, bno)
430 __field(size_t, buffer_length)
431 __field(unsigned, flags)
432 __field(int, hold)
433 __field(int, pincount)
434 __field(unsigned, lockval)
435 __field(int, error)
436 __field(unsigned long, caller_ip)
437 ),
438 TP_fast_assign(
439 __entry->dev = bp->b_target->bt_dev;
440 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000441 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000442 __entry->hold = atomic_read(&bp->b_hold);
443 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200444 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000445 __entry->error = error;
446 __entry->flags = bp->b_flags;
447 __entry->caller_ip = caller_ip;
448 ),
449 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
450 "lock %d error %d flags %s caller %pf",
451 MAJOR(__entry->dev), MINOR(__entry->dev),
452 (unsigned long long)__entry->bno,
453 __entry->buffer_length,
454 __entry->hold,
455 __entry->pincount,
456 __entry->lockval,
457 __entry->error,
458 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
459 (void *)__entry->caller_ip)
460);
461
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000462DECLARE_EVENT_CLASS(xfs_buf_item_class,
463 TP_PROTO(struct xfs_buf_log_item *bip),
464 TP_ARGS(bip),
465 TP_STRUCT__entry(
466 __field(dev_t, dev)
467 __field(xfs_daddr_t, buf_bno)
468 __field(size_t, buf_len)
469 __field(int, buf_hold)
470 __field(int, buf_pincount)
471 __field(int, buf_lockval)
472 __field(unsigned, buf_flags)
473 __field(unsigned, bli_recur)
474 __field(int, bli_refcount)
475 __field(unsigned, bli_flags)
476 __field(void *, li_desc)
477 __field(unsigned, li_flags)
478 ),
479 TP_fast_assign(
480 __entry->dev = bip->bli_buf->b_target->bt_dev;
481 __entry->bli_flags = bip->bli_flags;
482 __entry->bli_recur = bip->bli_recur;
483 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
484 __entry->buf_bno = bip->bli_buf->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000485 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000486 __entry->buf_flags = bip->bli_buf->b_flags;
487 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
488 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200489 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000490 __entry->li_desc = bip->bli_item.li_desc;
491 __entry->li_flags = bip->bli_item.li_flags;
492 ),
493 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
494 "lock %d flags %s recur %d refcount %d bliflags %s "
495 "lidesc 0x%p liflags %s",
496 MAJOR(__entry->dev), MINOR(__entry->dev),
497 (unsigned long long)__entry->buf_bno,
498 __entry->buf_len,
499 __entry->buf_hold,
500 __entry->buf_pincount,
501 __entry->buf_lockval,
502 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
503 __entry->bli_recur,
504 __entry->bli_refcount,
505 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
506 __entry->li_desc,
507 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000508)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000509
510#define DEFINE_BUF_ITEM_EVENT(name) \
511DEFINE_EVENT(xfs_buf_item_class, name, \
512 TP_PROTO(struct xfs_buf_log_item *bip), \
513 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000514DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000515DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000516DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
517DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000518DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000519DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000520DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000521DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
522DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
523DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000524DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
525DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
526DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
527DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
528DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
529DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
530DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
531DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
532DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
533DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
534DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
535DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
536DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
537DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
538DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
539DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000540DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000541
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000542DECLARE_EVENT_CLASS(xfs_filestream_class,
543 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
544 TP_ARGS(ip, agno),
545 TP_STRUCT__entry(
546 __field(dev_t, dev)
547 __field(xfs_ino_t, ino)
548 __field(xfs_agnumber_t, agno)
549 __field(int, streams)
550 ),
551 TP_fast_assign(
552 __entry->dev = VFS_I(ip)->i_sb->s_dev;
553 __entry->ino = ip->i_ino;
554 __entry->agno = agno;
555 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
556 ),
557 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
558 MAJOR(__entry->dev), MINOR(__entry->dev),
559 __entry->ino,
560 __entry->agno,
561 __entry->streams)
562)
563#define DEFINE_FILESTREAM_EVENT(name) \
564DEFINE_EVENT(xfs_filestream_class, name, \
565 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
566 TP_ARGS(ip, agno))
567DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
568DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
569DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
570
571TRACE_EVENT(xfs_filestream_pick,
572 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
573 xfs_extlen_t free, int nscan),
574 TP_ARGS(ip, agno, free, nscan),
575 TP_STRUCT__entry(
576 __field(dev_t, dev)
577 __field(xfs_ino_t, ino)
578 __field(xfs_agnumber_t, agno)
579 __field(int, streams)
580 __field(xfs_extlen_t, free)
581 __field(int, nscan)
582 ),
583 TP_fast_assign(
584 __entry->dev = VFS_I(ip)->i_sb->s_dev;
585 __entry->ino = ip->i_ino;
586 __entry->agno = agno;
587 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
588 __entry->free = free;
589 __entry->nscan = nscan;
590 ),
591 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
592 MAJOR(__entry->dev), MINOR(__entry->dev),
593 __entry->ino,
594 __entry->agno,
595 __entry->streams,
596 __entry->free,
597 __entry->nscan)
598);
599
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000600DECLARE_EVENT_CLASS(xfs_lock_class,
601 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
602 unsigned long caller_ip),
603 TP_ARGS(ip, lock_flags, caller_ip),
604 TP_STRUCT__entry(
605 __field(dev_t, dev)
606 __field(xfs_ino_t, ino)
607 __field(int, lock_flags)
608 __field(unsigned long, caller_ip)
609 ),
610 TP_fast_assign(
611 __entry->dev = VFS_I(ip)->i_sb->s_dev;
612 __entry->ino = ip->i_ino;
613 __entry->lock_flags = lock_flags;
614 __entry->caller_ip = caller_ip;
615 ),
616 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf",
617 MAJOR(__entry->dev), MINOR(__entry->dev),
618 __entry->ino,
619 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
620 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000621)
622
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000623#define DEFINE_LOCK_EVENT(name) \
624DEFINE_EVENT(xfs_lock_class, name, \
625 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
626 unsigned long caller_ip), \
627 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000628DEFINE_LOCK_EVENT(xfs_ilock);
629DEFINE_LOCK_EVENT(xfs_ilock_nowait);
630DEFINE_LOCK_EVENT(xfs_ilock_demote);
631DEFINE_LOCK_EVENT(xfs_iunlock);
632
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000633DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000634 TP_PROTO(struct xfs_inode *ip),
635 TP_ARGS(ip),
636 TP_STRUCT__entry(
637 __field(dev_t, dev)
638 __field(xfs_ino_t, ino)
639 ),
640 TP_fast_assign(
641 __entry->dev = VFS_I(ip)->i_sb->s_dev;
642 __entry->ino = ip->i_ino;
643 ),
644 TP_printk("dev %d:%d ino 0x%llx",
645 MAJOR(__entry->dev), MINOR(__entry->dev),
646 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000647)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000648
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000649#define DEFINE_INODE_EVENT(name) \
650DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000651 TP_PROTO(struct xfs_inode *ip), \
652 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000653DEFINE_INODE_EVENT(xfs_iget_skip);
654DEFINE_INODE_EVENT(xfs_iget_reclaim);
655DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
656DEFINE_INODE_EVENT(xfs_iget_hit);
657DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000658
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000659DEFINE_INODE_EVENT(xfs_getattr);
660DEFINE_INODE_EVENT(xfs_setattr);
661DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500662DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000663DEFINE_INODE_EVENT(xfs_alloc_file_space);
664DEFINE_INODE_EVENT(xfs_free_file_space);
Dave Chinner897b73b2014-04-14 18:15:11 +1000665DEFINE_INODE_EVENT(xfs_zero_file_space);
Namjae Jeone1d8fb82014-02-24 10:58:19 +1100666DEFINE_INODE_EVENT(xfs_collapse_file_space);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000667DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000668#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200669DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000670#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000671DEFINE_INODE_EVENT(xfs_vm_bmap);
672DEFINE_INODE_EVENT(xfs_file_ioctl);
673DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
674DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000675DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000676DEFINE_INODE_EVENT(xfs_file_fsync);
677DEFINE_INODE_EVENT(xfs_destroy_inode);
Al Virob57922d2010-06-07 14:34:48 -0400678DEFINE_INODE_EVENT(xfs_evict_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400679DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000680
681DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
682DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
683
Brian Foster27b52862012-11-06 09:50:38 -0500684DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
685DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500686DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Brian Foster27b52862012-11-06 09:50:38 -0500687
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000688DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000689 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
690 TP_ARGS(ip, caller_ip),
691 TP_STRUCT__entry(
692 __field(dev_t, dev)
693 __field(xfs_ino_t, ino)
694 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100695 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000696 __field(unsigned long, caller_ip)
697 ),
698 TP_fast_assign(
699 __entry->dev = VFS_I(ip)->i_sb->s_dev;
700 __entry->ino = ip->i_ino;
701 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100702 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000703 __entry->caller_ip = caller_ip;
704 ),
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100705 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pf",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000706 MAJOR(__entry->dev), MINOR(__entry->dev),
707 __entry->ino,
708 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100709 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000710 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000711)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000712
Brian Foster19cb7e32013-03-18 10:51:48 -0400713TRACE_EVENT(xfs_iomap_prealloc_size,
714 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
715 unsigned int writeio_blocks),
716 TP_ARGS(ip, blocks, shift, writeio_blocks),
717 TP_STRUCT__entry(
718 __field(dev_t, dev)
719 __field(xfs_ino_t, ino)
720 __field(xfs_fsblock_t, blocks)
721 __field(int, shift)
722 __field(unsigned int, writeio_blocks)
723 ),
724 TP_fast_assign(
725 __entry->dev = VFS_I(ip)->i_sb->s_dev;
726 __entry->ino = ip->i_ino;
727 __entry->blocks = blocks;
728 __entry->shift = shift;
729 __entry->writeio_blocks = writeio_blocks;
730 ),
731 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
732 "m_writeio_blocks %u",
733 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
734 __entry->blocks, __entry->shift, __entry->writeio_blocks)
735)
736
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000737#define DEFINE_IREF_EVENT(name) \
738DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000739 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
740 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000741DEFINE_IREF_EVENT(xfs_ihold);
742DEFINE_IREF_EVENT(xfs_irele);
743DEFINE_IREF_EVENT(xfs_inode_pin);
744DEFINE_IREF_EVENT(xfs_inode_unpin);
745DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100746
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000747DECLARE_EVENT_CLASS(xfs_namespace_class,
748 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
749 TP_ARGS(dp, name),
750 TP_STRUCT__entry(
751 __field(dev_t, dev)
752 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000753 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000754 __dynamic_array(char, name, name->len)
755 ),
756 TP_fast_assign(
757 __entry->dev = VFS_I(dp)->i_sb->s_dev;
758 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000759 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000760 memcpy(__get_str(name), name->name, name->len);
761 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000762 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000763 MAJOR(__entry->dev), MINOR(__entry->dev),
764 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000765 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000766 __get_str(name))
767)
768
769#define DEFINE_NAMESPACE_EVENT(name) \
770DEFINE_EVENT(xfs_namespace_class, name, \
771 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
772 TP_ARGS(dp, name))
773DEFINE_NAMESPACE_EVENT(xfs_remove);
774DEFINE_NAMESPACE_EVENT(xfs_link);
775DEFINE_NAMESPACE_EVENT(xfs_lookup);
776DEFINE_NAMESPACE_EVENT(xfs_create);
777DEFINE_NAMESPACE_EVENT(xfs_symlink);
778
779TRACE_EVENT(xfs_rename,
780 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
781 struct xfs_name *src_name, struct xfs_name *target_name),
782 TP_ARGS(src_dp, target_dp, src_name, target_name),
783 TP_STRUCT__entry(
784 __field(dev_t, dev)
785 __field(xfs_ino_t, src_dp_ino)
786 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000787 __field(int, src_namelen)
788 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000789 __dynamic_array(char, src_name, src_name->len)
790 __dynamic_array(char, target_name, target_name->len)
791 ),
792 TP_fast_assign(
793 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
794 __entry->src_dp_ino = src_dp->i_ino;
795 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000796 __entry->src_namelen = src_name->len;
797 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000798 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000799 memcpy(__get_str(target_name), target_name->name,
800 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000801 ),
802 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000803 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000804 MAJOR(__entry->dev), MINOR(__entry->dev),
805 __entry->src_dp_ino,
806 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000807 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000808 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000809 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000810 __get_str(target_name))
811)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000812
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000813DECLARE_EVENT_CLASS(xfs_dquot_class,
814 TP_PROTO(struct xfs_dquot *dqp),
815 TP_ARGS(dqp),
816 TP_STRUCT__entry(
817 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000818 __field(u32, id)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000819 __field(unsigned, flags)
820 __field(unsigned, nrefs)
821 __field(unsigned long long, res_bcount)
822 __field(unsigned long long, bcount)
823 __field(unsigned long long, icount)
824 __field(unsigned long long, blk_hardlimit)
825 __field(unsigned long long, blk_softlimit)
826 __field(unsigned long long, ino_hardlimit)
827 __field(unsigned long long, ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000828 ), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000829 TP_fast_assign(
830 __entry->dev = dqp->q_mount->m_super->s_dev;
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000831 __entry->id = be32_to_cpu(dqp->q_core.d_id);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000832 __entry->flags = dqp->dq_flags;
833 __entry->nrefs = dqp->q_nrefs;
834 __entry->res_bcount = dqp->q_res_bcount;
835 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
836 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
837 __entry->blk_hardlimit =
838 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
839 __entry->blk_softlimit =
840 be64_to_cpu(dqp->q_core.d_blk_softlimit);
841 __entry->ino_hardlimit =
842 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
843 __entry->ino_softlimit =
844 be64_to_cpu(dqp->q_core.d_ino_softlimit);
845 ),
846 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000847 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
848 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000849 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000850 __entry->id,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000851 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
852 __entry->nrefs,
853 __entry->res_bcount,
854 __entry->bcount,
855 __entry->blk_hardlimit,
856 __entry->blk_softlimit,
857 __entry->icount,
858 __entry->ino_hardlimit,
859 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000860)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000861
862#define DEFINE_DQUOT_EVENT(name) \
863DEFINE_EVENT(xfs_dquot_class, name, \
864 TP_PROTO(struct xfs_dquot *dqp), \
865 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000866DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000867DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
868DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b32012-02-01 13:57:20 +0000869DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
870DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000871DEFINE_DQUOT_EVENT(xfs_dqattach_found);
872DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000873DEFINE_DQUOT_EVENT(xfs_dqalloc);
874DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
875DEFINE_DQUOT_EVENT(xfs_dqread);
876DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000877DEFINE_DQUOT_EVENT(xfs_dqget_hit);
878DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000879DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
880DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000881DEFINE_DQUOT_EVENT(xfs_dqput);
882DEFINE_DQUOT_EVENT(xfs_dqput_wait);
883DEFINE_DQUOT_EVENT(xfs_dqput_free);
884DEFINE_DQUOT_EVENT(xfs_dqrele);
885DEFINE_DQUOT_EVENT(xfs_dqflush);
886DEFINE_DQUOT_EVENT(xfs_dqflush_force);
887DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000888
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000889DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -0500890 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000891 TP_ARGS(log, tic),
892 TP_STRUCT__entry(
893 __field(dev_t, dev)
894 __field(unsigned, trans_type)
895 __field(char, ocnt)
896 __field(char, cnt)
897 __field(int, curr_res)
898 __field(int, unit_res)
899 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +1100900 __field(int, reserveq)
901 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000902 __field(int, grant_reserve_cycle)
903 __field(int, grant_reserve_bytes)
904 __field(int, grant_write_cycle)
905 __field(int, grant_write_bytes)
906 __field(int, curr_cycle)
907 __field(int, curr_block)
908 __field(xfs_lsn_t, tail_lsn)
909 ),
910 TP_fast_assign(
911 __entry->dev = log->l_mp->m_super->s_dev;
912 __entry->trans_type = tic->t_trans_type;
913 __entry->ocnt = tic->t_ocnt;
914 __entry->cnt = tic->t_cnt;
915 __entry->curr_res = tic->t_curr_res;
916 __entry->unit_res = tic->t_unit_res;
917 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +0000918 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
919 __entry->writeq = list_empty(&log->l_write_head.waiters);
920 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100921 &__entry->grant_reserve_cycle,
922 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +0000923 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100924 &__entry->grant_write_cycle,
925 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000926 __entry->curr_cycle = log->l_curr_cycle;
927 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +1100928 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000929 ),
930 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +1100931 "t_unit_res %u t_flags %s reserveq %s "
932 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000933 "grant_reserve_bytes %d grant_write_cycle %d "
934 "grant_write_bytes %d curr_cycle %d curr_block %d "
935 "tail_cycle %d tail_block %d",
936 MAJOR(__entry->dev), MINOR(__entry->dev),
937 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
938 __entry->ocnt,
939 __entry->cnt,
940 __entry->curr_res,
941 __entry->unit_res,
942 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +1100943 __entry->reserveq ? "empty" : "active",
944 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000945 __entry->grant_reserve_cycle,
946 __entry->grant_reserve_bytes,
947 __entry->grant_write_cycle,
948 __entry->grant_write_bytes,
949 __entry->curr_cycle,
950 __entry->curr_block,
951 CYCLE_LSN(__entry->tail_lsn),
952 BLOCK_LSN(__entry->tail_lsn)
953 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000954)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000955
956#define DEFINE_LOGGRANT_EVENT(name) \
957DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -0500958 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000959 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000960DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
961DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000962DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +0000963DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
964DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +1100965DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +0000966DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
967DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
968DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
969DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000970DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
971DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
972DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
973DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
974DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
975DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
976
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000977DECLARE_EVENT_CLASS(xfs_log_item_class,
978 TP_PROTO(struct xfs_log_item *lip),
979 TP_ARGS(lip),
980 TP_STRUCT__entry(
981 __field(dev_t, dev)
982 __field(void *, lip)
983 __field(uint, type)
984 __field(uint, flags)
985 __field(xfs_lsn_t, lsn)
986 ),
987 TP_fast_assign(
988 __entry->dev = lip->li_mountp->m_super->s_dev;
989 __entry->lip = lip;
990 __entry->type = lip->li_type;
991 __entry->flags = lip->li_flags;
992 __entry->lsn = lip->li_lsn;
993 ),
994 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
995 MAJOR(__entry->dev), MINOR(__entry->dev),
996 __entry->lip,
997 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
998 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
999 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1000)
1001
Dave Chinner14c26c62012-04-24 16:33:31 +10001002TRACE_EVENT(xfs_log_force,
1003 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn),
1004 TP_ARGS(mp, lsn),
1005 TP_STRUCT__entry(
1006 __field(dev_t, dev)
1007 __field(xfs_lsn_t, lsn)
1008 ),
1009 TP_fast_assign(
1010 __entry->dev = mp->m_super->s_dev;
1011 __entry->lsn = lsn;
1012 ),
1013 TP_printk("dev %d:%d lsn 0x%llx",
1014 MAJOR(__entry->dev), MINOR(__entry->dev),
1015 __entry->lsn)
1016)
1017
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001018#define DEFINE_LOG_ITEM_EVENT(name) \
1019DEFINE_EVENT(xfs_log_item_class, name, \
1020 TP_PROTO(struct xfs_log_item *lip), \
1021 TP_ARGS(lip))
1022DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001023DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1024DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +10001025DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001026
Dave Chinner750b9c92013-11-01 15:27:18 +11001027DECLARE_EVENT_CLASS(xfs_ail_class,
1028 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1029 TP_ARGS(lip, old_lsn, new_lsn),
1030 TP_STRUCT__entry(
1031 __field(dev_t, dev)
1032 __field(void *, lip)
1033 __field(uint, type)
1034 __field(uint, flags)
1035 __field(xfs_lsn_t, old_lsn)
1036 __field(xfs_lsn_t, new_lsn)
1037 ),
1038 TP_fast_assign(
1039 __entry->dev = lip->li_mountp->m_super->s_dev;
1040 __entry->lip = lip;
1041 __entry->type = lip->li_type;
1042 __entry->flags = lip->li_flags;
1043 __entry->old_lsn = old_lsn;
1044 __entry->new_lsn = new_lsn;
1045 ),
1046 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
1047 MAJOR(__entry->dev), MINOR(__entry->dev),
1048 __entry->lip,
1049 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1050 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1051 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1052 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1053)
1054
1055#define DEFINE_AIL_EVENT(name) \
1056DEFINE_EVENT(xfs_ail_class, name, \
1057 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1058 TP_ARGS(lip, old_lsn, new_lsn))
1059DEFINE_AIL_EVENT(xfs_ail_insert);
1060DEFINE_AIL_EVENT(xfs_ail_move);
1061DEFINE_AIL_EVENT(xfs_ail_delete);
1062
1063TRACE_EVENT(xfs_log_assign_tail_lsn,
1064 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1065 TP_ARGS(log, new_lsn),
1066 TP_STRUCT__entry(
1067 __field(dev_t, dev)
1068 __field(xfs_lsn_t, new_lsn)
1069 __field(xfs_lsn_t, old_lsn)
1070 __field(xfs_lsn_t, last_sync_lsn)
1071 ),
1072 TP_fast_assign(
1073 __entry->dev = log->l_mp->m_super->s_dev;
1074 __entry->new_lsn = new_lsn;
1075 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1076 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1077 ),
1078 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1079 MAJOR(__entry->dev), MINOR(__entry->dev),
1080 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1081 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1082 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1083)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001084
Li Zefanf8adb4d2010-05-24 08:25:57 +00001085DECLARE_EVENT_CLASS(xfs_file_class,
1086 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags),
1087 TP_ARGS(ip, count, offset, flags),
1088 TP_STRUCT__entry(
1089 __field(dev_t, dev)
1090 __field(xfs_ino_t, ino)
1091 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001092 __field(loff_t, offset)
1093 __field(size_t, count)
1094 __field(int, flags)
1095 ),
1096 TP_fast_assign(
1097 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1098 __entry->ino = ip->i_ino;
1099 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001100 __entry->offset = offset;
1101 __entry->count = count;
1102 __entry->flags = flags;
1103 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001104 TP_printk("dev %d:%d ino 0x%llx size 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001105 "offset 0x%llx count 0x%zx ioflags %s",
1106 MAJOR(__entry->dev), MINOR(__entry->dev),
1107 __entry->ino,
1108 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001109 __entry->offset,
1110 __entry->count,
1111 __print_flags(__entry->flags, "|", XFS_IO_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001112)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001113
1114#define DEFINE_RW_EVENT(name) \
1115DEFINE_EVENT(xfs_file_class, name, \
1116 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
1117 TP_ARGS(ip, count, offset, flags))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001118DEFINE_RW_EVENT(xfs_file_read);
1119DEFINE_RW_EVENT(xfs_file_buffered_write);
1120DEFINE_RW_EVENT(xfs_file_direct_write);
1121DEFINE_RW_EVENT(xfs_file_splice_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001122
Li Zefanf8adb4d2010-05-24 08:25:57 +00001123DECLARE_EVENT_CLASS(xfs_page_class,
Lukas Czerner34097df2013-05-21 23:58:01 -04001124 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1125 unsigned int len),
1126 TP_ARGS(inode, page, off, len),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001127 TP_STRUCT__entry(
1128 __field(dev_t, dev)
1129 __field(xfs_ino_t, ino)
1130 __field(pgoff_t, pgoff)
1131 __field(loff_t, size)
1132 __field(unsigned long, offset)
Lukas Czerner34097df2013-05-21 23:58:01 -04001133 __field(unsigned int, length)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001134 __field(int, delalloc)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001135 __field(int, unwritten)
1136 ),
1137 TP_fast_assign(
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001138 int delalloc = -1, unwritten = -1;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001139
Li Zefanf8adb4d2010-05-24 08:25:57 +00001140 if (page_has_buffers(page))
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001141 xfs_count_page_state(page, &delalloc, &unwritten);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001142 __entry->dev = inode->i_sb->s_dev;
1143 __entry->ino = XFS_I(inode)->i_ino;
1144 __entry->pgoff = page_offset(page);
1145 __entry->size = i_size_read(inode);
1146 __entry->offset = off;
Lukas Czerner34097df2013-05-21 23:58:01 -04001147 __entry->length = len;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001148 __entry->delalloc = delalloc;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001149 __entry->unwritten = unwritten;
1150 ),
1151 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
Lukas Czerner34097df2013-05-21 23:58:01 -04001152 "length %x delalloc %d unwritten %d",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001153 MAJOR(__entry->dev), MINOR(__entry->dev),
1154 __entry->ino,
1155 __entry->pgoff,
1156 __entry->size,
1157 __entry->offset,
Lukas Czerner34097df2013-05-21 23:58:01 -04001158 __entry->length,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001159 __entry->delalloc,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001160 __entry->unwritten)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001161)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001162
1163#define DEFINE_PAGE_EVENT(name) \
1164DEFINE_EVENT(xfs_page_class, name, \
Lukas Czerner34097df2013-05-21 23:58:01 -04001165 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1166 unsigned int len), \
1167 TP_ARGS(inode, page, off, len))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001168DEFINE_PAGE_EVENT(xfs_writepage);
1169DEFINE_PAGE_EVENT(xfs_releasepage);
1170DEFINE_PAGE_EVENT(xfs_invalidatepage);
1171
Christoph Hellwiga206c812010-12-10 08:42:20 +00001172DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001173 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001174 int type, struct xfs_bmbt_irec *irec),
1175 TP_ARGS(ip, offset, count, type, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001176 TP_STRUCT__entry(
1177 __field(dev_t, dev)
1178 __field(xfs_ino_t, ino)
1179 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001180 __field(loff_t, offset)
1181 __field(size_t, count)
Christoph Hellwiga206c812010-12-10 08:42:20 +00001182 __field(int, type)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001183 __field(xfs_fileoff_t, startoff)
1184 __field(xfs_fsblock_t, startblock)
1185 __field(xfs_filblks_t, blockcount)
1186 ),
1187 TP_fast_assign(
1188 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1189 __entry->ino = ip->i_ino;
1190 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001191 __entry->offset = offset;
1192 __entry->count = count;
Christoph Hellwiga206c812010-12-10 08:42:20 +00001193 __entry->type = type;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001194 __entry->startoff = irec ? irec->br_startoff : 0;
1195 __entry->startblock = irec ? irec->br_startblock : 0;
1196 __entry->blockcount = irec ? irec->br_blockcount : 0;
1197 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001198 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1199 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001200 MAJOR(__entry->dev), MINOR(__entry->dev),
1201 __entry->ino,
1202 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001203 __entry->offset,
1204 __entry->count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001205 __print_symbolic(__entry->type, XFS_IO_TYPES),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001206 __entry->startoff,
1207 (__int64_t)__entry->startblock,
1208 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001209)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001210
1211#define DEFINE_IOMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001212DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001213 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001214 int type, struct xfs_bmbt_irec *irec), \
1215 TP_ARGS(ip, offset, count, type, irec))
1216DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1217DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1218DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1219DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
Dave Chinnerd5cc2e32015-04-16 21:59:07 +10001220DEFINE_IOMAP_EVENT(xfs_gbmap_direct);
1221DEFINE_IOMAP_EVENT(xfs_gbmap_direct_new);
1222DEFINE_IOMAP_EVENT(xfs_gbmap_direct_update);
Dave Chinnera06c2772015-04-16 22:00:00 +10001223DEFINE_IOMAP_EVENT(xfs_gbmap_direct_none);
Dave Chinner6dfa1b62015-04-16 21:59:34 +10001224DEFINE_IOMAP_EVENT(xfs_gbmap_direct_endio);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001225
Li Zefanf8adb4d2010-05-24 08:25:57 +00001226DECLARE_EVENT_CLASS(xfs_simple_io_class,
1227 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1228 TP_ARGS(ip, offset, count),
1229 TP_STRUCT__entry(
1230 __field(dev_t, dev)
1231 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001232 __field(loff_t, isize)
1233 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001234 __field(loff_t, offset)
1235 __field(size_t, count)
1236 ),
1237 TP_fast_assign(
1238 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1239 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001240 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001241 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001242 __entry->offset = offset;
1243 __entry->count = count;
1244 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001245 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001246 "offset 0x%llx count %zd",
1247 MAJOR(__entry->dev), MINOR(__entry->dev),
1248 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001249 __entry->isize,
1250 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001251 __entry->offset,
1252 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001253);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001254
1255#define DEFINE_SIMPLE_IO_EVENT(name) \
1256DEFINE_EVENT(xfs_simple_io_class, name, \
1257 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1258 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001259DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1260DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Christoph Hellwiga206c812010-12-10 08:42:20 +00001261DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001262DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001263
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001264DECLARE_EVENT_CLASS(xfs_itrunc_class,
1265 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1266 TP_ARGS(ip, new_size),
1267 TP_STRUCT__entry(
1268 __field(dev_t, dev)
1269 __field(xfs_ino_t, ino)
1270 __field(xfs_fsize_t, size)
1271 __field(xfs_fsize_t, new_size)
1272 ),
1273 TP_fast_assign(
1274 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1275 __entry->ino = ip->i_ino;
1276 __entry->size = ip->i_d.di_size;
1277 __entry->new_size = new_size;
1278 ),
1279 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1280 MAJOR(__entry->dev), MINOR(__entry->dev),
1281 __entry->ino,
1282 __entry->size,
1283 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001284)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001285
1286#define DEFINE_ITRUNC_EVENT(name) \
1287DEFINE_EVENT(xfs_itrunc_class, name, \
1288 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1289 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001290DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1291DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001292
1293TRACE_EVENT(xfs_pagecache_inval,
1294 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1295 TP_ARGS(ip, start, finish),
1296 TP_STRUCT__entry(
1297 __field(dev_t, dev)
1298 __field(xfs_ino_t, ino)
1299 __field(xfs_fsize_t, size)
1300 __field(xfs_off_t, start)
1301 __field(xfs_off_t, finish)
1302 ),
1303 TP_fast_assign(
1304 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1305 __entry->ino = ip->i_ino;
1306 __entry->size = ip->i_d.di_size;
1307 __entry->start = start;
1308 __entry->finish = finish;
1309 ),
1310 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1311 MAJOR(__entry->dev), MINOR(__entry->dev),
1312 __entry->ino,
1313 __entry->size,
1314 __entry->start,
1315 __entry->finish)
1316);
1317
1318TRACE_EVENT(xfs_bunmap,
1319 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1320 int flags, unsigned long caller_ip),
1321 TP_ARGS(ip, bno, len, flags, caller_ip),
1322 TP_STRUCT__entry(
1323 __field(dev_t, dev)
1324 __field(xfs_ino_t, ino)
1325 __field(xfs_fsize_t, size)
1326 __field(xfs_fileoff_t, bno)
1327 __field(xfs_filblks_t, len)
1328 __field(unsigned long, caller_ip)
1329 __field(int, flags)
1330 ),
1331 TP_fast_assign(
1332 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1333 __entry->ino = ip->i_ino;
1334 __entry->size = ip->i_d.di_size;
1335 __entry->bno = bno;
1336 __entry->len = len;
1337 __entry->caller_ip = caller_ip;
1338 __entry->flags = flags;
1339 ),
1340 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1341 "flags %s caller %pf",
1342 MAJOR(__entry->dev), MINOR(__entry->dev),
1343 __entry->ino,
1344 __entry->size,
1345 __entry->bno,
1346 __entry->len,
1347 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1348 (void *)__entry->caller_ip)
1349
1350);
1351
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001352DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001353 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1354 xfs_agblock_t agbno, xfs_extlen_t len),
1355 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001356 TP_STRUCT__entry(
1357 __field(dev_t, dev)
1358 __field(xfs_agnumber_t, agno)
1359 __field(xfs_agblock_t, agbno)
1360 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001361 ),
1362 TP_fast_assign(
1363 __entry->dev = mp->m_super->s_dev;
1364 __entry->agno = agno;
1365 __entry->agbno = agbno;
1366 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001367 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001368 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001369 MAJOR(__entry->dev), MINOR(__entry->dev),
1370 __entry->agno,
1371 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001372 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001373);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001374#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001375DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001376 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1377 xfs_agblock_t agbno, xfs_extlen_t len), \
1378 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001379DEFINE_BUSY_EVENT(xfs_extent_busy);
1380DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1381DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1382DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1383DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001384
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001385TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001386 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1387 xfs_agblock_t agbno, xfs_extlen_t len,
1388 xfs_agblock_t tbno, xfs_extlen_t tlen),
1389 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1390 TP_STRUCT__entry(
1391 __field(dev_t, dev)
1392 __field(xfs_agnumber_t, agno)
1393 __field(xfs_agblock_t, agbno)
1394 __field(xfs_extlen_t, len)
1395 __field(xfs_agblock_t, tbno)
1396 __field(xfs_extlen_t, tlen)
1397 ),
1398 TP_fast_assign(
1399 __entry->dev = mp->m_super->s_dev;
1400 __entry->agno = agno;
1401 __entry->agbno = agbno;
1402 __entry->len = len;
1403 __entry->tbno = tbno;
1404 __entry->tlen = tlen;
1405 ),
1406 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1407 MAJOR(__entry->dev), MINOR(__entry->dev),
1408 __entry->agno,
1409 __entry->agbno,
1410 __entry->len,
1411 __entry->tbno,
1412 __entry->tlen)
1413);
1414
Dave Chinnered3b4d62010-05-21 12:07:08 +10001415TRACE_EVENT(xfs_trans_commit_lsn,
1416 TP_PROTO(struct xfs_trans *trans),
1417 TP_ARGS(trans),
1418 TP_STRUCT__entry(
1419 __field(dev_t, dev)
1420 __field(struct xfs_trans *, tp)
1421 __field(xfs_lsn_t, lsn)
1422 ),
1423 TP_fast_assign(
1424 __entry->dev = trans->t_mountp->m_super->s_dev;
1425 __entry->tp = trans;
1426 __entry->lsn = trans->t_commit_lsn;
1427 ),
1428 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1429 MAJOR(__entry->dev), MINOR(__entry->dev),
1430 __entry->tp,
Dave Chinnerfd45e4782010-01-02 02:38:56 +00001431 __entry->lsn)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001432);
1433
1434TRACE_EVENT(xfs_agf,
1435 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1436 unsigned long caller_ip),
1437 TP_ARGS(mp, agf, flags, caller_ip),
1438 TP_STRUCT__entry(
1439 __field(dev_t, dev)
1440 __field(xfs_agnumber_t, agno)
1441 __field(int, flags)
1442 __field(__u32, length)
1443 __field(__u32, bno_root)
1444 __field(__u32, cnt_root)
1445 __field(__u32, bno_level)
1446 __field(__u32, cnt_level)
1447 __field(__u32, flfirst)
1448 __field(__u32, fllast)
1449 __field(__u32, flcount)
1450 __field(__u32, freeblks)
1451 __field(__u32, longest)
1452 __field(unsigned long, caller_ip)
1453 ),
1454 TP_fast_assign(
1455 __entry->dev = mp->m_super->s_dev;
1456 __entry->agno = be32_to_cpu(agf->agf_seqno),
1457 __entry->flags = flags;
1458 __entry->length = be32_to_cpu(agf->agf_length),
1459 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1460 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1461 __entry->bno_level =
1462 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1463 __entry->cnt_level =
1464 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1465 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1466 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1467 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1468 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1469 __entry->longest = be32_to_cpu(agf->agf_longest);
1470 __entry->caller_ip = caller_ip;
1471 ),
1472 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1473 "levels b %u c %u flfirst %u fllast %u flcount %u "
1474 "freeblks %u longest %u caller %pf",
1475 MAJOR(__entry->dev), MINOR(__entry->dev),
1476 __entry->agno,
1477 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1478 __entry->length,
1479 __entry->bno_root,
1480 __entry->cnt_root,
1481 __entry->bno_level,
1482 __entry->cnt_level,
1483 __entry->flfirst,
1484 __entry->fllast,
1485 __entry->flcount,
1486 __entry->freeblks,
1487 __entry->longest,
1488 (void *)__entry->caller_ip)
1489);
1490
1491TRACE_EVENT(xfs_free_extent,
1492 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1493 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1494 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1495 TP_STRUCT__entry(
1496 __field(dev_t, dev)
1497 __field(xfs_agnumber_t, agno)
1498 __field(xfs_agblock_t, agbno)
1499 __field(xfs_extlen_t, len)
1500 __field(int, isfl)
1501 __field(int, haveleft)
1502 __field(int, haveright)
1503 ),
1504 TP_fast_assign(
1505 __entry->dev = mp->m_super->s_dev;
1506 __entry->agno = agno;
1507 __entry->agbno = agbno;
1508 __entry->len = len;
1509 __entry->isfl = isfl;
1510 __entry->haveleft = haveleft;
1511 __entry->haveright = haveright;
1512 ),
1513 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1514 MAJOR(__entry->dev), MINOR(__entry->dev),
1515 __entry->agno,
1516 __entry->agbno,
1517 __entry->len,
1518 __entry->isfl,
1519 __entry->haveleft ?
1520 (__entry->haveright ? "both" : "left") :
1521 (__entry->haveright ? "right" : "none"))
1522
1523);
1524
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001525DECLARE_EVENT_CLASS(xfs_alloc_class,
1526 TP_PROTO(struct xfs_alloc_arg *args),
1527 TP_ARGS(args),
1528 TP_STRUCT__entry(
1529 __field(dev_t, dev)
1530 __field(xfs_agnumber_t, agno)
1531 __field(xfs_agblock_t, agbno)
1532 __field(xfs_extlen_t, minlen)
1533 __field(xfs_extlen_t, maxlen)
1534 __field(xfs_extlen_t, mod)
1535 __field(xfs_extlen_t, prod)
1536 __field(xfs_extlen_t, minleft)
1537 __field(xfs_extlen_t, total)
1538 __field(xfs_extlen_t, alignment)
1539 __field(xfs_extlen_t, minalignslop)
1540 __field(xfs_extlen_t, len)
1541 __field(short, type)
1542 __field(short, otype)
1543 __field(char, wasdel)
1544 __field(char, wasfromfl)
1545 __field(char, isfl)
1546 __field(char, userdata)
1547 __field(xfs_fsblock_t, firstblock)
1548 ),
1549 TP_fast_assign(
1550 __entry->dev = args->mp->m_super->s_dev;
1551 __entry->agno = args->agno;
1552 __entry->agbno = args->agbno;
1553 __entry->minlen = args->minlen;
1554 __entry->maxlen = args->maxlen;
1555 __entry->mod = args->mod;
1556 __entry->prod = args->prod;
1557 __entry->minleft = args->minleft;
1558 __entry->total = args->total;
1559 __entry->alignment = args->alignment;
1560 __entry->minalignslop = args->minalignslop;
1561 __entry->len = args->len;
1562 __entry->type = args->type;
1563 __entry->otype = args->otype;
1564 __entry->wasdel = args->wasdel;
1565 __entry->wasfromfl = args->wasfromfl;
1566 __entry->isfl = args->isfl;
1567 __entry->userdata = args->userdata;
1568 __entry->firstblock = args->firstblock;
1569 ),
1570 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1571 "prod %u minleft %u total %u alignment %u minalignslop %u "
1572 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1573 "userdata %d firstblock 0x%llx",
1574 MAJOR(__entry->dev), MINOR(__entry->dev),
1575 __entry->agno,
1576 __entry->agbno,
1577 __entry->minlen,
1578 __entry->maxlen,
1579 __entry->mod,
1580 __entry->prod,
1581 __entry->minleft,
1582 __entry->total,
1583 __entry->alignment,
1584 __entry->minalignslop,
1585 __entry->len,
1586 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1587 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1588 __entry->wasdel,
1589 __entry->wasfromfl,
1590 __entry->isfl,
1591 __entry->userdata,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001592 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001593)
1594
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001595#define DEFINE_ALLOC_EVENT(name) \
1596DEFINE_EVENT(xfs_alloc_class, name, \
1597 TP_PROTO(struct xfs_alloc_arg *args), \
1598 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001599DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001600DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001601DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1602DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1603DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1604DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1605DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1606DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001607DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1608DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001609DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1610DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1611DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1612DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1613DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001614DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001615DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1616DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1617DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1618DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1619DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1620DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1621DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1622DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1623DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1624
Dave Chinner5a5881c2012-03-22 05:15:13 +00001625DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001626 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(xfs_dahash_t, hashval)
1634 __field(xfs_ino_t, inumber)
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->hashval = args->hashval;
1644 __entry->inumber = args->inumber;
1645 __entry->op_flags = args->op_flags;
1646 ),
1647 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1648 "inumber 0x%llx 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->hashval,
1655 __entry->inumber,
1656 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001657)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001658
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001659#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001660DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001661 TP_PROTO(struct xfs_da_args *args), \
1662 TP_ARGS(args))
1663DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1664DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1665DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1666DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1667DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1668DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1669DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1670DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1671DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1672DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1673DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1674DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1675DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1676DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1677DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1678DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1679DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1680DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1681DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1682DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1683DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1684DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1685DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1686DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1687DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1688
Dave Chinneree732592012-11-12 22:53:53 +11001689DECLARE_EVENT_CLASS(xfs_attr_class,
1690 TP_PROTO(struct xfs_da_args *args),
1691 TP_ARGS(args),
1692 TP_STRUCT__entry(
1693 __field(dev_t, dev)
1694 __field(xfs_ino_t, ino)
1695 __dynamic_array(char, name, args->namelen)
1696 __field(int, namelen)
1697 __field(int, valuelen)
1698 __field(xfs_dahash_t, hashval)
1699 __field(int, op_flags)
1700 ),
1701 TP_fast_assign(
1702 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1703 __entry->ino = args->dp->i_ino;
1704 if (args->namelen)
1705 memcpy(__get_str(name), args->name, args->namelen);
1706 __entry->namelen = args->namelen;
1707 __entry->valuelen = args->valuelen;
1708 __entry->hashval = args->hashval;
1709 __entry->op_flags = args->op_flags;
1710 ),
1711 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1712 "hashval 0x%x op_flags %s",
1713 MAJOR(__entry->dev), MINOR(__entry->dev),
1714 __entry->ino,
1715 __entry->namelen,
1716 __entry->namelen ? __get_str(name) : NULL,
1717 __entry->namelen,
1718 __entry->valuelen,
1719 __entry->hashval,
1720 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1721)
1722
Dave Chinner5a5881c2012-03-22 05:15:13 +00001723#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11001724DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001725 TP_PROTO(struct xfs_da_args *args), \
1726 TP_ARGS(args))
1727DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1728DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1729DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1730DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1731DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1732DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
1733DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1734
1735DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1736DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1737DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11001738DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001739DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1740DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11001741DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1742DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001743DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1744DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11001745DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001746DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1747DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1748DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1749DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1750DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1751DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1752DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1753DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1754DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1755DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1756DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001757DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001758
1759DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11001760DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001761DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
1762DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1763DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1764
Dave Chinneree732592012-11-12 22:53:53 +11001765DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1766DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1767
1768DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1769DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1770DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1771
Dave Chinner5a5881c2012-03-22 05:15:13 +00001772#define DEFINE_DA_EVENT(name) \
1773DEFINE_EVENT(xfs_da_class, name, \
1774 TP_PROTO(struct xfs_da_args *args), \
1775 TP_ARGS(args))
1776DEFINE_DA_EVENT(xfs_da_split);
1777DEFINE_DA_EVENT(xfs_da_join);
1778DEFINE_DA_EVENT(xfs_da_link_before);
1779DEFINE_DA_EVENT(xfs_da_link_after);
1780DEFINE_DA_EVENT(xfs_da_unlink_back);
1781DEFINE_DA_EVENT(xfs_da_unlink_forward);
1782DEFINE_DA_EVENT(xfs_da_root_split);
1783DEFINE_DA_EVENT(xfs_da_root_join);
1784DEFINE_DA_EVENT(xfs_da_node_add);
1785DEFINE_DA_EVENT(xfs_da_node_create);
1786DEFINE_DA_EVENT(xfs_da_node_split);
1787DEFINE_DA_EVENT(xfs_da_node_remove);
1788DEFINE_DA_EVENT(xfs_da_node_rebalance);
1789DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001790DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001791DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1792DEFINE_DA_EVENT(xfs_da_grow_inode);
1793DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11001794DEFINE_DA_EVENT(xfs_da_fixhashpath);
1795DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001796
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001797DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1798 TP_PROTO(struct xfs_da_args *args, int idx),
1799 TP_ARGS(args, idx),
1800 TP_STRUCT__entry(
1801 __field(dev_t, dev)
1802 __field(xfs_ino_t, ino)
1803 __field(int, op_flags)
1804 __field(int, idx)
1805 ),
1806 TP_fast_assign(
1807 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1808 __entry->ino = args->dp->i_ino;
1809 __entry->op_flags = args->op_flags;
1810 __entry->idx = idx;
1811 ),
1812 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1813 MAJOR(__entry->dev), MINOR(__entry->dev),
1814 __entry->ino,
1815 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1816 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001817)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001818
1819#define DEFINE_DIR2_SPACE_EVENT(name) \
1820DEFINE_EVENT(xfs_dir2_space_class, name, \
1821 TP_PROTO(struct xfs_da_args *args, int idx), \
1822 TP_ARGS(args, idx))
1823DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1824DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1825DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1826DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001827
1828TRACE_EVENT(xfs_dir2_leafn_moveents,
1829 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1830 TP_ARGS(args, src_idx, dst_idx, count),
1831 TP_STRUCT__entry(
1832 __field(dev_t, dev)
1833 __field(xfs_ino_t, ino)
1834 __field(int, op_flags)
1835 __field(int, src_idx)
1836 __field(int, dst_idx)
1837 __field(int, count)
1838 ),
1839 TP_fast_assign(
1840 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1841 __entry->ino = args->dp->i_ino;
1842 __entry->op_flags = args->op_flags;
1843 __entry->src_idx = src_idx;
1844 __entry->dst_idx = dst_idx;
1845 __entry->count = count;
1846 ),
1847 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1848 "src_idx %d dst_idx %d count %d",
1849 MAJOR(__entry->dev), MINOR(__entry->dev),
1850 __entry->ino,
1851 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1852 __entry->src_idx,
1853 __entry->dst_idx,
1854 __entry->count)
1855);
1856
Dave Chinner3a85cd92010-01-14 01:33:55 +00001857#define XFS_SWAPEXT_INODES \
1858 { 0, "target" }, \
1859 { 1, "temp" }
1860
1861#define XFS_INODE_FORMAT_STR \
1862 { 0, "invalid" }, \
1863 { 1, "local" }, \
1864 { 2, "extent" }, \
1865 { 3, "btree" }
1866
1867DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1868 TP_PROTO(struct xfs_inode *ip, int which),
1869 TP_ARGS(ip, which),
1870 TP_STRUCT__entry(
1871 __field(dev_t, dev)
1872 __field(int, which)
1873 __field(xfs_ino_t, ino)
1874 __field(int, format)
1875 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00001876 __field(int, broot_size)
1877 __field(int, fork_off)
1878 ),
1879 TP_fast_assign(
1880 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1881 __entry->which = which;
1882 __entry->ino = ip->i_ino;
1883 __entry->format = ip->i_d.di_format;
1884 __entry->nex = ip->i_d.di_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00001885 __entry->broot_size = ip->i_df.if_broot_bytes;
1886 __entry->fork_off = XFS_IFORK_BOFF(ip);
1887 ),
1888 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00001889 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00001890 MAJOR(__entry->dev), MINOR(__entry->dev),
1891 __entry->ino,
1892 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1893 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1894 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00001895 __entry->broot_size,
1896 __entry->fork_off)
1897)
1898
1899#define DEFINE_SWAPEXT_EVENT(name) \
1900DEFINE_EVENT(xfs_swap_extent_class, name, \
1901 TP_PROTO(struct xfs_inode *ip, int which), \
1902 TP_ARGS(ip, which))
1903
1904DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1905DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1906
Dave Chinner9abbc532010-04-13 15:06:46 +10001907DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001908 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10001909 struct xlog_recover_item *item, int pass),
1910 TP_ARGS(log, trans, item, pass),
1911 TP_STRUCT__entry(
1912 __field(dev_t, dev)
1913 __field(unsigned long, item)
1914 __field(xlog_tid_t, tid)
1915 __field(int, type)
1916 __field(int, pass)
1917 __field(int, count)
1918 __field(int, total)
1919 ),
1920 TP_fast_assign(
1921 __entry->dev = log->l_mp->m_super->s_dev;
1922 __entry->item = (unsigned long)item;
1923 __entry->tid = trans->r_log_tid;
1924 __entry->type = ITEM_TYPE(item);
1925 __entry->pass = pass;
1926 __entry->count = item->ri_cnt;
1927 __entry->total = item->ri_total;
1928 ),
1929 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
1930 "item region count/total %d/%d",
1931 MAJOR(__entry->dev), MINOR(__entry->dev),
1932 __entry->tid,
1933 __entry->pass,
1934 (void *)__entry->item,
1935 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1936 __entry->count,
1937 __entry->total)
1938)
1939
1940#define DEFINE_LOG_RECOVER_ITEM(name) \
1941DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001942 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10001943 struct xlog_recover_item *item, int pass), \
1944 TP_ARGS(log, trans, item, pass))
1945
1946DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
1947DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
1948DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
1949DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
1950DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
1951
1952DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001953 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10001954 TP_ARGS(log, buf_f),
1955 TP_STRUCT__entry(
1956 __field(dev_t, dev)
1957 __field(__int64_t, blkno)
1958 __field(unsigned short, len)
1959 __field(unsigned short, flags)
1960 __field(unsigned short, size)
1961 __field(unsigned int, map_size)
1962 ),
1963 TP_fast_assign(
1964 __entry->dev = log->l_mp->m_super->s_dev;
1965 __entry->blkno = buf_f->blf_blkno;
1966 __entry->len = buf_f->blf_len;
1967 __entry->flags = buf_f->blf_flags;
1968 __entry->size = buf_f->blf_size;
1969 __entry->map_size = buf_f->blf_map_size;
1970 ),
1971 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
1972 "map_size %d",
1973 MAJOR(__entry->dev), MINOR(__entry->dev),
1974 __entry->blkno,
1975 __entry->len,
1976 __entry->flags,
1977 __entry->size,
1978 __entry->map_size)
1979)
1980
1981#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
1982DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001983 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10001984 TP_ARGS(log, buf_f))
1985
1986DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
1987DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
1988DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
1989DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
1990DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
1991DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
1992DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
1993DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
1994
1995DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001996 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10001997 TP_ARGS(log, in_f),
1998 TP_STRUCT__entry(
1999 __field(dev_t, dev)
2000 __field(xfs_ino_t, ino)
2001 __field(unsigned short, size)
2002 __field(int, fields)
2003 __field(unsigned short, asize)
2004 __field(unsigned short, dsize)
2005 __field(__int64_t, blkno)
2006 __field(int, len)
2007 __field(int, boffset)
2008 ),
2009 TP_fast_assign(
2010 __entry->dev = log->l_mp->m_super->s_dev;
2011 __entry->ino = in_f->ilf_ino;
2012 __entry->size = in_f->ilf_size;
2013 __entry->fields = in_f->ilf_fields;
2014 __entry->asize = in_f->ilf_asize;
2015 __entry->dsize = in_f->ilf_dsize;
2016 __entry->blkno = in_f->ilf_blkno;
2017 __entry->len = in_f->ilf_len;
2018 __entry->boffset = in_f->ilf_boffset;
2019 ),
2020 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2021 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2022 MAJOR(__entry->dev), MINOR(__entry->dev),
2023 __entry->ino,
2024 __entry->size,
2025 __entry->fields,
2026 __entry->asize,
2027 __entry->dsize,
2028 __entry->blkno,
2029 __entry->len,
2030 __entry->boffset)
2031)
2032#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2033DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002034 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002035 TP_ARGS(log, in_f))
2036
2037DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2038DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2039DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2040
Christoph Hellwiga46db602011-01-07 13:02:04 +00002041DECLARE_EVENT_CLASS(xfs_discard_class,
2042 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2043 xfs_agblock_t agbno, xfs_extlen_t len),
2044 TP_ARGS(mp, agno, agbno, len),
2045 TP_STRUCT__entry(
2046 __field(dev_t, dev)
2047 __field(xfs_agnumber_t, agno)
2048 __field(xfs_agblock_t, agbno)
2049 __field(xfs_extlen_t, len)
2050 ),
2051 TP_fast_assign(
2052 __entry->dev = mp->m_super->s_dev;
2053 __entry->agno = agno;
2054 __entry->agbno = agbno;
2055 __entry->len = len;
2056 ),
2057 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
2058 MAJOR(__entry->dev), MINOR(__entry->dev),
2059 __entry->agno,
2060 __entry->agbno,
2061 __entry->len)
2062)
2063
2064#define DEFINE_DISCARD_EVENT(name) \
2065DEFINE_EVENT(xfs_discard_class, name, \
2066 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2067 xfs_agblock_t agbno, xfs_extlen_t len), \
2068 TP_ARGS(mp, agno, agbno, len))
2069DEFINE_DISCARD_EVENT(xfs_discard_extent);
2070DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2071DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2072DEFINE_DISCARD_EVENT(xfs_discard_busy);
2073
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00002074#endif /* _TRACE_XFS_H */
2075
2076#undef TRACE_INCLUDE_PATH
2077#define TRACE_INCLUDE_PATH .
2078#define TRACE_INCLUDE_FILE xfs_trace
2079#include <trace/define_trace.h>