blob: 4c3418b1a2440e746380138f1f76467534bfc42c [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;
Darrick J. Wong2c813ad2016-08-03 11:08:36 +100041struct xfs_btree_cur;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000042
Christoph Hellwigea9a4882009-12-21 14:03:03 +000043DECLARE_EVENT_CLASS(xfs_attr_list_class,
44 TP_PROTO(struct xfs_attr_list_context *ctx),
45 TP_ARGS(ctx),
46 TP_STRUCT__entry(
47 __field(dev_t, dev)
48 __field(xfs_ino_t, ino)
49 __field(u32, hashval)
50 __field(u32, blkno)
51 __field(u32, offset)
52 __field(void *, alist)
53 __field(int, bufsize)
54 __field(int, count)
55 __field(int, firstu)
56 __field(int, dupcnt)
57 __field(int, flags)
58 ),
59 TP_fast_assign(
60 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
61 __entry->ino = ctx->dp->i_ino;
62 __entry->hashval = ctx->cursor->hashval;
63 __entry->blkno = ctx->cursor->blkno;
64 __entry->offset = ctx->cursor->offset;
65 __entry->alist = ctx->alist;
66 __entry->bufsize = ctx->bufsize;
67 __entry->count = ctx->count;
68 __entry->firstu = ctx->firstu;
69 __entry->flags = ctx->flags;
70 ),
71 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
72 "alist 0x%p size %u count %u firstu %u flags %d %s",
73 MAJOR(__entry->dev), MINOR(__entry->dev),
74 __entry->ino,
75 __entry->hashval,
76 __entry->blkno,
77 __entry->offset,
78 __entry->dupcnt,
79 __entry->alist,
80 __entry->bufsize,
81 __entry->count,
82 __entry->firstu,
83 __entry->flags,
84 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
85 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000086)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000087
88#define DEFINE_ATTR_LIST_EVENT(name) \
89DEFINE_EVENT(xfs_attr_list_class, name, \
90 TP_PROTO(struct xfs_attr_list_context *ctx), \
91 TP_ARGS(ctx))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000092DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
93DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
94DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
95DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
96DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
97DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
98DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
99DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
Dave Chinneree732592012-11-12 22:53:53 +1100100DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
101DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000102
Li Zefanf8adb4d2010-05-24 08:25:57 +0000103DECLARE_EVENT_CLASS(xfs_perag_class,
104 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
105 unsigned long caller_ip),
106 TP_ARGS(mp, agno, refcount, caller_ip),
107 TP_STRUCT__entry(
108 __field(dev_t, dev)
109 __field(xfs_agnumber_t, agno)
110 __field(int, refcount)
111 __field(unsigned long, caller_ip)
112 ),
113 TP_fast_assign(
114 __entry->dev = mp->m_super->s_dev;
115 __entry->agno = agno;
116 __entry->refcount = refcount;
117 __entry->caller_ip = caller_ip;
118 ),
Scott Wood65dd2972015-03-25 14:56:21 +1100119 TP_printk("dev %d:%d agno %u refcount %d caller %ps",
Li Zefanf8adb4d2010-05-24 08:25:57 +0000120 MAJOR(__entry->dev), MINOR(__entry->dev),
121 __entry->agno,
122 __entry->refcount,
123 (char *)__entry->caller_ip)
124);
125
126#define DEFINE_PERAG_REF_EVENT(name) \
127DEFINE_EVENT(xfs_perag_class, name, \
128 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
129 unsigned long caller_ip), \
130 TP_ARGS(mp, agno, refcount, caller_ip))
131DEFINE_PERAG_REF_EVENT(xfs_perag_get);
Dave Chinner65d0f202010-09-24 18:40:15 +1000132DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000133DEFINE_PERAG_REF_EVENT(xfs_perag_put);
Dave Chinner16fd5362010-07-20 09:43:39 +1000134DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
135DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
Brian Foster27b52862012-11-06 09:50:38 -0500136DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
137DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000138
Dave Chinnerd1230312013-11-01 15:27:19 +1100139DECLARE_EVENT_CLASS(xfs_ag_class,
140 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
141 TP_ARGS(mp, agno),
142 TP_STRUCT__entry(
143 __field(dev_t, dev)
144 __field(xfs_agnumber_t, agno)
145 ),
146 TP_fast_assign(
147 __entry->dev = mp->m_super->s_dev;
148 __entry->agno = agno;
149 ),
150 TP_printk("dev %d:%d agno %u",
151 MAJOR(__entry->dev), MINOR(__entry->dev),
152 __entry->agno)
153);
154#define DEFINE_AG_EVENT(name) \
155DEFINE_EVENT(xfs_ag_class, name, \
156 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
157 TP_ARGS(mp, agno))
158
159DEFINE_AG_EVENT(xfs_read_agf);
160DEFINE_AG_EVENT(xfs_alloc_read_agf);
161DEFINE_AG_EVENT(xfs_read_agi);
162DEFINE_AG_EVENT(xfs_ialloc_read_agi);
163
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000164TRACE_EVENT(xfs_attr_list_node_descend,
165 TP_PROTO(struct xfs_attr_list_context *ctx,
166 struct xfs_da_node_entry *btree),
167 TP_ARGS(ctx, btree),
168 TP_STRUCT__entry(
169 __field(dev_t, dev)
170 __field(xfs_ino_t, ino)
171 __field(u32, hashval)
172 __field(u32, blkno)
173 __field(u32, offset)
174 __field(void *, alist)
175 __field(int, bufsize)
176 __field(int, count)
177 __field(int, firstu)
178 __field(int, dupcnt)
179 __field(int, flags)
180 __field(u32, bt_hashval)
181 __field(u32, bt_before)
182 ),
183 TP_fast_assign(
184 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
185 __entry->ino = ctx->dp->i_ino;
186 __entry->hashval = ctx->cursor->hashval;
187 __entry->blkno = ctx->cursor->blkno;
188 __entry->offset = ctx->cursor->offset;
189 __entry->alist = ctx->alist;
190 __entry->bufsize = ctx->bufsize;
191 __entry->count = ctx->count;
192 __entry->firstu = ctx->firstu;
193 __entry->flags = ctx->flags;
194 __entry->bt_hashval = be32_to_cpu(btree->hashval);
195 __entry->bt_before = be32_to_cpu(btree->before);
196 ),
197 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
198 "alist 0x%p size %u count %u firstu %u flags %d %s "
199 "node hashval %u, node before %u",
200 MAJOR(__entry->dev), MINOR(__entry->dev),
201 __entry->ino,
202 __entry->hashval,
203 __entry->blkno,
204 __entry->offset,
205 __entry->dupcnt,
206 __entry->alist,
207 __entry->bufsize,
208 __entry->count,
209 __entry->firstu,
210 __entry->flags,
211 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
212 __entry->bt_hashval,
213 __entry->bt_before)
214);
215
216TRACE_EVENT(xfs_iext_insert,
217 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
218 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
219 TP_ARGS(ip, idx, r, state, caller_ip),
220 TP_STRUCT__entry(
221 __field(dev_t, dev)
222 __field(xfs_ino_t, ino)
223 __field(xfs_extnum_t, idx)
224 __field(xfs_fileoff_t, startoff)
225 __field(xfs_fsblock_t, startblock)
226 __field(xfs_filblks_t, blockcount)
227 __field(xfs_exntst_t, state)
228 __field(int, bmap_state)
229 __field(unsigned long, caller_ip)
230 ),
231 TP_fast_assign(
232 __entry->dev = VFS_I(ip)->i_sb->s_dev;
233 __entry->ino = ip->i_ino;
234 __entry->idx = idx;
235 __entry->startoff = r->br_startoff;
236 __entry->startblock = r->br_startblock;
237 __entry->blockcount = r->br_blockcount;
238 __entry->state = r->br_state;
239 __entry->bmap_state = state;
240 __entry->caller_ip = caller_ip;
241 ),
242 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Scott Wood65dd2972015-03-25 14:56:21 +1100243 "offset %lld block %lld count %lld flag %d caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000244 MAJOR(__entry->dev), MINOR(__entry->dev),
245 __entry->ino,
246 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
247 (long)__entry->idx,
248 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000249 (__int64_t)__entry->startblock,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000250 __entry->blockcount,
251 __entry->state,
252 (char *)__entry->caller_ip)
253);
254
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000255DECLARE_EVENT_CLASS(xfs_bmap_class,
256 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
257 unsigned long caller_ip),
258 TP_ARGS(ip, idx, state, caller_ip),
259 TP_STRUCT__entry(
260 __field(dev_t, dev)
261 __field(xfs_ino_t, ino)
262 __field(xfs_extnum_t, idx)
263 __field(xfs_fileoff_t, startoff)
264 __field(xfs_fsblock_t, startblock)
265 __field(xfs_filblks_t, blockcount)
266 __field(xfs_exntst_t, state)
267 __field(int, bmap_state)
268 __field(unsigned long, caller_ip)
269 ),
270 TP_fast_assign(
271 struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ?
272 ip->i_afp : &ip->i_df;
273 struct xfs_bmbt_irec r;
274
275 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
276 __entry->dev = VFS_I(ip)->i_sb->s_dev;
277 __entry->ino = ip->i_ino;
278 __entry->idx = idx;
279 __entry->startoff = r.br_startoff;
280 __entry->startblock = r.br_startblock;
281 __entry->blockcount = r.br_blockcount;
282 __entry->state = r.br_state;
283 __entry->bmap_state = state;
284 __entry->caller_ip = caller_ip;
285 ),
286 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Scott Wood65dd2972015-03-25 14:56:21 +1100287 "offset %lld block %lld count %lld flag %d caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000288 MAJOR(__entry->dev), MINOR(__entry->dev),
289 __entry->ino,
290 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
291 (long)__entry->idx,
292 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000293 (__int64_t)__entry->startblock,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000294 __entry->blockcount,
295 __entry->state,
296 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000297)
298
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000299#define DEFINE_BMAP_EVENT(name) \
300DEFINE_EVENT(xfs_bmap_class, name, \
301 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
302 unsigned long caller_ip), \
303 TP_ARGS(ip, idx, state, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000304DEFINE_BMAP_EVENT(xfs_iext_remove);
305DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
306DEFINE_BMAP_EVENT(xfs_bmap_post_update);
307DEFINE_BMAP_EVENT(xfs_extlist);
308
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000309DECLARE_EVENT_CLASS(xfs_buf_class,
310 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
311 TP_ARGS(bp, caller_ip),
312 TP_STRUCT__entry(
313 __field(dev_t, dev)
314 __field(xfs_daddr_t, bno)
Dave Chinner4e94b712012-04-23 15:58:51 +1000315 __field(int, nblks)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000316 __field(int, hold)
317 __field(int, pincount)
318 __field(unsigned, lockval)
319 __field(unsigned, flags)
320 __field(unsigned long, caller_ip)
321 ),
322 TP_fast_assign(
323 __entry->dev = bp->b_target->bt_dev;
324 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000325 __entry->nblks = bp->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000326 __entry->hold = atomic_read(&bp->b_hold);
327 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200328 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000329 __entry->flags = bp->b_flags;
330 __entry->caller_ip = caller_ip;
331 ),
Dave Chinner4e94b712012-04-23 15:58:51 +1000332 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
Scott Wood65dd2972015-03-25 14:56:21 +1100333 "lock %d flags %s caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000334 MAJOR(__entry->dev), MINOR(__entry->dev),
335 (unsigned long long)__entry->bno,
Dave Chinner4e94b712012-04-23 15:58:51 +1000336 __entry->nblks,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000337 __entry->hold,
338 __entry->pincount,
339 __entry->lockval,
340 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
341 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000342)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000343
344#define DEFINE_BUF_EVENT(name) \
345DEFINE_EVENT(xfs_buf_class, name, \
346 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
347 TP_ARGS(bp, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000348DEFINE_BUF_EVENT(xfs_buf_init);
349DEFINE_BUF_EVENT(xfs_buf_free);
350DEFINE_BUF_EVENT(xfs_buf_hold);
351DEFINE_BUF_EVENT(xfs_buf_rele);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000352DEFINE_BUF_EVENT(xfs_buf_iodone);
Dave Chinner595bff72014-10-02 09:05:14 +1000353DEFINE_BUF_EVENT(xfs_buf_submit);
354DEFINE_BUF_EVENT(xfs_buf_submit_wait);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000355DEFINE_BUF_EVENT(xfs_buf_bawrite);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000356DEFINE_BUF_EVENT(xfs_buf_lock);
357DEFINE_BUF_EVENT(xfs_buf_lock_done);
Darrick J. Wong479c6412016-06-21 11:53:28 +1000358DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200359DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000360DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000361DEFINE_BUF_EVENT(xfs_buf_iowait);
362DEFINE_BUF_EVENT(xfs_buf_iowait_done);
363DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000364DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000365DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Dave Chinner686865f2010-09-24 20:07:47 +1000366DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000367DEFINE_BUF_EVENT(xfs_bdstrat_shut);
368DEFINE_BUF_EVENT(xfs_buf_item_relse);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000369DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
370DEFINE_BUF_EVENT(xfs_buf_error_relse);
Dave Chinner9f878322013-01-21 23:53:55 +1100371DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000372DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
373DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
374
375/* not really buffer traces, but the buf provides useful information */
376DEFINE_BUF_EVENT(xfs_btree_corrupt);
377DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
378DEFINE_BUF_EVENT(xfs_reset_dqcounts);
379DEFINE_BUF_EVENT(xfs_inode_item_push);
380
381/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000382DECLARE_EVENT_CLASS(xfs_buf_flags_class,
383 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
384 TP_ARGS(bp, flags, caller_ip),
385 TP_STRUCT__entry(
386 __field(dev_t, dev)
387 __field(xfs_daddr_t, bno)
388 __field(size_t, buffer_length)
389 __field(int, hold)
390 __field(int, pincount)
391 __field(unsigned, lockval)
392 __field(unsigned, flags)
393 __field(unsigned long, caller_ip)
394 ),
395 TP_fast_assign(
396 __entry->dev = bp->b_target->bt_dev;
397 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000398 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000399 __entry->flags = flags;
400 __entry->hold = atomic_read(&bp->b_hold);
401 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200402 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000403 __entry->caller_ip = caller_ip;
404 ),
405 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Scott Wood65dd2972015-03-25 14:56:21 +1100406 "lock %d flags %s caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000407 MAJOR(__entry->dev), MINOR(__entry->dev),
408 (unsigned long long)__entry->bno,
409 __entry->buffer_length,
410 __entry->hold,
411 __entry->pincount,
412 __entry->lockval,
413 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
414 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000415)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000416
417#define DEFINE_BUF_FLAGS_EVENT(name) \
418DEFINE_EVENT(xfs_buf_flags_class, name, \
419 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
420 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000421DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
422DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
423DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
424
425TRACE_EVENT(xfs_buf_ioerror,
426 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
427 TP_ARGS(bp, error, caller_ip),
428 TP_STRUCT__entry(
429 __field(dev_t, dev)
430 __field(xfs_daddr_t, bno)
431 __field(size_t, buffer_length)
432 __field(unsigned, flags)
433 __field(int, hold)
434 __field(int, pincount)
435 __field(unsigned, lockval)
436 __field(int, error)
437 __field(unsigned long, caller_ip)
438 ),
439 TP_fast_assign(
440 __entry->dev = bp->b_target->bt_dev;
441 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000442 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000443 __entry->hold = atomic_read(&bp->b_hold);
444 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200445 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000446 __entry->error = error;
447 __entry->flags = bp->b_flags;
448 __entry->caller_ip = caller_ip;
449 ),
450 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Scott Wood65dd2972015-03-25 14:56:21 +1100451 "lock %d error %d flags %s caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000452 MAJOR(__entry->dev), MINOR(__entry->dev),
453 (unsigned long long)__entry->bno,
454 __entry->buffer_length,
455 __entry->hold,
456 __entry->pincount,
457 __entry->lockval,
458 __entry->error,
459 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
460 (void *)__entry->caller_ip)
461);
462
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000463DECLARE_EVENT_CLASS(xfs_buf_item_class,
464 TP_PROTO(struct xfs_buf_log_item *bip),
465 TP_ARGS(bip),
466 TP_STRUCT__entry(
467 __field(dev_t, dev)
468 __field(xfs_daddr_t, buf_bno)
469 __field(size_t, buf_len)
470 __field(int, buf_hold)
471 __field(int, buf_pincount)
472 __field(int, buf_lockval)
473 __field(unsigned, buf_flags)
474 __field(unsigned, bli_recur)
475 __field(int, bli_refcount)
476 __field(unsigned, bli_flags)
477 __field(void *, li_desc)
478 __field(unsigned, li_flags)
479 ),
480 TP_fast_assign(
481 __entry->dev = bip->bli_buf->b_target->bt_dev;
482 __entry->bli_flags = bip->bli_flags;
483 __entry->bli_recur = bip->bli_recur;
484 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
485 __entry->buf_bno = bip->bli_buf->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000486 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000487 __entry->buf_flags = bip->bli_buf->b_flags;
488 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
489 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200490 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000491 __entry->li_desc = bip->bli_item.li_desc;
492 __entry->li_flags = bip->bli_item.li_flags;
493 ),
494 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
495 "lock %d flags %s recur %d refcount %d bliflags %s "
496 "lidesc 0x%p liflags %s",
497 MAJOR(__entry->dev), MINOR(__entry->dev),
498 (unsigned long long)__entry->buf_bno,
499 __entry->buf_len,
500 __entry->buf_hold,
501 __entry->buf_pincount,
502 __entry->buf_lockval,
503 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
504 __entry->bli_recur,
505 __entry->bli_refcount,
506 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
507 __entry->li_desc,
508 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000509)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000510
511#define DEFINE_BUF_ITEM_EVENT(name) \
512DEFINE_EVENT(xfs_buf_item_class, name, \
513 TP_PROTO(struct xfs_buf_log_item *bip), \
514 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000515DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000516DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000517DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
518DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000519DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000520DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000521DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000522DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
523DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
524DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000525DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
526DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
527DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
528DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
529DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
530DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
531DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
532DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
533DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
534DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
535DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
536DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
537DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
538DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
539DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
540DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000541DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000542
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000543DECLARE_EVENT_CLASS(xfs_filestream_class,
544 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
545 TP_ARGS(ip, agno),
546 TP_STRUCT__entry(
547 __field(dev_t, dev)
548 __field(xfs_ino_t, ino)
549 __field(xfs_agnumber_t, agno)
550 __field(int, streams)
551 ),
552 TP_fast_assign(
553 __entry->dev = VFS_I(ip)->i_sb->s_dev;
554 __entry->ino = ip->i_ino;
555 __entry->agno = agno;
556 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
557 ),
558 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
559 MAJOR(__entry->dev), MINOR(__entry->dev),
560 __entry->ino,
561 __entry->agno,
562 __entry->streams)
563)
564#define DEFINE_FILESTREAM_EVENT(name) \
565DEFINE_EVENT(xfs_filestream_class, name, \
566 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
567 TP_ARGS(ip, agno))
568DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
569DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
570DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
571
572TRACE_EVENT(xfs_filestream_pick,
573 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
574 xfs_extlen_t free, int nscan),
575 TP_ARGS(ip, agno, free, nscan),
576 TP_STRUCT__entry(
577 __field(dev_t, dev)
578 __field(xfs_ino_t, ino)
579 __field(xfs_agnumber_t, agno)
580 __field(int, streams)
581 __field(xfs_extlen_t, free)
582 __field(int, nscan)
583 ),
584 TP_fast_assign(
585 __entry->dev = VFS_I(ip)->i_sb->s_dev;
586 __entry->ino = ip->i_ino;
587 __entry->agno = agno;
588 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
589 __entry->free = free;
590 __entry->nscan = nscan;
591 ),
592 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
593 MAJOR(__entry->dev), MINOR(__entry->dev),
594 __entry->ino,
595 __entry->agno,
596 __entry->streams,
597 __entry->free,
598 __entry->nscan)
599);
600
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000601DECLARE_EVENT_CLASS(xfs_lock_class,
602 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
603 unsigned long caller_ip),
604 TP_ARGS(ip, lock_flags, caller_ip),
605 TP_STRUCT__entry(
606 __field(dev_t, dev)
607 __field(xfs_ino_t, ino)
608 __field(int, lock_flags)
609 __field(unsigned long, caller_ip)
610 ),
611 TP_fast_assign(
612 __entry->dev = VFS_I(ip)->i_sb->s_dev;
613 __entry->ino = ip->i_ino;
614 __entry->lock_flags = lock_flags;
615 __entry->caller_ip = caller_ip;
616 ),
Scott Wood65dd2972015-03-25 14:56:21 +1100617 TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000618 MAJOR(__entry->dev), MINOR(__entry->dev),
619 __entry->ino,
620 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
621 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000622)
623
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000624#define DEFINE_LOCK_EVENT(name) \
625DEFINE_EVENT(xfs_lock_class, name, \
626 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
627 unsigned long caller_ip), \
628 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000629DEFINE_LOCK_EVENT(xfs_ilock);
630DEFINE_LOCK_EVENT(xfs_ilock_nowait);
631DEFINE_LOCK_EVENT(xfs_ilock_demote);
632DEFINE_LOCK_EVENT(xfs_iunlock);
633
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000634DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000635 TP_PROTO(struct xfs_inode *ip),
636 TP_ARGS(ip),
637 TP_STRUCT__entry(
638 __field(dev_t, dev)
639 __field(xfs_ino_t, ino)
640 ),
641 TP_fast_assign(
642 __entry->dev = VFS_I(ip)->i_sb->s_dev;
643 __entry->ino = ip->i_ino;
644 ),
645 TP_printk("dev %d:%d ino 0x%llx",
646 MAJOR(__entry->dev), MINOR(__entry->dev),
647 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000648)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000649
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000650#define DEFINE_INODE_EVENT(name) \
651DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000652 TP_PROTO(struct xfs_inode *ip), \
653 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000654DEFINE_INODE_EVENT(xfs_iget_skip);
655DEFINE_INODE_EVENT(xfs_iget_reclaim);
656DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
657DEFINE_INODE_EVENT(xfs_iget_hit);
658DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000659
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000660DEFINE_INODE_EVENT(xfs_getattr);
661DEFINE_INODE_EVENT(xfs_setattr);
662DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500663DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000664DEFINE_INODE_EVENT(xfs_alloc_file_space);
665DEFINE_INODE_EVENT(xfs_free_file_space);
Dave Chinner897b73b2014-04-14 18:15:11 +1000666DEFINE_INODE_EVENT(xfs_zero_file_space);
Namjae Jeone1d8fb82014-02-24 10:58:19 +1100667DEFINE_INODE_EVENT(xfs_collapse_file_space);
Namjae Jeona904b1c2015-03-25 15:08:56 +1100668DEFINE_INODE_EVENT(xfs_insert_file_space);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000669DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000670#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200671DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000672#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000673DEFINE_INODE_EVENT(xfs_vm_bmap);
674DEFINE_INODE_EVENT(xfs_file_ioctl);
675DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
676DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000677DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000678DEFINE_INODE_EVENT(xfs_file_fsync);
679DEFINE_INODE_EVENT(xfs_destroy_inode);
Al Virob57922d2010-06-07 14:34:48 -0400680DEFINE_INODE_EVENT(xfs_evict_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400681DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000682
683DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
684DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
685
Brian Foster27b52862012-11-06 09:50:38 -0500686DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
687DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500688DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Brian Foster27b52862012-11-06 09:50:38 -0500689
Dave Chinnerde0e8c22015-02-23 21:44:19 +1100690DEFINE_INODE_EVENT(xfs_filemap_fault);
Matthew Wilcoxacd76e72015-09-08 14:59:06 -0700691DEFINE_INODE_EVENT(xfs_filemap_pmd_fault);
Dave Chinner075a9242015-02-23 21:44:54 +1100692DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite);
Dave Chinner3af49282015-11-03 12:37:02 +1100693DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite);
Dave Chinnerde0e8c22015-02-23 21:44:19 +1100694
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000695DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000696 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
697 TP_ARGS(ip, caller_ip),
698 TP_STRUCT__entry(
699 __field(dev_t, dev)
700 __field(xfs_ino_t, ino)
701 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100702 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000703 __field(unsigned long, caller_ip)
704 ),
705 TP_fast_assign(
706 __entry->dev = VFS_I(ip)->i_sb->s_dev;
707 __entry->ino = ip->i_ino;
708 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100709 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000710 __entry->caller_ip = caller_ip;
711 ),
Scott Wood65dd2972015-03-25 14:56:21 +1100712 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000713 MAJOR(__entry->dev), MINOR(__entry->dev),
714 __entry->ino,
715 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100716 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000717 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000718)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000719
Brian Foster19cb7e32013-03-18 10:51:48 -0400720TRACE_EVENT(xfs_iomap_prealloc_size,
721 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
722 unsigned int writeio_blocks),
723 TP_ARGS(ip, blocks, shift, writeio_blocks),
724 TP_STRUCT__entry(
725 __field(dev_t, dev)
726 __field(xfs_ino_t, ino)
727 __field(xfs_fsblock_t, blocks)
728 __field(int, shift)
729 __field(unsigned int, writeio_blocks)
730 ),
731 TP_fast_assign(
732 __entry->dev = VFS_I(ip)->i_sb->s_dev;
733 __entry->ino = ip->i_ino;
734 __entry->blocks = blocks;
735 __entry->shift = shift;
736 __entry->writeio_blocks = writeio_blocks;
737 ),
738 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
739 "m_writeio_blocks %u",
740 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
741 __entry->blocks, __entry->shift, __entry->writeio_blocks)
742)
743
Brian Foster56d11152015-05-29 09:18:32 +1000744TRACE_EVENT(xfs_irec_merge_pre,
745 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
746 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
747 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
748 TP_STRUCT__entry(
749 __field(dev_t, dev)
750 __field(xfs_agnumber_t, agno)
751 __field(xfs_agino_t, agino)
752 __field(uint16_t, holemask)
753 __field(xfs_agino_t, nagino)
754 __field(uint16_t, nholemask)
755 ),
756 TP_fast_assign(
757 __entry->dev = mp->m_super->s_dev;
758 __entry->agno = agno;
759 __entry->agino = agino;
760 __entry->holemask = holemask;
761 __entry->nagino = nagino;
762 __entry->nholemask = holemask;
763 ),
764 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
765 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
766 __entry->agino, __entry->holemask, __entry->nagino,
767 __entry->nholemask)
768)
769
770TRACE_EVENT(xfs_irec_merge_post,
771 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
772 uint16_t holemask),
773 TP_ARGS(mp, agno, agino, holemask),
774 TP_STRUCT__entry(
775 __field(dev_t, dev)
776 __field(xfs_agnumber_t, agno)
777 __field(xfs_agino_t, agino)
778 __field(uint16_t, holemask)
779 ),
780 TP_fast_assign(
781 __entry->dev = mp->m_super->s_dev;
782 __entry->agno = agno;
783 __entry->agino = agino;
784 __entry->holemask = holemask;
785 ),
786 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
787 MINOR(__entry->dev), __entry->agno, __entry->agino,
788 __entry->holemask)
789)
790
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000791#define DEFINE_IREF_EVENT(name) \
792DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000793 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
794 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000795DEFINE_IREF_EVENT(xfs_ihold);
796DEFINE_IREF_EVENT(xfs_irele);
797DEFINE_IREF_EVENT(xfs_inode_pin);
798DEFINE_IREF_EVENT(xfs_inode_unpin);
799DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100800
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000801DECLARE_EVENT_CLASS(xfs_namespace_class,
802 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
803 TP_ARGS(dp, name),
804 TP_STRUCT__entry(
805 __field(dev_t, dev)
806 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000807 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000808 __dynamic_array(char, name, name->len)
809 ),
810 TP_fast_assign(
811 __entry->dev = VFS_I(dp)->i_sb->s_dev;
812 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000813 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000814 memcpy(__get_str(name), name->name, name->len);
815 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000816 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000817 MAJOR(__entry->dev), MINOR(__entry->dev),
818 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000819 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000820 __get_str(name))
821)
822
823#define DEFINE_NAMESPACE_EVENT(name) \
824DEFINE_EVENT(xfs_namespace_class, name, \
825 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
826 TP_ARGS(dp, name))
827DEFINE_NAMESPACE_EVENT(xfs_remove);
828DEFINE_NAMESPACE_EVENT(xfs_link);
829DEFINE_NAMESPACE_EVENT(xfs_lookup);
830DEFINE_NAMESPACE_EVENT(xfs_create);
831DEFINE_NAMESPACE_EVENT(xfs_symlink);
832
833TRACE_EVENT(xfs_rename,
834 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
835 struct xfs_name *src_name, struct xfs_name *target_name),
836 TP_ARGS(src_dp, target_dp, src_name, target_name),
837 TP_STRUCT__entry(
838 __field(dev_t, dev)
839 __field(xfs_ino_t, src_dp_ino)
840 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000841 __field(int, src_namelen)
842 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000843 __dynamic_array(char, src_name, src_name->len)
844 __dynamic_array(char, target_name, target_name->len)
845 ),
846 TP_fast_assign(
847 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
848 __entry->src_dp_ino = src_dp->i_ino;
849 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000850 __entry->src_namelen = src_name->len;
851 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000852 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000853 memcpy(__get_str(target_name), target_name->name,
854 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000855 ),
856 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000857 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000858 MAJOR(__entry->dev), MINOR(__entry->dev),
859 __entry->src_dp_ino,
860 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000861 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000862 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000863 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000864 __get_str(target_name))
865)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000866
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000867DECLARE_EVENT_CLASS(xfs_dquot_class,
868 TP_PROTO(struct xfs_dquot *dqp),
869 TP_ARGS(dqp),
870 TP_STRUCT__entry(
871 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000872 __field(u32, id)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000873 __field(unsigned, flags)
874 __field(unsigned, nrefs)
875 __field(unsigned long long, res_bcount)
876 __field(unsigned long long, bcount)
877 __field(unsigned long long, icount)
878 __field(unsigned long long, blk_hardlimit)
879 __field(unsigned long long, blk_softlimit)
880 __field(unsigned long long, ino_hardlimit)
881 __field(unsigned long long, ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000882 ), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000883 TP_fast_assign(
884 __entry->dev = dqp->q_mount->m_super->s_dev;
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000885 __entry->id = be32_to_cpu(dqp->q_core.d_id);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000886 __entry->flags = dqp->dq_flags;
887 __entry->nrefs = dqp->q_nrefs;
888 __entry->res_bcount = dqp->q_res_bcount;
889 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
890 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
891 __entry->blk_hardlimit =
892 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
893 __entry->blk_softlimit =
894 be64_to_cpu(dqp->q_core.d_blk_softlimit);
895 __entry->ino_hardlimit =
896 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
897 __entry->ino_softlimit =
898 be64_to_cpu(dqp->q_core.d_ino_softlimit);
899 ),
900 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000901 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
902 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000903 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000904 __entry->id,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000905 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
906 __entry->nrefs,
907 __entry->res_bcount,
908 __entry->bcount,
909 __entry->blk_hardlimit,
910 __entry->blk_softlimit,
911 __entry->icount,
912 __entry->ino_hardlimit,
913 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000914)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000915
916#define DEFINE_DQUOT_EVENT(name) \
917DEFINE_EVENT(xfs_dquot_class, name, \
918 TP_PROTO(struct xfs_dquot *dqp), \
919 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000920DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000921DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
922DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b2012-02-01 13:57:20 +0000923DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
924DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000925DEFINE_DQUOT_EVENT(xfs_dqattach_found);
926DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000927DEFINE_DQUOT_EVENT(xfs_dqalloc);
928DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
929DEFINE_DQUOT_EVENT(xfs_dqread);
930DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000931DEFINE_DQUOT_EVENT(xfs_dqget_hit);
932DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000933DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
934DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000935DEFINE_DQUOT_EVENT(xfs_dqput);
936DEFINE_DQUOT_EVENT(xfs_dqput_wait);
937DEFINE_DQUOT_EVENT(xfs_dqput_free);
938DEFINE_DQUOT_EVENT(xfs_dqrele);
939DEFINE_DQUOT_EVENT(xfs_dqflush);
940DEFINE_DQUOT_EVENT(xfs_dqflush_force);
941DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000942
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000943DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -0500944 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000945 TP_ARGS(log, tic),
946 TP_STRUCT__entry(
947 __field(dev_t, dev)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000948 __field(char, ocnt)
949 __field(char, cnt)
950 __field(int, curr_res)
951 __field(int, unit_res)
952 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +1100953 __field(int, reserveq)
954 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000955 __field(int, grant_reserve_cycle)
956 __field(int, grant_reserve_bytes)
957 __field(int, grant_write_cycle)
958 __field(int, grant_write_bytes)
959 __field(int, curr_cycle)
960 __field(int, curr_block)
961 __field(xfs_lsn_t, tail_lsn)
962 ),
963 TP_fast_assign(
964 __entry->dev = log->l_mp->m_super->s_dev;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000965 __entry->ocnt = tic->t_ocnt;
966 __entry->cnt = tic->t_cnt;
967 __entry->curr_res = tic->t_curr_res;
968 __entry->unit_res = tic->t_unit_res;
969 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +0000970 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
971 __entry->writeq = list_empty(&log->l_write_head.waiters);
972 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100973 &__entry->grant_reserve_cycle,
974 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +0000975 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100976 &__entry->grant_write_cycle,
977 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000978 __entry->curr_cycle = log->l_curr_cycle;
979 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +1100980 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000981 ),
Christoph Hellwig710b1e22016-04-06 09:20:36 +1000982 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +1100983 "t_unit_res %u t_flags %s reserveq %s "
984 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000985 "grant_reserve_bytes %d grant_write_cycle %d "
986 "grant_write_bytes %d curr_cycle %d curr_block %d "
987 "tail_cycle %d tail_block %d",
988 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000989 __entry->ocnt,
990 __entry->cnt,
991 __entry->curr_res,
992 __entry->unit_res,
993 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +1100994 __entry->reserveq ? "empty" : "active",
995 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000996 __entry->grant_reserve_cycle,
997 __entry->grant_reserve_bytes,
998 __entry->grant_write_cycle,
999 __entry->grant_write_bytes,
1000 __entry->curr_cycle,
1001 __entry->curr_block,
1002 CYCLE_LSN(__entry->tail_lsn),
1003 BLOCK_LSN(__entry->tail_lsn)
1004 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001005)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001006
1007#define DEFINE_LOGGRANT_EVENT(name) \
1008DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001009 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001010 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001011DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
1012DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001013DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +00001014DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1015DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +11001016DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +00001017DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1018DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1019DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1020DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001021DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1022DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1023DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1024DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1025DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1026DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1027
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001028DECLARE_EVENT_CLASS(xfs_log_item_class,
1029 TP_PROTO(struct xfs_log_item *lip),
1030 TP_ARGS(lip),
1031 TP_STRUCT__entry(
1032 __field(dev_t, dev)
1033 __field(void *, lip)
1034 __field(uint, type)
1035 __field(uint, flags)
1036 __field(xfs_lsn_t, 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->lsn = lip->li_lsn;
1044 ),
1045 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
1046 MAJOR(__entry->dev), MINOR(__entry->dev),
1047 __entry->lip,
1048 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1049 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1050 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1051)
1052
Dave Chinner14c26c62012-04-24 16:33:31 +10001053TRACE_EVENT(xfs_log_force,
Carlos Maiolino9f278892016-04-06 09:46:30 +10001054 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1055 TP_ARGS(mp, lsn, caller_ip),
Dave Chinner14c26c62012-04-24 16:33:31 +10001056 TP_STRUCT__entry(
1057 __field(dev_t, dev)
1058 __field(xfs_lsn_t, lsn)
Carlos Maiolino9f278892016-04-06 09:46:30 +10001059 __field(unsigned long, caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001060 ),
1061 TP_fast_assign(
1062 __entry->dev = mp->m_super->s_dev;
1063 __entry->lsn = lsn;
Carlos Maiolino9f278892016-04-06 09:46:30 +10001064 __entry->caller_ip = caller_ip;
Dave Chinner14c26c62012-04-24 16:33:31 +10001065 ),
Carlos Maiolino9f278892016-04-06 09:46:30 +10001066 TP_printk("dev %d:%d lsn 0x%llx caller %ps",
Dave Chinner14c26c62012-04-24 16:33:31 +10001067 MAJOR(__entry->dev), MINOR(__entry->dev),
Carlos Maiolino9f278892016-04-06 09:46:30 +10001068 __entry->lsn, (void *)__entry->caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001069)
1070
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001071#define DEFINE_LOG_ITEM_EVENT(name) \
1072DEFINE_EVENT(xfs_log_item_class, name, \
1073 TP_PROTO(struct xfs_log_item *lip), \
1074 TP_ARGS(lip))
1075DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001076DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1077DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +10001078DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001079
Dave Chinner750b9c92013-11-01 15:27:18 +11001080DECLARE_EVENT_CLASS(xfs_ail_class,
1081 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1082 TP_ARGS(lip, old_lsn, new_lsn),
1083 TP_STRUCT__entry(
1084 __field(dev_t, dev)
1085 __field(void *, lip)
1086 __field(uint, type)
1087 __field(uint, flags)
1088 __field(xfs_lsn_t, old_lsn)
1089 __field(xfs_lsn_t, new_lsn)
1090 ),
1091 TP_fast_assign(
1092 __entry->dev = lip->li_mountp->m_super->s_dev;
1093 __entry->lip = lip;
1094 __entry->type = lip->li_type;
1095 __entry->flags = lip->li_flags;
1096 __entry->old_lsn = old_lsn;
1097 __entry->new_lsn = new_lsn;
1098 ),
1099 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
1100 MAJOR(__entry->dev), MINOR(__entry->dev),
1101 __entry->lip,
1102 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1103 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1104 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1105 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1106)
1107
1108#define DEFINE_AIL_EVENT(name) \
1109DEFINE_EVENT(xfs_ail_class, name, \
1110 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1111 TP_ARGS(lip, old_lsn, new_lsn))
1112DEFINE_AIL_EVENT(xfs_ail_insert);
1113DEFINE_AIL_EVENT(xfs_ail_move);
1114DEFINE_AIL_EVENT(xfs_ail_delete);
1115
1116TRACE_EVENT(xfs_log_assign_tail_lsn,
1117 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1118 TP_ARGS(log, new_lsn),
1119 TP_STRUCT__entry(
1120 __field(dev_t, dev)
1121 __field(xfs_lsn_t, new_lsn)
1122 __field(xfs_lsn_t, old_lsn)
1123 __field(xfs_lsn_t, last_sync_lsn)
1124 ),
1125 TP_fast_assign(
1126 __entry->dev = log->l_mp->m_super->s_dev;
1127 __entry->new_lsn = new_lsn;
1128 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1129 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1130 ),
1131 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1132 MAJOR(__entry->dev), MINOR(__entry->dev),
1133 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1134 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1135 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1136)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001137
Li Zefanf8adb4d2010-05-24 08:25:57 +00001138DECLARE_EVENT_CLASS(xfs_file_class,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001139 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
1140 TP_ARGS(ip, count, offset),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001141 TP_STRUCT__entry(
1142 __field(dev_t, dev)
1143 __field(xfs_ino_t, ino)
1144 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001145 __field(loff_t, offset)
1146 __field(size_t, count)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001147 ),
1148 TP_fast_assign(
1149 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1150 __entry->ino = ip->i_ino;
1151 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001152 __entry->offset = offset;
1153 __entry->count = count;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001154 ),
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001155 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001156 MAJOR(__entry->dev), MINOR(__entry->dev),
1157 __entry->ino,
1158 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001159 __entry->offset,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001160 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001161)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001162
1163#define DEFINE_RW_EVENT(name) \
1164DEFINE_EVENT(xfs_file_class, name, \
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001165 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1166 TP_ARGS(ip, count, offset))
1167DEFINE_RW_EVENT(xfs_file_buffered_read);
1168DEFINE_RW_EVENT(xfs_file_direct_read);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001169DEFINE_RW_EVENT(xfs_file_dax_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001170DEFINE_RW_EVENT(xfs_file_buffered_write);
1171DEFINE_RW_EVENT(xfs_file_direct_write);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001172DEFINE_RW_EVENT(xfs_file_dax_write);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001173DEFINE_RW_EVENT(xfs_file_splice_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001174
Li Zefanf8adb4d2010-05-24 08:25:57 +00001175DECLARE_EVENT_CLASS(xfs_page_class,
Lukas Czerner34097df2013-05-21 23:58:01 -04001176 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1177 unsigned int len),
1178 TP_ARGS(inode, page, off, len),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001179 TP_STRUCT__entry(
1180 __field(dev_t, dev)
1181 __field(xfs_ino_t, ino)
1182 __field(pgoff_t, pgoff)
1183 __field(loff_t, size)
1184 __field(unsigned long, offset)
Lukas Czerner34097df2013-05-21 23:58:01 -04001185 __field(unsigned int, length)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001186 __field(int, delalloc)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001187 __field(int, unwritten)
1188 ),
1189 TP_fast_assign(
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001190 int delalloc = -1, unwritten = -1;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001191
Li Zefanf8adb4d2010-05-24 08:25:57 +00001192 if (page_has_buffers(page))
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001193 xfs_count_page_state(page, &delalloc, &unwritten);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001194 __entry->dev = inode->i_sb->s_dev;
1195 __entry->ino = XFS_I(inode)->i_ino;
1196 __entry->pgoff = page_offset(page);
1197 __entry->size = i_size_read(inode);
1198 __entry->offset = off;
Lukas Czerner34097df2013-05-21 23:58:01 -04001199 __entry->length = len;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001200 __entry->delalloc = delalloc;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001201 __entry->unwritten = unwritten;
1202 ),
1203 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
Lukas Czerner34097df2013-05-21 23:58:01 -04001204 "length %x delalloc %d unwritten %d",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001205 MAJOR(__entry->dev), MINOR(__entry->dev),
1206 __entry->ino,
1207 __entry->pgoff,
1208 __entry->size,
1209 __entry->offset,
Lukas Czerner34097df2013-05-21 23:58:01 -04001210 __entry->length,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001211 __entry->delalloc,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001212 __entry->unwritten)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001213)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001214
1215#define DEFINE_PAGE_EVENT(name) \
1216DEFINE_EVENT(xfs_page_class, name, \
Lukas Czerner34097df2013-05-21 23:58:01 -04001217 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1218 unsigned int len), \
1219 TP_ARGS(inode, page, off, len))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001220DEFINE_PAGE_EVENT(xfs_writepage);
1221DEFINE_PAGE_EVENT(xfs_releasepage);
1222DEFINE_PAGE_EVENT(xfs_invalidatepage);
1223
Dave Chinner121e2132016-01-08 11:28:35 +11001224DECLARE_EVENT_CLASS(xfs_readpage_class,
1225 TP_PROTO(struct inode *inode, int nr_pages),
1226 TP_ARGS(inode, nr_pages),
1227 TP_STRUCT__entry(
1228 __field(dev_t, dev)
1229 __field(xfs_ino_t, ino)
1230 __field(int, nr_pages)
1231 ),
1232 TP_fast_assign(
1233 __entry->dev = inode->i_sb->s_dev;
1234 __entry->ino = inode->i_ino;
1235 __entry->nr_pages = nr_pages;
1236 ),
1237 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1238 MAJOR(__entry->dev), MINOR(__entry->dev),
1239 __entry->ino,
1240 __entry->nr_pages)
1241)
1242
1243#define DEFINE_READPAGE_EVENT(name) \
1244DEFINE_EVENT(xfs_readpage_class, name, \
1245 TP_PROTO(struct inode *inode, int nr_pages), \
1246 TP_ARGS(inode, nr_pages))
1247DEFINE_READPAGE_EVENT(xfs_vm_readpage);
1248DEFINE_READPAGE_EVENT(xfs_vm_readpages);
1249
Christoph Hellwiga206c812010-12-10 08:42:20 +00001250DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001251 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001252 int type, struct xfs_bmbt_irec *irec),
1253 TP_ARGS(ip, offset, count, type, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001254 TP_STRUCT__entry(
1255 __field(dev_t, dev)
1256 __field(xfs_ino_t, ino)
1257 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001258 __field(loff_t, offset)
1259 __field(size_t, count)
Christoph Hellwiga206c812010-12-10 08:42:20 +00001260 __field(int, type)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001261 __field(xfs_fileoff_t, startoff)
1262 __field(xfs_fsblock_t, startblock)
1263 __field(xfs_filblks_t, blockcount)
1264 ),
1265 TP_fast_assign(
1266 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1267 __entry->ino = ip->i_ino;
1268 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001269 __entry->offset = offset;
1270 __entry->count = count;
Christoph Hellwiga206c812010-12-10 08:42:20 +00001271 __entry->type = type;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001272 __entry->startoff = irec ? irec->br_startoff : 0;
1273 __entry->startblock = irec ? irec->br_startblock : 0;
1274 __entry->blockcount = irec ? irec->br_blockcount : 0;
1275 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001276 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1277 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001278 MAJOR(__entry->dev), MINOR(__entry->dev),
1279 __entry->ino,
1280 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001281 __entry->offset,
1282 __entry->count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001283 __print_symbolic(__entry->type, XFS_IO_TYPES),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001284 __entry->startoff,
1285 (__int64_t)__entry->startblock,
1286 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001287)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001288
1289#define DEFINE_IOMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001290DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001291 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001292 int type, struct xfs_bmbt_irec *irec), \
1293 TP_ARGS(ip, offset, count, type, irec))
1294DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1295DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1296DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1297DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
Christoph Hellwig273dda72016-02-08 14:40:51 +11001298DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct);
Christoph Hellwig68a9f5e2016-06-21 09:53:44 +10001299DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
1300DEFINE_IOMAP_EVENT(xfs_iomap_found);
1301DEFINE_IOMAP_EVENT(xfs_iomap_not_found);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001302
Li Zefanf8adb4d2010-05-24 08:25:57 +00001303DECLARE_EVENT_CLASS(xfs_simple_io_class,
1304 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1305 TP_ARGS(ip, offset, count),
1306 TP_STRUCT__entry(
1307 __field(dev_t, dev)
1308 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001309 __field(loff_t, isize)
1310 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001311 __field(loff_t, offset)
1312 __field(size_t, count)
1313 ),
1314 TP_fast_assign(
1315 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1316 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001317 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001318 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001319 __entry->offset = offset;
1320 __entry->count = count;
1321 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001322 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001323 "offset 0x%llx count %zd",
1324 MAJOR(__entry->dev), MINOR(__entry->dev),
1325 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001326 __entry->isize,
1327 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001328 __entry->offset,
1329 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001330);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001331
1332#define DEFINE_SIMPLE_IO_EVENT(name) \
1333DEFINE_EVENT(xfs_simple_io_class, name, \
1334 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1335 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001336DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1337DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Christoph Hellwiga206c812010-12-10 08:42:20 +00001338DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001339DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Brian Foster0a50f162015-10-12 16:02:08 +11001340DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
Christoph Hellwig273dda72016-02-08 14:40:51 +11001341DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1342DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1343DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001344
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001345DECLARE_EVENT_CLASS(xfs_itrunc_class,
1346 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1347 TP_ARGS(ip, new_size),
1348 TP_STRUCT__entry(
1349 __field(dev_t, dev)
1350 __field(xfs_ino_t, ino)
1351 __field(xfs_fsize_t, size)
1352 __field(xfs_fsize_t, new_size)
1353 ),
1354 TP_fast_assign(
1355 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1356 __entry->ino = ip->i_ino;
1357 __entry->size = ip->i_d.di_size;
1358 __entry->new_size = new_size;
1359 ),
1360 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1361 MAJOR(__entry->dev), MINOR(__entry->dev),
1362 __entry->ino,
1363 __entry->size,
1364 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001365)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001366
1367#define DEFINE_ITRUNC_EVENT(name) \
1368DEFINE_EVENT(xfs_itrunc_class, name, \
1369 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1370 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001371DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1372DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001373
1374TRACE_EVENT(xfs_pagecache_inval,
1375 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1376 TP_ARGS(ip, start, finish),
1377 TP_STRUCT__entry(
1378 __field(dev_t, dev)
1379 __field(xfs_ino_t, ino)
1380 __field(xfs_fsize_t, size)
1381 __field(xfs_off_t, start)
1382 __field(xfs_off_t, finish)
1383 ),
1384 TP_fast_assign(
1385 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1386 __entry->ino = ip->i_ino;
1387 __entry->size = ip->i_d.di_size;
1388 __entry->start = start;
1389 __entry->finish = finish;
1390 ),
1391 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1392 MAJOR(__entry->dev), MINOR(__entry->dev),
1393 __entry->ino,
1394 __entry->size,
1395 __entry->start,
1396 __entry->finish)
1397);
1398
1399TRACE_EVENT(xfs_bunmap,
1400 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1401 int flags, unsigned long caller_ip),
1402 TP_ARGS(ip, bno, len, flags, caller_ip),
1403 TP_STRUCT__entry(
1404 __field(dev_t, dev)
1405 __field(xfs_ino_t, ino)
1406 __field(xfs_fsize_t, size)
1407 __field(xfs_fileoff_t, bno)
1408 __field(xfs_filblks_t, len)
1409 __field(unsigned long, caller_ip)
1410 __field(int, flags)
1411 ),
1412 TP_fast_assign(
1413 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1414 __entry->ino = ip->i_ino;
1415 __entry->size = ip->i_d.di_size;
1416 __entry->bno = bno;
1417 __entry->len = len;
1418 __entry->caller_ip = caller_ip;
1419 __entry->flags = flags;
1420 ),
1421 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
Scott Wood65dd2972015-03-25 14:56:21 +11001422 "flags %s caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001423 MAJOR(__entry->dev), MINOR(__entry->dev),
1424 __entry->ino,
1425 __entry->size,
1426 __entry->bno,
1427 __entry->len,
1428 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1429 (void *)__entry->caller_ip)
1430
1431);
1432
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001433DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001434 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1435 xfs_agblock_t agbno, xfs_extlen_t len),
1436 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001437 TP_STRUCT__entry(
1438 __field(dev_t, dev)
1439 __field(xfs_agnumber_t, agno)
1440 __field(xfs_agblock_t, agbno)
1441 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001442 ),
1443 TP_fast_assign(
1444 __entry->dev = mp->m_super->s_dev;
1445 __entry->agno = agno;
1446 __entry->agbno = agbno;
1447 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001448 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001449 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001450 MAJOR(__entry->dev), MINOR(__entry->dev),
1451 __entry->agno,
1452 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001453 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001454);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001455#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001456DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001457 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1458 xfs_agblock_t agbno, xfs_extlen_t len), \
1459 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001460DEFINE_BUSY_EVENT(xfs_extent_busy);
1461DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1462DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1463DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1464DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001465
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001466TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001467 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1468 xfs_agblock_t agbno, xfs_extlen_t len,
1469 xfs_agblock_t tbno, xfs_extlen_t tlen),
1470 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1471 TP_STRUCT__entry(
1472 __field(dev_t, dev)
1473 __field(xfs_agnumber_t, agno)
1474 __field(xfs_agblock_t, agbno)
1475 __field(xfs_extlen_t, len)
1476 __field(xfs_agblock_t, tbno)
1477 __field(xfs_extlen_t, tlen)
1478 ),
1479 TP_fast_assign(
1480 __entry->dev = mp->m_super->s_dev;
1481 __entry->agno = agno;
1482 __entry->agbno = agbno;
1483 __entry->len = len;
1484 __entry->tbno = tbno;
1485 __entry->tlen = tlen;
1486 ),
1487 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1488 MAJOR(__entry->dev), MINOR(__entry->dev),
1489 __entry->agno,
1490 __entry->agbno,
1491 __entry->len,
1492 __entry->tbno,
1493 __entry->tlen)
1494);
1495
Dave Chinnered3b4d62010-05-21 12:07:08 +10001496TRACE_EVENT(xfs_trans_commit_lsn,
1497 TP_PROTO(struct xfs_trans *trans),
1498 TP_ARGS(trans),
1499 TP_STRUCT__entry(
1500 __field(dev_t, dev)
1501 __field(struct xfs_trans *, tp)
1502 __field(xfs_lsn_t, lsn)
1503 ),
1504 TP_fast_assign(
1505 __entry->dev = trans->t_mountp->m_super->s_dev;
1506 __entry->tp = trans;
1507 __entry->lsn = trans->t_commit_lsn;
1508 ),
1509 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1510 MAJOR(__entry->dev), MINOR(__entry->dev),
1511 __entry->tp,
Dave Chinnerfd45e4782010-01-02 02:38:56 +00001512 __entry->lsn)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001513);
1514
1515TRACE_EVENT(xfs_agf,
1516 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1517 unsigned long caller_ip),
1518 TP_ARGS(mp, agf, flags, caller_ip),
1519 TP_STRUCT__entry(
1520 __field(dev_t, dev)
1521 __field(xfs_agnumber_t, agno)
1522 __field(int, flags)
1523 __field(__u32, length)
1524 __field(__u32, bno_root)
1525 __field(__u32, cnt_root)
1526 __field(__u32, bno_level)
1527 __field(__u32, cnt_level)
1528 __field(__u32, flfirst)
1529 __field(__u32, fllast)
1530 __field(__u32, flcount)
1531 __field(__u32, freeblks)
1532 __field(__u32, longest)
1533 __field(unsigned long, caller_ip)
1534 ),
1535 TP_fast_assign(
1536 __entry->dev = mp->m_super->s_dev;
1537 __entry->agno = be32_to_cpu(agf->agf_seqno),
1538 __entry->flags = flags;
1539 __entry->length = be32_to_cpu(agf->agf_length),
1540 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1541 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1542 __entry->bno_level =
1543 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1544 __entry->cnt_level =
1545 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1546 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1547 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1548 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1549 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1550 __entry->longest = be32_to_cpu(agf->agf_longest);
1551 __entry->caller_ip = caller_ip;
1552 ),
1553 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1554 "levels b %u c %u flfirst %u fllast %u flcount %u "
Scott Wood65dd2972015-03-25 14:56:21 +11001555 "freeblks %u longest %u caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001556 MAJOR(__entry->dev), MINOR(__entry->dev),
1557 __entry->agno,
1558 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1559 __entry->length,
1560 __entry->bno_root,
1561 __entry->cnt_root,
1562 __entry->bno_level,
1563 __entry->cnt_level,
1564 __entry->flfirst,
1565 __entry->fllast,
1566 __entry->flcount,
1567 __entry->freeblks,
1568 __entry->longest,
1569 (void *)__entry->caller_ip)
1570);
1571
1572TRACE_EVENT(xfs_free_extent,
1573 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1574 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1575 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1576 TP_STRUCT__entry(
1577 __field(dev_t, dev)
1578 __field(xfs_agnumber_t, agno)
1579 __field(xfs_agblock_t, agbno)
1580 __field(xfs_extlen_t, len)
1581 __field(int, isfl)
1582 __field(int, haveleft)
1583 __field(int, haveright)
1584 ),
1585 TP_fast_assign(
1586 __entry->dev = mp->m_super->s_dev;
1587 __entry->agno = agno;
1588 __entry->agbno = agbno;
1589 __entry->len = len;
1590 __entry->isfl = isfl;
1591 __entry->haveleft = haveleft;
1592 __entry->haveright = haveright;
1593 ),
1594 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1595 MAJOR(__entry->dev), MINOR(__entry->dev),
1596 __entry->agno,
1597 __entry->agbno,
1598 __entry->len,
1599 __entry->isfl,
1600 __entry->haveleft ?
1601 (__entry->haveright ? "both" : "left") :
1602 (__entry->haveright ? "right" : "none"))
1603
1604);
1605
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001606DECLARE_EVENT_CLASS(xfs_alloc_class,
1607 TP_PROTO(struct xfs_alloc_arg *args),
1608 TP_ARGS(args),
1609 TP_STRUCT__entry(
1610 __field(dev_t, dev)
1611 __field(xfs_agnumber_t, agno)
1612 __field(xfs_agblock_t, agbno)
1613 __field(xfs_extlen_t, minlen)
1614 __field(xfs_extlen_t, maxlen)
1615 __field(xfs_extlen_t, mod)
1616 __field(xfs_extlen_t, prod)
1617 __field(xfs_extlen_t, minleft)
1618 __field(xfs_extlen_t, total)
1619 __field(xfs_extlen_t, alignment)
1620 __field(xfs_extlen_t, minalignslop)
1621 __field(xfs_extlen_t, len)
1622 __field(short, type)
1623 __field(short, otype)
1624 __field(char, wasdel)
1625 __field(char, wasfromfl)
1626 __field(char, isfl)
1627 __field(char, userdata)
1628 __field(xfs_fsblock_t, firstblock)
1629 ),
1630 TP_fast_assign(
1631 __entry->dev = args->mp->m_super->s_dev;
1632 __entry->agno = args->agno;
1633 __entry->agbno = args->agbno;
1634 __entry->minlen = args->minlen;
1635 __entry->maxlen = args->maxlen;
1636 __entry->mod = args->mod;
1637 __entry->prod = args->prod;
1638 __entry->minleft = args->minleft;
1639 __entry->total = args->total;
1640 __entry->alignment = args->alignment;
1641 __entry->minalignslop = args->minalignslop;
1642 __entry->len = args->len;
1643 __entry->type = args->type;
1644 __entry->otype = args->otype;
1645 __entry->wasdel = args->wasdel;
1646 __entry->wasfromfl = args->wasfromfl;
1647 __entry->isfl = args->isfl;
1648 __entry->userdata = args->userdata;
1649 __entry->firstblock = args->firstblock;
1650 ),
1651 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1652 "prod %u minleft %u total %u alignment %u minalignslop %u "
1653 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1654 "userdata %d firstblock 0x%llx",
1655 MAJOR(__entry->dev), MINOR(__entry->dev),
1656 __entry->agno,
1657 __entry->agbno,
1658 __entry->minlen,
1659 __entry->maxlen,
1660 __entry->mod,
1661 __entry->prod,
1662 __entry->minleft,
1663 __entry->total,
1664 __entry->alignment,
1665 __entry->minalignslop,
1666 __entry->len,
1667 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1668 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1669 __entry->wasdel,
1670 __entry->wasfromfl,
1671 __entry->isfl,
1672 __entry->userdata,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001673 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001674)
1675
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001676#define DEFINE_ALLOC_EVENT(name) \
1677DEFINE_EVENT(xfs_alloc_class, name, \
1678 TP_PROTO(struct xfs_alloc_arg *args), \
1679 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001680DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001681DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001682DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1683DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1684DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1685DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1686DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1687DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001688DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1689DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001690DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1691DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1692DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1693DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1694DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001695DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001696DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1697DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1698DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1699DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1700DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1701DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1702DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1703DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1704DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1705
Dave Chinner5a5881c2012-03-22 05:15:13 +00001706DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001707 TP_PROTO(struct xfs_da_args *args),
1708 TP_ARGS(args),
1709 TP_STRUCT__entry(
1710 __field(dev_t, dev)
1711 __field(xfs_ino_t, ino)
1712 __dynamic_array(char, name, args->namelen)
1713 __field(int, namelen)
1714 __field(xfs_dahash_t, hashval)
1715 __field(xfs_ino_t, inumber)
1716 __field(int, op_flags)
1717 ),
1718 TP_fast_assign(
1719 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1720 __entry->ino = args->dp->i_ino;
1721 if (args->namelen)
1722 memcpy(__get_str(name), args->name, args->namelen);
1723 __entry->namelen = args->namelen;
1724 __entry->hashval = args->hashval;
1725 __entry->inumber = args->inumber;
1726 __entry->op_flags = args->op_flags;
1727 ),
1728 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1729 "inumber 0x%llx op_flags %s",
1730 MAJOR(__entry->dev), MINOR(__entry->dev),
1731 __entry->ino,
1732 __entry->namelen,
1733 __entry->namelen ? __get_str(name) : NULL,
1734 __entry->namelen,
1735 __entry->hashval,
1736 __entry->inumber,
1737 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001738)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001739
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001740#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001741DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001742 TP_PROTO(struct xfs_da_args *args), \
1743 TP_ARGS(args))
1744DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1745DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1746DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1747DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1748DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1749DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1750DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1751DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1752DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1753DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1754DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1755DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1756DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1757DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1758DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1759DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1760DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1761DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1762DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1763DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1764DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1765DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1766DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1767DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1768DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1769
Dave Chinneree732592012-11-12 22:53:53 +11001770DECLARE_EVENT_CLASS(xfs_attr_class,
1771 TP_PROTO(struct xfs_da_args *args),
1772 TP_ARGS(args),
1773 TP_STRUCT__entry(
1774 __field(dev_t, dev)
1775 __field(xfs_ino_t, ino)
1776 __dynamic_array(char, name, args->namelen)
1777 __field(int, namelen)
1778 __field(int, valuelen)
1779 __field(xfs_dahash_t, hashval)
1780 __field(int, op_flags)
1781 ),
1782 TP_fast_assign(
1783 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1784 __entry->ino = args->dp->i_ino;
1785 if (args->namelen)
1786 memcpy(__get_str(name), args->name, args->namelen);
1787 __entry->namelen = args->namelen;
1788 __entry->valuelen = args->valuelen;
1789 __entry->hashval = args->hashval;
1790 __entry->op_flags = args->op_flags;
1791 ),
1792 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1793 "hashval 0x%x op_flags %s",
1794 MAJOR(__entry->dev), MINOR(__entry->dev),
1795 __entry->ino,
1796 __entry->namelen,
1797 __entry->namelen ? __get_str(name) : NULL,
1798 __entry->namelen,
1799 __entry->valuelen,
1800 __entry->hashval,
1801 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1802)
1803
Dave Chinner5a5881c2012-03-22 05:15:13 +00001804#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11001805DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001806 TP_PROTO(struct xfs_da_args *args), \
1807 TP_ARGS(args))
1808DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1809DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1810DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1811DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1812DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1813DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
1814DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1815
1816DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1817DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1818DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11001819DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001820DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1821DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11001822DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1823DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001824DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1825DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11001826DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001827DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1828DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1829DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1830DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1831DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1832DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1833DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1834DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1835DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1836DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1837DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001838DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001839
1840DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11001841DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001842DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
1843DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1844DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1845
Dave Chinneree732592012-11-12 22:53:53 +11001846DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1847DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1848
1849DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1850DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1851DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1852
Dave Chinner5a5881c2012-03-22 05:15:13 +00001853#define DEFINE_DA_EVENT(name) \
1854DEFINE_EVENT(xfs_da_class, name, \
1855 TP_PROTO(struct xfs_da_args *args), \
1856 TP_ARGS(args))
1857DEFINE_DA_EVENT(xfs_da_split);
1858DEFINE_DA_EVENT(xfs_da_join);
1859DEFINE_DA_EVENT(xfs_da_link_before);
1860DEFINE_DA_EVENT(xfs_da_link_after);
1861DEFINE_DA_EVENT(xfs_da_unlink_back);
1862DEFINE_DA_EVENT(xfs_da_unlink_forward);
1863DEFINE_DA_EVENT(xfs_da_root_split);
1864DEFINE_DA_EVENT(xfs_da_root_join);
1865DEFINE_DA_EVENT(xfs_da_node_add);
1866DEFINE_DA_EVENT(xfs_da_node_create);
1867DEFINE_DA_EVENT(xfs_da_node_split);
1868DEFINE_DA_EVENT(xfs_da_node_remove);
1869DEFINE_DA_EVENT(xfs_da_node_rebalance);
1870DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001871DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001872DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1873DEFINE_DA_EVENT(xfs_da_grow_inode);
1874DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11001875DEFINE_DA_EVENT(xfs_da_fixhashpath);
1876DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001877
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001878DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1879 TP_PROTO(struct xfs_da_args *args, int idx),
1880 TP_ARGS(args, idx),
1881 TP_STRUCT__entry(
1882 __field(dev_t, dev)
1883 __field(xfs_ino_t, ino)
1884 __field(int, op_flags)
1885 __field(int, idx)
1886 ),
1887 TP_fast_assign(
1888 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1889 __entry->ino = args->dp->i_ino;
1890 __entry->op_flags = args->op_flags;
1891 __entry->idx = idx;
1892 ),
1893 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1894 MAJOR(__entry->dev), MINOR(__entry->dev),
1895 __entry->ino,
1896 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1897 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001898)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001899
1900#define DEFINE_DIR2_SPACE_EVENT(name) \
1901DEFINE_EVENT(xfs_dir2_space_class, name, \
1902 TP_PROTO(struct xfs_da_args *args, int idx), \
1903 TP_ARGS(args, idx))
1904DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1905DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1906DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1907DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001908
1909TRACE_EVENT(xfs_dir2_leafn_moveents,
1910 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1911 TP_ARGS(args, src_idx, dst_idx, count),
1912 TP_STRUCT__entry(
1913 __field(dev_t, dev)
1914 __field(xfs_ino_t, ino)
1915 __field(int, op_flags)
1916 __field(int, src_idx)
1917 __field(int, dst_idx)
1918 __field(int, count)
1919 ),
1920 TP_fast_assign(
1921 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1922 __entry->ino = args->dp->i_ino;
1923 __entry->op_flags = args->op_flags;
1924 __entry->src_idx = src_idx;
1925 __entry->dst_idx = dst_idx;
1926 __entry->count = count;
1927 ),
1928 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1929 "src_idx %d dst_idx %d count %d",
1930 MAJOR(__entry->dev), MINOR(__entry->dev),
1931 __entry->ino,
1932 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1933 __entry->src_idx,
1934 __entry->dst_idx,
1935 __entry->count)
1936);
1937
Dave Chinner3a85cd92010-01-14 01:33:55 +00001938#define XFS_SWAPEXT_INODES \
1939 { 0, "target" }, \
1940 { 1, "temp" }
1941
1942#define XFS_INODE_FORMAT_STR \
1943 { 0, "invalid" }, \
1944 { 1, "local" }, \
1945 { 2, "extent" }, \
1946 { 3, "btree" }
1947
1948DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1949 TP_PROTO(struct xfs_inode *ip, int which),
1950 TP_ARGS(ip, which),
1951 TP_STRUCT__entry(
1952 __field(dev_t, dev)
1953 __field(int, which)
1954 __field(xfs_ino_t, ino)
1955 __field(int, format)
1956 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00001957 __field(int, broot_size)
1958 __field(int, fork_off)
1959 ),
1960 TP_fast_assign(
1961 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1962 __entry->which = which;
1963 __entry->ino = ip->i_ino;
1964 __entry->format = ip->i_d.di_format;
1965 __entry->nex = ip->i_d.di_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00001966 __entry->broot_size = ip->i_df.if_broot_bytes;
1967 __entry->fork_off = XFS_IFORK_BOFF(ip);
1968 ),
1969 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00001970 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00001971 MAJOR(__entry->dev), MINOR(__entry->dev),
1972 __entry->ino,
1973 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1974 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1975 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00001976 __entry->broot_size,
1977 __entry->fork_off)
1978)
1979
1980#define DEFINE_SWAPEXT_EVENT(name) \
1981DEFINE_EVENT(xfs_swap_extent_class, name, \
1982 TP_PROTO(struct xfs_inode *ip, int which), \
1983 TP_ARGS(ip, which))
1984
1985DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1986DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1987
Dave Chinner9abbc532010-04-13 15:06:46 +10001988DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001989 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10001990 struct xlog_recover_item *item, int pass),
1991 TP_ARGS(log, trans, item, pass),
1992 TP_STRUCT__entry(
1993 __field(dev_t, dev)
1994 __field(unsigned long, item)
1995 __field(xlog_tid_t, tid)
1996 __field(int, type)
1997 __field(int, pass)
1998 __field(int, count)
1999 __field(int, total)
2000 ),
2001 TP_fast_assign(
2002 __entry->dev = log->l_mp->m_super->s_dev;
2003 __entry->item = (unsigned long)item;
2004 __entry->tid = trans->r_log_tid;
2005 __entry->type = ITEM_TYPE(item);
2006 __entry->pass = pass;
2007 __entry->count = item->ri_cnt;
2008 __entry->total = item->ri_total;
2009 ),
2010 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
2011 "item region count/total %d/%d",
2012 MAJOR(__entry->dev), MINOR(__entry->dev),
2013 __entry->tid,
2014 __entry->pass,
2015 (void *)__entry->item,
2016 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2017 __entry->count,
2018 __entry->total)
2019)
2020
2021#define DEFINE_LOG_RECOVER_ITEM(name) \
2022DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002023 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10002024 struct xlog_recover_item *item, int pass), \
2025 TP_ARGS(log, trans, item, pass))
2026
2027DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2028DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2029DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2030DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2031DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2032
2033DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002034 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002035 TP_ARGS(log, buf_f),
2036 TP_STRUCT__entry(
2037 __field(dev_t, dev)
2038 __field(__int64_t, blkno)
2039 __field(unsigned short, len)
2040 __field(unsigned short, flags)
2041 __field(unsigned short, size)
2042 __field(unsigned int, map_size)
2043 ),
2044 TP_fast_assign(
2045 __entry->dev = log->l_mp->m_super->s_dev;
2046 __entry->blkno = buf_f->blf_blkno;
2047 __entry->len = buf_f->blf_len;
2048 __entry->flags = buf_f->blf_flags;
2049 __entry->size = buf_f->blf_size;
2050 __entry->map_size = buf_f->blf_map_size;
2051 ),
2052 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2053 "map_size %d",
2054 MAJOR(__entry->dev), MINOR(__entry->dev),
2055 __entry->blkno,
2056 __entry->len,
2057 __entry->flags,
2058 __entry->size,
2059 __entry->map_size)
2060)
2061
2062#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2063DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002064 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002065 TP_ARGS(log, buf_f))
2066
2067DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2068DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2069DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2070DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2071DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2072DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2073DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2074DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2075
2076DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002077 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002078 TP_ARGS(log, in_f),
2079 TP_STRUCT__entry(
2080 __field(dev_t, dev)
2081 __field(xfs_ino_t, ino)
2082 __field(unsigned short, size)
2083 __field(int, fields)
2084 __field(unsigned short, asize)
2085 __field(unsigned short, dsize)
2086 __field(__int64_t, blkno)
2087 __field(int, len)
2088 __field(int, boffset)
2089 ),
2090 TP_fast_assign(
2091 __entry->dev = log->l_mp->m_super->s_dev;
2092 __entry->ino = in_f->ilf_ino;
2093 __entry->size = in_f->ilf_size;
2094 __entry->fields = in_f->ilf_fields;
2095 __entry->asize = in_f->ilf_asize;
2096 __entry->dsize = in_f->ilf_dsize;
2097 __entry->blkno = in_f->ilf_blkno;
2098 __entry->len = in_f->ilf_len;
2099 __entry->boffset = in_f->ilf_boffset;
2100 ),
2101 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2102 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2103 MAJOR(__entry->dev), MINOR(__entry->dev),
2104 __entry->ino,
2105 __entry->size,
2106 __entry->fields,
2107 __entry->asize,
2108 __entry->dsize,
2109 __entry->blkno,
2110 __entry->len,
2111 __entry->boffset)
2112)
2113#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2114DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002115 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002116 TP_ARGS(log, in_f))
2117
2118DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2119DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2120DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2121
Brian Foster78d57e42015-08-19 09:58:48 +10002122DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2123 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2124 TP_ARGS(log, in_f),
2125 TP_STRUCT__entry(
2126 __field(dev_t, dev)
2127 __field(xfs_agnumber_t, agno)
2128 __field(xfs_agblock_t, agbno)
2129 __field(unsigned int, count)
2130 __field(unsigned int, isize)
2131 __field(xfs_agblock_t, length)
2132 __field(unsigned int, gen)
2133 ),
2134 TP_fast_assign(
2135 __entry->dev = log->l_mp->m_super->s_dev;
2136 __entry->agno = be32_to_cpu(in_f->icl_ag);
2137 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2138 __entry->count = be32_to_cpu(in_f->icl_count);
2139 __entry->isize = be32_to_cpu(in_f->icl_isize);
2140 __entry->length = be32_to_cpu(in_f->icl_length);
2141 __entry->gen = be32_to_cpu(in_f->icl_gen);
2142 ),
2143 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2144 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
2145 __entry->agno, __entry->agbno, __entry->count, __entry->isize,
2146 __entry->length, __entry->gen)
2147)
2148#define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2149DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2150 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2151 TP_ARGS(log, in_f))
2152
2153DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2154DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2155
Christoph Hellwiga46db602011-01-07 13:02:04 +00002156DECLARE_EVENT_CLASS(xfs_discard_class,
2157 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2158 xfs_agblock_t agbno, xfs_extlen_t len),
2159 TP_ARGS(mp, agno, agbno, len),
2160 TP_STRUCT__entry(
2161 __field(dev_t, dev)
2162 __field(xfs_agnumber_t, agno)
2163 __field(xfs_agblock_t, agbno)
2164 __field(xfs_extlen_t, len)
2165 ),
2166 TP_fast_assign(
2167 __entry->dev = mp->m_super->s_dev;
2168 __entry->agno = agno;
2169 __entry->agbno = agbno;
2170 __entry->len = len;
2171 ),
2172 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
2173 MAJOR(__entry->dev), MINOR(__entry->dev),
2174 __entry->agno,
2175 __entry->agbno,
2176 __entry->len)
2177)
2178
2179#define DEFINE_DISCARD_EVENT(name) \
2180DEFINE_EVENT(xfs_discard_class, name, \
2181 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2182 xfs_agblock_t agbno, xfs_extlen_t len), \
2183 TP_ARGS(mp, agno, agbno, len))
2184DEFINE_DISCARD_EVENT(xfs_discard_extent);
2185DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2186DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2187DEFINE_DISCARD_EVENT(xfs_discard_busy);
2188
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002189/* btree cursor events */
2190DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2191 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2192 TP_ARGS(cur, level, bp),
2193 TP_STRUCT__entry(
2194 __field(dev_t, dev)
2195 __field(xfs_btnum_t, btnum)
2196 __field(int, level)
2197 __field(int, nlevels)
2198 __field(int, ptr)
2199 __field(xfs_daddr_t, daddr)
2200 ),
2201 TP_fast_assign(
2202 __entry->dev = cur->bc_mp->m_super->s_dev;
2203 __entry->btnum = cur->bc_btnum;
2204 __entry->level = level;
2205 __entry->nlevels = cur->bc_nlevels;
2206 __entry->ptr = cur->bc_ptrs[level];
2207 __entry->daddr = bp ? bp->b_bn : -1;
2208 ),
2209 TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
2210 MAJOR(__entry->dev), MINOR(__entry->dev),
2211 __entry->btnum,
2212 __entry->level,
2213 __entry->nlevels,
2214 __entry->ptr,
2215 (unsigned long long)__entry->daddr)
2216)
2217
2218#define DEFINE_BTREE_CUR_EVENT(name) \
2219DEFINE_EVENT(xfs_btree_cur_class, name, \
2220 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2221 TP_ARGS(cur, level, bp))
2222DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
Darrick J. Wong105f7d82016-08-03 11:10:21 +10002223DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002224
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002225/* deferred ops */
2226struct xfs_defer_pending;
2227struct xfs_defer_intake;
2228struct xfs_defer_ops;
2229
2230DECLARE_EVENT_CLASS(xfs_defer_class,
2231 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop),
2232 TP_ARGS(mp, dop),
2233 TP_STRUCT__entry(
2234 __field(dev_t, dev)
2235 __field(void *, dop)
2236 __field(bool, committed)
2237 __field(bool, low)
2238 ),
2239 TP_fast_assign(
2240 __entry->dev = mp ? mp->m_super->s_dev : 0;
2241 __entry->dop = dop;
2242 __entry->committed = dop->dop_committed;
2243 __entry->low = dop->dop_low;
2244 ),
2245 TP_printk("dev %d:%d ops %p committed %d low %d\n",
2246 MAJOR(__entry->dev), MINOR(__entry->dev),
2247 __entry->dop,
2248 __entry->committed,
2249 __entry->low)
2250)
2251#define DEFINE_DEFER_EVENT(name) \
2252DEFINE_EVENT(xfs_defer_class, name, \
2253 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \
2254 TP_ARGS(mp, dop))
2255
2256DECLARE_EVENT_CLASS(xfs_defer_error_class,
2257 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error),
2258 TP_ARGS(mp, dop, error),
2259 TP_STRUCT__entry(
2260 __field(dev_t, dev)
2261 __field(void *, dop)
2262 __field(bool, committed)
2263 __field(bool, low)
2264 __field(int, error)
2265 ),
2266 TP_fast_assign(
2267 __entry->dev = mp ? mp->m_super->s_dev : 0;
2268 __entry->dop = dop;
2269 __entry->committed = dop->dop_committed;
2270 __entry->low = dop->dop_low;
2271 __entry->error = error;
2272 ),
2273 TP_printk("dev %d:%d ops %p committed %d low %d err %d\n",
2274 MAJOR(__entry->dev), MINOR(__entry->dev),
2275 __entry->dop,
2276 __entry->committed,
2277 __entry->low,
2278 __entry->error)
2279)
2280#define DEFINE_DEFER_ERROR_EVENT(name) \
2281DEFINE_EVENT(xfs_defer_error_class, name, \
2282 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \
2283 TP_ARGS(mp, dop, error))
2284
2285DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2286 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2287 TP_ARGS(mp, dfp),
2288 TP_STRUCT__entry(
2289 __field(dev_t, dev)
2290 __field(int, type)
2291 __field(void *, intent)
2292 __field(bool, committed)
2293 __field(int, nr)
2294 ),
2295 TP_fast_assign(
2296 __entry->dev = mp ? mp->m_super->s_dev : 0;
2297 __entry->type = dfp->dfp_type->type;
2298 __entry->intent = dfp->dfp_intent;
2299 __entry->committed = dfp->dfp_committed;
2300 __entry->nr = dfp->dfp_count;
2301 ),
2302 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d\n",
2303 MAJOR(__entry->dev), MINOR(__entry->dev),
2304 __entry->type,
2305 __entry->intent,
2306 __entry->committed,
2307 __entry->nr)
2308)
2309#define DEFINE_DEFER_PENDING_EVENT(name) \
2310DEFINE_EVENT(xfs_defer_pending_class, name, \
2311 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2312 TP_ARGS(mp, dfp))
2313
2314DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2315 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2316 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2317 TP_ARGS(mp, agno, type, agbno, len),
2318 TP_STRUCT__entry(
2319 __field(dev_t, dev)
2320 __field(xfs_agnumber_t, agno)
2321 __field(int, type)
2322 __field(xfs_agblock_t, agbno)
2323 __field(xfs_extlen_t, len)
2324 ),
2325 TP_fast_assign(
2326 __entry->dev = mp->m_super->s_dev;
2327 __entry->agno = agno;
2328 __entry->type = type;
2329 __entry->agbno = agbno;
2330 __entry->len = len;
2331 ),
2332 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2333 MAJOR(__entry->dev), MINOR(__entry->dev),
2334 __entry->type,
2335 __entry->agno,
2336 __entry->agbno,
2337 __entry->len)
2338);
2339#define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2340DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2341 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2342 int type, \
2343 xfs_agblock_t bno, \
2344 xfs_extlen_t len), \
2345 TP_ARGS(mp, agno, type, bno, len))
2346
2347DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2348 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2349 int op,
2350 xfs_agblock_t agbno,
2351 xfs_ino_t ino,
2352 int whichfork,
2353 xfs_fileoff_t offset,
2354 xfs_filblks_t len,
2355 xfs_exntst_t state),
2356 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2357 TP_STRUCT__entry(
2358 __field(dev_t, dev)
2359 __field(xfs_agnumber_t, agno)
2360 __field(xfs_ino_t, ino)
2361 __field(xfs_agblock_t, agbno)
2362 __field(int, whichfork)
2363 __field(xfs_fileoff_t, l_loff)
2364 __field(xfs_filblks_t, l_len)
2365 __field(xfs_exntst_t, l_state)
2366 __field(int, op)
2367 ),
2368 TP_fast_assign(
2369 __entry->dev = mp->m_super->s_dev;
2370 __entry->agno = agno;
2371 __entry->ino = ino;
2372 __entry->agbno = agbno;
2373 __entry->whichfork = whichfork;
2374 __entry->l_loff = offset;
2375 __entry->l_len = len;
2376 __entry->l_state = state;
2377 __entry->op = op;
2378 ),
2379 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2380 MAJOR(__entry->dev), MINOR(__entry->dev),
2381 __entry->op,
2382 __entry->agno,
2383 __entry->agbno,
2384 __entry->ino,
2385 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
2386 __entry->l_loff,
2387 __entry->l_len,
2388 __entry->l_state)
2389);
2390#define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2391DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2392 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2393 int op, \
2394 xfs_agblock_t agbno, \
2395 xfs_ino_t ino, \
2396 int whichfork, \
2397 xfs_fileoff_t offset, \
2398 xfs_filblks_t len, \
2399 xfs_exntst_t state), \
2400 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2401
2402DEFINE_DEFER_EVENT(xfs_defer_init);
2403DEFINE_DEFER_EVENT(xfs_defer_cancel);
2404DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2405DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2406DEFINE_DEFER_EVENT(xfs_defer_finish);
2407DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2408
2409DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2410DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2411DEFINE_DEFER_ERROR_EVENT(xfs_defer_op_finish_error);
2412
2413DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work);
2414DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel);
2415DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_commit);
2416DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel);
2417DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2418DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2419
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002420DEFINE_MAP_EXTENT_DEFERRED_EVENT(xfs_defer_map_extent);
2421
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002422#define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2423DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2424DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2425
Darrick J. Wong673930c2016-08-03 11:33:43 +10002426/* rmap tracepoints */
2427DECLARE_EVENT_CLASS(xfs_rmap_class,
2428 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2429 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
2430 struct xfs_owner_info *oinfo),
2431 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2432 TP_STRUCT__entry(
2433 __field(dev_t, dev)
2434 __field(xfs_agnumber_t, agno)
2435 __field(xfs_agblock_t, agbno)
2436 __field(xfs_extlen_t, len)
2437 __field(uint64_t, owner)
2438 __field(uint64_t, offset)
2439 __field(unsigned long, flags)
2440 ),
2441 TP_fast_assign(
2442 __entry->dev = mp->m_super->s_dev;
2443 __entry->agno = agno;
2444 __entry->agbno = agbno;
2445 __entry->len = len;
2446 __entry->owner = oinfo->oi_owner;
2447 __entry->offset = oinfo->oi_offset;
2448 __entry->flags = oinfo->oi_flags;
Darrick J. Wong035e00a2016-08-03 11:36:07 +10002449 if (unwritten)
2450 __entry->flags |= XFS_RMAP_UNWRITTEN;
Darrick J. Wong673930c2016-08-03 11:33:43 +10002451 ),
2452 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2453 MAJOR(__entry->dev), MINOR(__entry->dev),
2454 __entry->agno,
2455 __entry->agbno,
2456 __entry->len,
2457 __entry->owner,
2458 __entry->offset,
2459 __entry->flags)
2460);
2461#define DEFINE_RMAP_EVENT(name) \
2462DEFINE_EVENT(xfs_rmap_class, name, \
2463 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2464 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2465 struct xfs_owner_info *oinfo), \
2466 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2467
2468/* simple AG-based error/%ip tracepoint class */
2469DECLARE_EVENT_CLASS(xfs_ag_error_class,
2470 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2471 unsigned long caller_ip),
2472 TP_ARGS(mp, agno, error, caller_ip),
2473 TP_STRUCT__entry(
2474 __field(dev_t, dev)
2475 __field(xfs_agnumber_t, agno)
2476 __field(int, error)
2477 __field(unsigned long, caller_ip)
2478 ),
2479 TP_fast_assign(
2480 __entry->dev = mp->m_super->s_dev;
2481 __entry->agno = agno;
2482 __entry->error = error;
2483 __entry->caller_ip = caller_ip;
2484 ),
2485 TP_printk("dev %d:%d agno %u error %d caller %ps",
2486 MAJOR(__entry->dev), MINOR(__entry->dev),
2487 __entry->agno,
2488 __entry->error,
2489 (char *)__entry->caller_ip)
2490);
2491
2492#define DEFINE_AG_ERROR_EVENT(name) \
2493DEFINE_EVENT(xfs_ag_error_class, name, \
2494 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2495 unsigned long caller_ip), \
2496 TP_ARGS(mp, agno, error, caller_ip))
2497
2498DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2499DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2500DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2501DEFINE_RMAP_EVENT(xfs_rmap_map);
2502DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2503DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
2504
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00002505#endif /* _TRACE_XFS_H */
2506
2507#undef TRACE_INCLUDE_PATH
2508#define TRACE_INCLUDE_PATH .
2509#define TRACE_INCLUDE_FILE xfs_trace
2510#include <trace/define_trace.h>