blob: 8446338929f62f28715bf395b8fd498f98d138c0 [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
Darrick J. Wongc75c7522016-10-03 09:11:15 -070043#ifndef XFS_REFCOUNT_IREC_PLACEHOLDER
44#define XFS_REFCOUNT_IREC_PLACEHOLDER
45/* Placeholder definition to avoid breaking bisectability. */
46struct xfs_refcount_irec {
47 xfs_agblock_t rc_startblock; /* starting block number */
48 xfs_extlen_t rc_blockcount; /* count of free blocks */
49 xfs_nlink_t rc_refcount; /* number of inodes linked here */
50};
51#endif
52
Christoph Hellwigea9a4882009-12-21 14:03:03 +000053DECLARE_EVENT_CLASS(xfs_attr_list_class,
54 TP_PROTO(struct xfs_attr_list_context *ctx),
55 TP_ARGS(ctx),
56 TP_STRUCT__entry(
57 __field(dev_t, dev)
58 __field(xfs_ino_t, ino)
59 __field(u32, hashval)
60 __field(u32, blkno)
61 __field(u32, offset)
62 __field(void *, alist)
63 __field(int, bufsize)
64 __field(int, count)
65 __field(int, firstu)
66 __field(int, dupcnt)
67 __field(int, flags)
68 ),
69 TP_fast_assign(
70 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
71 __entry->ino = ctx->dp->i_ino;
72 __entry->hashval = ctx->cursor->hashval;
73 __entry->blkno = ctx->cursor->blkno;
74 __entry->offset = ctx->cursor->offset;
75 __entry->alist = ctx->alist;
76 __entry->bufsize = ctx->bufsize;
77 __entry->count = ctx->count;
78 __entry->firstu = ctx->firstu;
79 __entry->flags = ctx->flags;
80 ),
81 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
82 "alist 0x%p size %u count %u firstu %u flags %d %s",
83 MAJOR(__entry->dev), MINOR(__entry->dev),
84 __entry->ino,
85 __entry->hashval,
86 __entry->blkno,
87 __entry->offset,
88 __entry->dupcnt,
89 __entry->alist,
90 __entry->bufsize,
91 __entry->count,
92 __entry->firstu,
93 __entry->flags,
94 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
95 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000096)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000097
98#define DEFINE_ATTR_LIST_EVENT(name) \
99DEFINE_EVENT(xfs_attr_list_class, name, \
100 TP_PROTO(struct xfs_attr_list_context *ctx), \
101 TP_ARGS(ctx))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000102DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
103DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
104DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
105DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
106DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
107DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
108DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
109DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
Dave Chinneree732592012-11-12 22:53:53 +1100110DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
111DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000112
Li Zefanf8adb4d2010-05-24 08:25:57 +0000113DECLARE_EVENT_CLASS(xfs_perag_class,
114 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
115 unsigned long caller_ip),
116 TP_ARGS(mp, agno, refcount, caller_ip),
117 TP_STRUCT__entry(
118 __field(dev_t, dev)
119 __field(xfs_agnumber_t, agno)
120 __field(int, refcount)
121 __field(unsigned long, caller_ip)
122 ),
123 TP_fast_assign(
124 __entry->dev = mp->m_super->s_dev;
125 __entry->agno = agno;
126 __entry->refcount = refcount;
127 __entry->caller_ip = caller_ip;
128 ),
Scott Wood65dd2972015-03-25 14:56:21 +1100129 TP_printk("dev %d:%d agno %u refcount %d caller %ps",
Li Zefanf8adb4d2010-05-24 08:25:57 +0000130 MAJOR(__entry->dev), MINOR(__entry->dev),
131 __entry->agno,
132 __entry->refcount,
133 (char *)__entry->caller_ip)
134);
135
136#define DEFINE_PERAG_REF_EVENT(name) \
137DEFINE_EVENT(xfs_perag_class, name, \
138 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
139 unsigned long caller_ip), \
140 TP_ARGS(mp, agno, refcount, caller_ip))
141DEFINE_PERAG_REF_EVENT(xfs_perag_get);
Dave Chinner65d0f202010-09-24 18:40:15 +1000142DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000143DEFINE_PERAG_REF_EVENT(xfs_perag_put);
Dave Chinner16fd5362010-07-20 09:43:39 +1000144DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
145DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
Brian Foster27b52862012-11-06 09:50:38 -0500146DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
147DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000148
Dave Chinnerd1230312013-11-01 15:27:19 +1100149DECLARE_EVENT_CLASS(xfs_ag_class,
150 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
151 TP_ARGS(mp, agno),
152 TP_STRUCT__entry(
153 __field(dev_t, dev)
154 __field(xfs_agnumber_t, agno)
155 ),
156 TP_fast_assign(
157 __entry->dev = mp->m_super->s_dev;
158 __entry->agno = agno;
159 ),
160 TP_printk("dev %d:%d agno %u",
161 MAJOR(__entry->dev), MINOR(__entry->dev),
162 __entry->agno)
163);
164#define DEFINE_AG_EVENT(name) \
165DEFINE_EVENT(xfs_ag_class, name, \
166 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
167 TP_ARGS(mp, agno))
168
169DEFINE_AG_EVENT(xfs_read_agf);
170DEFINE_AG_EVENT(xfs_alloc_read_agf);
171DEFINE_AG_EVENT(xfs_read_agi);
172DEFINE_AG_EVENT(xfs_ialloc_read_agi);
173
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000174TRACE_EVENT(xfs_attr_list_node_descend,
175 TP_PROTO(struct xfs_attr_list_context *ctx,
176 struct xfs_da_node_entry *btree),
177 TP_ARGS(ctx, btree),
178 TP_STRUCT__entry(
179 __field(dev_t, dev)
180 __field(xfs_ino_t, ino)
181 __field(u32, hashval)
182 __field(u32, blkno)
183 __field(u32, offset)
184 __field(void *, alist)
185 __field(int, bufsize)
186 __field(int, count)
187 __field(int, firstu)
188 __field(int, dupcnt)
189 __field(int, flags)
190 __field(u32, bt_hashval)
191 __field(u32, bt_before)
192 ),
193 TP_fast_assign(
194 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
195 __entry->ino = ctx->dp->i_ino;
196 __entry->hashval = ctx->cursor->hashval;
197 __entry->blkno = ctx->cursor->blkno;
198 __entry->offset = ctx->cursor->offset;
199 __entry->alist = ctx->alist;
200 __entry->bufsize = ctx->bufsize;
201 __entry->count = ctx->count;
202 __entry->firstu = ctx->firstu;
203 __entry->flags = ctx->flags;
204 __entry->bt_hashval = be32_to_cpu(btree->hashval);
205 __entry->bt_before = be32_to_cpu(btree->before);
206 ),
207 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
208 "alist 0x%p size %u count %u firstu %u flags %d %s "
209 "node hashval %u, node before %u",
210 MAJOR(__entry->dev), MINOR(__entry->dev),
211 __entry->ino,
212 __entry->hashval,
213 __entry->blkno,
214 __entry->offset,
215 __entry->dupcnt,
216 __entry->alist,
217 __entry->bufsize,
218 __entry->count,
219 __entry->firstu,
220 __entry->flags,
221 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
222 __entry->bt_hashval,
223 __entry->bt_before)
224);
225
226TRACE_EVENT(xfs_iext_insert,
227 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
228 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
229 TP_ARGS(ip, idx, r, state, caller_ip),
230 TP_STRUCT__entry(
231 __field(dev_t, dev)
232 __field(xfs_ino_t, ino)
233 __field(xfs_extnum_t, idx)
234 __field(xfs_fileoff_t, startoff)
235 __field(xfs_fsblock_t, startblock)
236 __field(xfs_filblks_t, blockcount)
237 __field(xfs_exntst_t, state)
238 __field(int, bmap_state)
239 __field(unsigned long, caller_ip)
240 ),
241 TP_fast_assign(
242 __entry->dev = VFS_I(ip)->i_sb->s_dev;
243 __entry->ino = ip->i_ino;
244 __entry->idx = idx;
245 __entry->startoff = r->br_startoff;
246 __entry->startblock = r->br_startblock;
247 __entry->blockcount = r->br_blockcount;
248 __entry->state = r->br_state;
249 __entry->bmap_state = state;
250 __entry->caller_ip = caller_ip;
251 ),
252 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Scott Wood65dd2972015-03-25 14:56:21 +1100253 "offset %lld block %lld count %lld flag %d caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000254 MAJOR(__entry->dev), MINOR(__entry->dev),
255 __entry->ino,
256 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
257 (long)__entry->idx,
258 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000259 (__int64_t)__entry->startblock,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000260 __entry->blockcount,
261 __entry->state,
262 (char *)__entry->caller_ip)
263);
264
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000265DECLARE_EVENT_CLASS(xfs_bmap_class,
266 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
267 unsigned long caller_ip),
268 TP_ARGS(ip, idx, state, caller_ip),
269 TP_STRUCT__entry(
270 __field(dev_t, dev)
271 __field(xfs_ino_t, ino)
272 __field(xfs_extnum_t, idx)
273 __field(xfs_fileoff_t, startoff)
274 __field(xfs_fsblock_t, startblock)
275 __field(xfs_filblks_t, blockcount)
276 __field(xfs_exntst_t, state)
277 __field(int, bmap_state)
278 __field(unsigned long, caller_ip)
279 ),
280 TP_fast_assign(
281 struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ?
282 ip->i_afp : &ip->i_df;
283 struct xfs_bmbt_irec r;
284
285 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
286 __entry->dev = VFS_I(ip)->i_sb->s_dev;
287 __entry->ino = ip->i_ino;
288 __entry->idx = idx;
289 __entry->startoff = r.br_startoff;
290 __entry->startblock = r.br_startblock;
291 __entry->blockcount = r.br_blockcount;
292 __entry->state = r.br_state;
293 __entry->bmap_state = state;
294 __entry->caller_ip = caller_ip;
295 ),
296 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Scott Wood65dd2972015-03-25 14:56:21 +1100297 "offset %lld block %lld count %lld flag %d caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000298 MAJOR(__entry->dev), MINOR(__entry->dev),
299 __entry->ino,
300 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
301 (long)__entry->idx,
302 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000303 (__int64_t)__entry->startblock,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000304 __entry->blockcount,
305 __entry->state,
306 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000307)
308
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000309#define DEFINE_BMAP_EVENT(name) \
310DEFINE_EVENT(xfs_bmap_class, name, \
311 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
312 unsigned long caller_ip), \
313 TP_ARGS(ip, idx, state, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000314DEFINE_BMAP_EVENT(xfs_iext_remove);
315DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
316DEFINE_BMAP_EVENT(xfs_bmap_post_update);
317DEFINE_BMAP_EVENT(xfs_extlist);
318
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000319DECLARE_EVENT_CLASS(xfs_buf_class,
320 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
321 TP_ARGS(bp, caller_ip),
322 TP_STRUCT__entry(
323 __field(dev_t, dev)
324 __field(xfs_daddr_t, bno)
Dave Chinner4e94b712012-04-23 15:58:51 +1000325 __field(int, nblks)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000326 __field(int, hold)
327 __field(int, pincount)
328 __field(unsigned, lockval)
329 __field(unsigned, flags)
330 __field(unsigned long, caller_ip)
331 ),
332 TP_fast_assign(
333 __entry->dev = bp->b_target->bt_dev;
334 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000335 __entry->nblks = bp->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000336 __entry->hold = atomic_read(&bp->b_hold);
337 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200338 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000339 __entry->flags = bp->b_flags;
340 __entry->caller_ip = caller_ip;
341 ),
Dave Chinner4e94b712012-04-23 15:58:51 +1000342 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
Scott Wood65dd2972015-03-25 14:56:21 +1100343 "lock %d flags %s caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000344 MAJOR(__entry->dev), MINOR(__entry->dev),
345 (unsigned long long)__entry->bno,
Dave Chinner4e94b712012-04-23 15:58:51 +1000346 __entry->nblks,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000347 __entry->hold,
348 __entry->pincount,
349 __entry->lockval,
350 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
351 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000352)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000353
354#define DEFINE_BUF_EVENT(name) \
355DEFINE_EVENT(xfs_buf_class, name, \
356 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
357 TP_ARGS(bp, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000358DEFINE_BUF_EVENT(xfs_buf_init);
359DEFINE_BUF_EVENT(xfs_buf_free);
360DEFINE_BUF_EVENT(xfs_buf_hold);
361DEFINE_BUF_EVENT(xfs_buf_rele);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000362DEFINE_BUF_EVENT(xfs_buf_iodone);
Dave Chinner595bff72014-10-02 09:05:14 +1000363DEFINE_BUF_EVENT(xfs_buf_submit);
364DEFINE_BUF_EVENT(xfs_buf_submit_wait);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000365DEFINE_BUF_EVENT(xfs_buf_bawrite);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000366DEFINE_BUF_EVENT(xfs_buf_lock);
367DEFINE_BUF_EVENT(xfs_buf_lock_done);
Darrick J. Wong479c6412016-06-21 11:53:28 +1000368DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200369DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000370DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000371DEFINE_BUF_EVENT(xfs_buf_iowait);
372DEFINE_BUF_EVENT(xfs_buf_iowait_done);
373DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000374DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000375DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Dave Chinner686865f2010-09-24 20:07:47 +1000376DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000377DEFINE_BUF_EVENT(xfs_bdstrat_shut);
378DEFINE_BUF_EVENT(xfs_buf_item_relse);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000379DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
380DEFINE_BUF_EVENT(xfs_buf_error_relse);
Dave Chinner9f878322013-01-21 23:53:55 +1100381DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000382DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
383DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
384
385/* not really buffer traces, but the buf provides useful information */
386DEFINE_BUF_EVENT(xfs_btree_corrupt);
387DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
388DEFINE_BUF_EVENT(xfs_reset_dqcounts);
389DEFINE_BUF_EVENT(xfs_inode_item_push);
390
391/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000392DECLARE_EVENT_CLASS(xfs_buf_flags_class,
393 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
394 TP_ARGS(bp, flags, caller_ip),
395 TP_STRUCT__entry(
396 __field(dev_t, dev)
397 __field(xfs_daddr_t, bno)
398 __field(size_t, buffer_length)
399 __field(int, hold)
400 __field(int, pincount)
401 __field(unsigned, lockval)
402 __field(unsigned, flags)
403 __field(unsigned long, caller_ip)
404 ),
405 TP_fast_assign(
406 __entry->dev = bp->b_target->bt_dev;
407 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000408 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000409 __entry->flags = flags;
410 __entry->hold = atomic_read(&bp->b_hold);
411 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200412 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000413 __entry->caller_ip = caller_ip;
414 ),
415 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Scott Wood65dd2972015-03-25 14:56:21 +1100416 "lock %d flags %s caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000417 MAJOR(__entry->dev), MINOR(__entry->dev),
418 (unsigned long long)__entry->bno,
419 __entry->buffer_length,
420 __entry->hold,
421 __entry->pincount,
422 __entry->lockval,
423 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
424 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000425)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000426
427#define DEFINE_BUF_FLAGS_EVENT(name) \
428DEFINE_EVENT(xfs_buf_flags_class, name, \
429 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
430 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000431DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
432DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
433DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
434
435TRACE_EVENT(xfs_buf_ioerror,
436 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
437 TP_ARGS(bp, error, caller_ip),
438 TP_STRUCT__entry(
439 __field(dev_t, dev)
440 __field(xfs_daddr_t, bno)
441 __field(size_t, buffer_length)
442 __field(unsigned, flags)
443 __field(int, hold)
444 __field(int, pincount)
445 __field(unsigned, lockval)
446 __field(int, error)
447 __field(unsigned long, caller_ip)
448 ),
449 TP_fast_assign(
450 __entry->dev = bp->b_target->bt_dev;
451 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000452 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000453 __entry->hold = atomic_read(&bp->b_hold);
454 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200455 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000456 __entry->error = error;
457 __entry->flags = bp->b_flags;
458 __entry->caller_ip = caller_ip;
459 ),
460 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Scott Wood65dd2972015-03-25 14:56:21 +1100461 "lock %d error %d flags %s caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000462 MAJOR(__entry->dev), MINOR(__entry->dev),
463 (unsigned long long)__entry->bno,
464 __entry->buffer_length,
465 __entry->hold,
466 __entry->pincount,
467 __entry->lockval,
468 __entry->error,
469 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
470 (void *)__entry->caller_ip)
471);
472
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000473DECLARE_EVENT_CLASS(xfs_buf_item_class,
474 TP_PROTO(struct xfs_buf_log_item *bip),
475 TP_ARGS(bip),
476 TP_STRUCT__entry(
477 __field(dev_t, dev)
478 __field(xfs_daddr_t, buf_bno)
479 __field(size_t, buf_len)
480 __field(int, buf_hold)
481 __field(int, buf_pincount)
482 __field(int, buf_lockval)
483 __field(unsigned, buf_flags)
484 __field(unsigned, bli_recur)
485 __field(int, bli_refcount)
486 __field(unsigned, bli_flags)
487 __field(void *, li_desc)
488 __field(unsigned, li_flags)
489 ),
490 TP_fast_assign(
491 __entry->dev = bip->bli_buf->b_target->bt_dev;
492 __entry->bli_flags = bip->bli_flags;
493 __entry->bli_recur = bip->bli_recur;
494 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
495 __entry->buf_bno = bip->bli_buf->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000496 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000497 __entry->buf_flags = bip->bli_buf->b_flags;
498 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
499 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200500 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000501 __entry->li_desc = bip->bli_item.li_desc;
502 __entry->li_flags = bip->bli_item.li_flags;
503 ),
504 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
505 "lock %d flags %s recur %d refcount %d bliflags %s "
506 "lidesc 0x%p liflags %s",
507 MAJOR(__entry->dev), MINOR(__entry->dev),
508 (unsigned long long)__entry->buf_bno,
509 __entry->buf_len,
510 __entry->buf_hold,
511 __entry->buf_pincount,
512 __entry->buf_lockval,
513 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
514 __entry->bli_recur,
515 __entry->bli_refcount,
516 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
517 __entry->li_desc,
518 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000519)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000520
521#define DEFINE_BUF_ITEM_EVENT(name) \
522DEFINE_EVENT(xfs_buf_item_class, name, \
523 TP_PROTO(struct xfs_buf_log_item *bip), \
524 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000525DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000526DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000527DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
528DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000529DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000530DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000531DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000532DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
533DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
534DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000535DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
536DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
537DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
538DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
539DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
540DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
541DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
542DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
543DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
544DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
545DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
546DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
547DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
548DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
549DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
550DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000551DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000552
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000553DECLARE_EVENT_CLASS(xfs_filestream_class,
554 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
555 TP_ARGS(ip, agno),
556 TP_STRUCT__entry(
557 __field(dev_t, dev)
558 __field(xfs_ino_t, ino)
559 __field(xfs_agnumber_t, agno)
560 __field(int, streams)
561 ),
562 TP_fast_assign(
563 __entry->dev = VFS_I(ip)->i_sb->s_dev;
564 __entry->ino = ip->i_ino;
565 __entry->agno = agno;
566 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
567 ),
568 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
569 MAJOR(__entry->dev), MINOR(__entry->dev),
570 __entry->ino,
571 __entry->agno,
572 __entry->streams)
573)
574#define DEFINE_FILESTREAM_EVENT(name) \
575DEFINE_EVENT(xfs_filestream_class, name, \
576 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
577 TP_ARGS(ip, agno))
578DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
579DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
580DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
581
582TRACE_EVENT(xfs_filestream_pick,
583 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
584 xfs_extlen_t free, int nscan),
585 TP_ARGS(ip, agno, free, nscan),
586 TP_STRUCT__entry(
587 __field(dev_t, dev)
588 __field(xfs_ino_t, ino)
589 __field(xfs_agnumber_t, agno)
590 __field(int, streams)
591 __field(xfs_extlen_t, free)
592 __field(int, nscan)
593 ),
594 TP_fast_assign(
595 __entry->dev = VFS_I(ip)->i_sb->s_dev;
596 __entry->ino = ip->i_ino;
597 __entry->agno = agno;
598 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
599 __entry->free = free;
600 __entry->nscan = nscan;
601 ),
602 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
603 MAJOR(__entry->dev), MINOR(__entry->dev),
604 __entry->ino,
605 __entry->agno,
606 __entry->streams,
607 __entry->free,
608 __entry->nscan)
609);
610
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000611DECLARE_EVENT_CLASS(xfs_lock_class,
612 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
613 unsigned long caller_ip),
614 TP_ARGS(ip, lock_flags, caller_ip),
615 TP_STRUCT__entry(
616 __field(dev_t, dev)
617 __field(xfs_ino_t, ino)
618 __field(int, lock_flags)
619 __field(unsigned long, caller_ip)
620 ),
621 TP_fast_assign(
622 __entry->dev = VFS_I(ip)->i_sb->s_dev;
623 __entry->ino = ip->i_ino;
624 __entry->lock_flags = lock_flags;
625 __entry->caller_ip = caller_ip;
626 ),
Scott Wood65dd2972015-03-25 14:56:21 +1100627 TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000628 MAJOR(__entry->dev), MINOR(__entry->dev),
629 __entry->ino,
630 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
631 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000632)
633
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000634#define DEFINE_LOCK_EVENT(name) \
635DEFINE_EVENT(xfs_lock_class, name, \
636 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
637 unsigned long caller_ip), \
638 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000639DEFINE_LOCK_EVENT(xfs_ilock);
640DEFINE_LOCK_EVENT(xfs_ilock_nowait);
641DEFINE_LOCK_EVENT(xfs_ilock_demote);
642DEFINE_LOCK_EVENT(xfs_iunlock);
643
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000644DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000645 TP_PROTO(struct xfs_inode *ip),
646 TP_ARGS(ip),
647 TP_STRUCT__entry(
648 __field(dev_t, dev)
649 __field(xfs_ino_t, ino)
650 ),
651 TP_fast_assign(
652 __entry->dev = VFS_I(ip)->i_sb->s_dev;
653 __entry->ino = ip->i_ino;
654 ),
655 TP_printk("dev %d:%d ino 0x%llx",
656 MAJOR(__entry->dev), MINOR(__entry->dev),
657 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000658)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000659
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000660#define DEFINE_INODE_EVENT(name) \
661DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000662 TP_PROTO(struct xfs_inode *ip), \
663 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000664DEFINE_INODE_EVENT(xfs_iget_skip);
665DEFINE_INODE_EVENT(xfs_iget_reclaim);
666DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
667DEFINE_INODE_EVENT(xfs_iget_hit);
668DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000669
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000670DEFINE_INODE_EVENT(xfs_getattr);
671DEFINE_INODE_EVENT(xfs_setattr);
672DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500673DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000674DEFINE_INODE_EVENT(xfs_alloc_file_space);
675DEFINE_INODE_EVENT(xfs_free_file_space);
Dave Chinner897b73b2014-04-14 18:15:11 +1000676DEFINE_INODE_EVENT(xfs_zero_file_space);
Namjae Jeone1d8fb82014-02-24 10:58:19 +1100677DEFINE_INODE_EVENT(xfs_collapse_file_space);
Namjae Jeona904b1c2015-03-25 15:08:56 +1100678DEFINE_INODE_EVENT(xfs_insert_file_space);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000679DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000680#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200681DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000682#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000683DEFINE_INODE_EVENT(xfs_vm_bmap);
684DEFINE_INODE_EVENT(xfs_file_ioctl);
685DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
686DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000687DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000688DEFINE_INODE_EVENT(xfs_file_fsync);
689DEFINE_INODE_EVENT(xfs_destroy_inode);
Al Virob57922d2010-06-07 14:34:48 -0400690DEFINE_INODE_EVENT(xfs_evict_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400691DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000692
693DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
694DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
695
Brian Foster27b52862012-11-06 09:50:38 -0500696DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
697DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500698DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Brian Foster27b52862012-11-06 09:50:38 -0500699
Dave Chinnerde0e8c22015-02-23 21:44:19 +1100700DEFINE_INODE_EVENT(xfs_filemap_fault);
Matthew Wilcoxacd76e72015-09-08 14:59:06 -0700701DEFINE_INODE_EVENT(xfs_filemap_pmd_fault);
Dave Chinner075a9242015-02-23 21:44:54 +1100702DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite);
Dave Chinner3af49282015-11-03 12:37:02 +1100703DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite);
Dave Chinnerde0e8c22015-02-23 21:44:19 +1100704
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000705DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000706 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
707 TP_ARGS(ip, caller_ip),
708 TP_STRUCT__entry(
709 __field(dev_t, dev)
710 __field(xfs_ino_t, ino)
711 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100712 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000713 __field(unsigned long, caller_ip)
714 ),
715 TP_fast_assign(
716 __entry->dev = VFS_I(ip)->i_sb->s_dev;
717 __entry->ino = ip->i_ino;
718 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100719 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000720 __entry->caller_ip = caller_ip;
721 ),
Scott Wood65dd2972015-03-25 14:56:21 +1100722 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000723 MAJOR(__entry->dev), MINOR(__entry->dev),
724 __entry->ino,
725 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100726 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000727 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000728)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000729
Brian Foster19cb7e32013-03-18 10:51:48 -0400730TRACE_EVENT(xfs_iomap_prealloc_size,
731 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
732 unsigned int writeio_blocks),
733 TP_ARGS(ip, blocks, shift, writeio_blocks),
734 TP_STRUCT__entry(
735 __field(dev_t, dev)
736 __field(xfs_ino_t, ino)
737 __field(xfs_fsblock_t, blocks)
738 __field(int, shift)
739 __field(unsigned int, writeio_blocks)
740 ),
741 TP_fast_assign(
742 __entry->dev = VFS_I(ip)->i_sb->s_dev;
743 __entry->ino = ip->i_ino;
744 __entry->blocks = blocks;
745 __entry->shift = shift;
746 __entry->writeio_blocks = writeio_blocks;
747 ),
748 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
749 "m_writeio_blocks %u",
750 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
751 __entry->blocks, __entry->shift, __entry->writeio_blocks)
752)
753
Brian Foster56d11152015-05-29 09:18:32 +1000754TRACE_EVENT(xfs_irec_merge_pre,
755 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
756 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
757 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
758 TP_STRUCT__entry(
759 __field(dev_t, dev)
760 __field(xfs_agnumber_t, agno)
761 __field(xfs_agino_t, agino)
762 __field(uint16_t, holemask)
763 __field(xfs_agino_t, nagino)
764 __field(uint16_t, nholemask)
765 ),
766 TP_fast_assign(
767 __entry->dev = mp->m_super->s_dev;
768 __entry->agno = agno;
769 __entry->agino = agino;
770 __entry->holemask = holemask;
771 __entry->nagino = nagino;
772 __entry->nholemask = holemask;
773 ),
774 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
775 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
776 __entry->agino, __entry->holemask, __entry->nagino,
777 __entry->nholemask)
778)
779
780TRACE_EVENT(xfs_irec_merge_post,
781 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
782 uint16_t holemask),
783 TP_ARGS(mp, agno, agino, holemask),
784 TP_STRUCT__entry(
785 __field(dev_t, dev)
786 __field(xfs_agnumber_t, agno)
787 __field(xfs_agino_t, agino)
788 __field(uint16_t, holemask)
789 ),
790 TP_fast_assign(
791 __entry->dev = mp->m_super->s_dev;
792 __entry->agno = agno;
793 __entry->agino = agino;
794 __entry->holemask = holemask;
795 ),
796 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
797 MINOR(__entry->dev), __entry->agno, __entry->agino,
798 __entry->holemask)
799)
800
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000801#define DEFINE_IREF_EVENT(name) \
802DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000803 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
804 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000805DEFINE_IREF_EVENT(xfs_ihold);
806DEFINE_IREF_EVENT(xfs_irele);
807DEFINE_IREF_EVENT(xfs_inode_pin);
808DEFINE_IREF_EVENT(xfs_inode_unpin);
809DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100810
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000811DECLARE_EVENT_CLASS(xfs_namespace_class,
812 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
813 TP_ARGS(dp, name),
814 TP_STRUCT__entry(
815 __field(dev_t, dev)
816 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000817 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000818 __dynamic_array(char, name, name->len)
819 ),
820 TP_fast_assign(
821 __entry->dev = VFS_I(dp)->i_sb->s_dev;
822 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000823 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000824 memcpy(__get_str(name), name->name, name->len);
825 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000826 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000827 MAJOR(__entry->dev), MINOR(__entry->dev),
828 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000829 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000830 __get_str(name))
831)
832
833#define DEFINE_NAMESPACE_EVENT(name) \
834DEFINE_EVENT(xfs_namespace_class, name, \
835 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
836 TP_ARGS(dp, name))
837DEFINE_NAMESPACE_EVENT(xfs_remove);
838DEFINE_NAMESPACE_EVENT(xfs_link);
839DEFINE_NAMESPACE_EVENT(xfs_lookup);
840DEFINE_NAMESPACE_EVENT(xfs_create);
841DEFINE_NAMESPACE_EVENT(xfs_symlink);
842
843TRACE_EVENT(xfs_rename,
844 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
845 struct xfs_name *src_name, struct xfs_name *target_name),
846 TP_ARGS(src_dp, target_dp, src_name, target_name),
847 TP_STRUCT__entry(
848 __field(dev_t, dev)
849 __field(xfs_ino_t, src_dp_ino)
850 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000851 __field(int, src_namelen)
852 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000853 __dynamic_array(char, src_name, src_name->len)
854 __dynamic_array(char, target_name, target_name->len)
855 ),
856 TP_fast_assign(
857 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
858 __entry->src_dp_ino = src_dp->i_ino;
859 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000860 __entry->src_namelen = src_name->len;
861 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000862 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000863 memcpy(__get_str(target_name), target_name->name,
864 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000865 ),
866 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000867 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000868 MAJOR(__entry->dev), MINOR(__entry->dev),
869 __entry->src_dp_ino,
870 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000871 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000872 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000873 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000874 __get_str(target_name))
875)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000876
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000877DECLARE_EVENT_CLASS(xfs_dquot_class,
878 TP_PROTO(struct xfs_dquot *dqp),
879 TP_ARGS(dqp),
880 TP_STRUCT__entry(
881 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000882 __field(u32, id)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000883 __field(unsigned, flags)
884 __field(unsigned, nrefs)
885 __field(unsigned long long, res_bcount)
886 __field(unsigned long long, bcount)
887 __field(unsigned long long, icount)
888 __field(unsigned long long, blk_hardlimit)
889 __field(unsigned long long, blk_softlimit)
890 __field(unsigned long long, ino_hardlimit)
891 __field(unsigned long long, ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000892 ), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000893 TP_fast_assign(
894 __entry->dev = dqp->q_mount->m_super->s_dev;
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000895 __entry->id = be32_to_cpu(dqp->q_core.d_id);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000896 __entry->flags = dqp->dq_flags;
897 __entry->nrefs = dqp->q_nrefs;
898 __entry->res_bcount = dqp->q_res_bcount;
899 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
900 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
901 __entry->blk_hardlimit =
902 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
903 __entry->blk_softlimit =
904 be64_to_cpu(dqp->q_core.d_blk_softlimit);
905 __entry->ino_hardlimit =
906 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
907 __entry->ino_softlimit =
908 be64_to_cpu(dqp->q_core.d_ino_softlimit);
909 ),
910 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000911 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
912 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000913 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000914 __entry->id,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000915 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
916 __entry->nrefs,
917 __entry->res_bcount,
918 __entry->bcount,
919 __entry->blk_hardlimit,
920 __entry->blk_softlimit,
921 __entry->icount,
922 __entry->ino_hardlimit,
923 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000924)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000925
926#define DEFINE_DQUOT_EVENT(name) \
927DEFINE_EVENT(xfs_dquot_class, name, \
928 TP_PROTO(struct xfs_dquot *dqp), \
929 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000930DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000931DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
932DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b2012-02-01 13:57:20 +0000933DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
934DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000935DEFINE_DQUOT_EVENT(xfs_dqattach_found);
936DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000937DEFINE_DQUOT_EVENT(xfs_dqalloc);
938DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
939DEFINE_DQUOT_EVENT(xfs_dqread);
940DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000941DEFINE_DQUOT_EVENT(xfs_dqget_hit);
942DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000943DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
944DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000945DEFINE_DQUOT_EVENT(xfs_dqput);
946DEFINE_DQUOT_EVENT(xfs_dqput_wait);
947DEFINE_DQUOT_EVENT(xfs_dqput_free);
948DEFINE_DQUOT_EVENT(xfs_dqrele);
949DEFINE_DQUOT_EVENT(xfs_dqflush);
950DEFINE_DQUOT_EVENT(xfs_dqflush_force);
951DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000952
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000953DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -0500954 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000955 TP_ARGS(log, tic),
956 TP_STRUCT__entry(
957 __field(dev_t, dev)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000958 __field(char, ocnt)
959 __field(char, cnt)
960 __field(int, curr_res)
961 __field(int, unit_res)
962 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +1100963 __field(int, reserveq)
964 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000965 __field(int, grant_reserve_cycle)
966 __field(int, grant_reserve_bytes)
967 __field(int, grant_write_cycle)
968 __field(int, grant_write_bytes)
969 __field(int, curr_cycle)
970 __field(int, curr_block)
971 __field(xfs_lsn_t, tail_lsn)
972 ),
973 TP_fast_assign(
974 __entry->dev = log->l_mp->m_super->s_dev;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000975 __entry->ocnt = tic->t_ocnt;
976 __entry->cnt = tic->t_cnt;
977 __entry->curr_res = tic->t_curr_res;
978 __entry->unit_res = tic->t_unit_res;
979 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +0000980 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
981 __entry->writeq = list_empty(&log->l_write_head.waiters);
982 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100983 &__entry->grant_reserve_cycle,
984 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +0000985 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100986 &__entry->grant_write_cycle,
987 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000988 __entry->curr_cycle = log->l_curr_cycle;
989 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +1100990 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000991 ),
Christoph Hellwig710b1e22016-04-06 09:20:36 +1000992 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +1100993 "t_unit_res %u t_flags %s reserveq %s "
994 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000995 "grant_reserve_bytes %d grant_write_cycle %d "
996 "grant_write_bytes %d curr_cycle %d curr_block %d "
997 "tail_cycle %d tail_block %d",
998 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000999 __entry->ocnt,
1000 __entry->cnt,
1001 __entry->curr_res,
1002 __entry->unit_res,
1003 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +11001004 __entry->reserveq ? "empty" : "active",
1005 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001006 __entry->grant_reserve_cycle,
1007 __entry->grant_reserve_bytes,
1008 __entry->grant_write_cycle,
1009 __entry->grant_write_bytes,
1010 __entry->curr_cycle,
1011 __entry->curr_block,
1012 CYCLE_LSN(__entry->tail_lsn),
1013 BLOCK_LSN(__entry->tail_lsn)
1014 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001015)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001016
1017#define DEFINE_LOGGRANT_EVENT(name) \
1018DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001019 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001020 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001021DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
1022DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001023DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +00001024DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1025DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +11001026DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +00001027DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1028DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1029DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1030DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001031DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1032DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1033DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1034DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1035DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1036DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1037
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001038DECLARE_EVENT_CLASS(xfs_log_item_class,
1039 TP_PROTO(struct xfs_log_item *lip),
1040 TP_ARGS(lip),
1041 TP_STRUCT__entry(
1042 __field(dev_t, dev)
1043 __field(void *, lip)
1044 __field(uint, type)
1045 __field(uint, flags)
1046 __field(xfs_lsn_t, lsn)
1047 ),
1048 TP_fast_assign(
1049 __entry->dev = lip->li_mountp->m_super->s_dev;
1050 __entry->lip = lip;
1051 __entry->type = lip->li_type;
1052 __entry->flags = lip->li_flags;
1053 __entry->lsn = lip->li_lsn;
1054 ),
1055 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
1056 MAJOR(__entry->dev), MINOR(__entry->dev),
1057 __entry->lip,
1058 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1059 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1060 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1061)
1062
Dave Chinner14c26c62012-04-24 16:33:31 +10001063TRACE_EVENT(xfs_log_force,
Carlos Maiolino9f278892016-04-06 09:46:30 +10001064 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1065 TP_ARGS(mp, lsn, caller_ip),
Dave Chinner14c26c62012-04-24 16:33:31 +10001066 TP_STRUCT__entry(
1067 __field(dev_t, dev)
1068 __field(xfs_lsn_t, lsn)
Carlos Maiolino9f278892016-04-06 09:46:30 +10001069 __field(unsigned long, caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001070 ),
1071 TP_fast_assign(
1072 __entry->dev = mp->m_super->s_dev;
1073 __entry->lsn = lsn;
Carlos Maiolino9f278892016-04-06 09:46:30 +10001074 __entry->caller_ip = caller_ip;
Dave Chinner14c26c62012-04-24 16:33:31 +10001075 ),
Carlos Maiolino9f278892016-04-06 09:46:30 +10001076 TP_printk("dev %d:%d lsn 0x%llx caller %ps",
Dave Chinner14c26c62012-04-24 16:33:31 +10001077 MAJOR(__entry->dev), MINOR(__entry->dev),
Carlos Maiolino9f278892016-04-06 09:46:30 +10001078 __entry->lsn, (void *)__entry->caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001079)
1080
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001081#define DEFINE_LOG_ITEM_EVENT(name) \
1082DEFINE_EVENT(xfs_log_item_class, name, \
1083 TP_PROTO(struct xfs_log_item *lip), \
1084 TP_ARGS(lip))
1085DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001086DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1087DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +10001088DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001089
Dave Chinner750b9c92013-11-01 15:27:18 +11001090DECLARE_EVENT_CLASS(xfs_ail_class,
1091 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1092 TP_ARGS(lip, old_lsn, new_lsn),
1093 TP_STRUCT__entry(
1094 __field(dev_t, dev)
1095 __field(void *, lip)
1096 __field(uint, type)
1097 __field(uint, flags)
1098 __field(xfs_lsn_t, old_lsn)
1099 __field(xfs_lsn_t, new_lsn)
1100 ),
1101 TP_fast_assign(
1102 __entry->dev = lip->li_mountp->m_super->s_dev;
1103 __entry->lip = lip;
1104 __entry->type = lip->li_type;
1105 __entry->flags = lip->li_flags;
1106 __entry->old_lsn = old_lsn;
1107 __entry->new_lsn = new_lsn;
1108 ),
1109 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
1110 MAJOR(__entry->dev), MINOR(__entry->dev),
1111 __entry->lip,
1112 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1113 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1114 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1115 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1116)
1117
1118#define DEFINE_AIL_EVENT(name) \
1119DEFINE_EVENT(xfs_ail_class, name, \
1120 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1121 TP_ARGS(lip, old_lsn, new_lsn))
1122DEFINE_AIL_EVENT(xfs_ail_insert);
1123DEFINE_AIL_EVENT(xfs_ail_move);
1124DEFINE_AIL_EVENT(xfs_ail_delete);
1125
1126TRACE_EVENT(xfs_log_assign_tail_lsn,
1127 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1128 TP_ARGS(log, new_lsn),
1129 TP_STRUCT__entry(
1130 __field(dev_t, dev)
1131 __field(xfs_lsn_t, new_lsn)
1132 __field(xfs_lsn_t, old_lsn)
1133 __field(xfs_lsn_t, last_sync_lsn)
1134 ),
1135 TP_fast_assign(
1136 __entry->dev = log->l_mp->m_super->s_dev;
1137 __entry->new_lsn = new_lsn;
1138 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1139 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1140 ),
1141 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1142 MAJOR(__entry->dev), MINOR(__entry->dev),
1143 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1144 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1145 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1146)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001147
Li Zefanf8adb4d2010-05-24 08:25:57 +00001148DECLARE_EVENT_CLASS(xfs_file_class,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001149 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
1150 TP_ARGS(ip, count, offset),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001151 TP_STRUCT__entry(
1152 __field(dev_t, dev)
1153 __field(xfs_ino_t, ino)
1154 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001155 __field(loff_t, offset)
1156 __field(size_t, count)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001157 ),
1158 TP_fast_assign(
1159 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1160 __entry->ino = ip->i_ino;
1161 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001162 __entry->offset = offset;
1163 __entry->count = count;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001164 ),
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001165 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001166 MAJOR(__entry->dev), MINOR(__entry->dev),
1167 __entry->ino,
1168 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001169 __entry->offset,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001170 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001171)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001172
1173#define DEFINE_RW_EVENT(name) \
1174DEFINE_EVENT(xfs_file_class, name, \
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001175 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1176 TP_ARGS(ip, count, offset))
1177DEFINE_RW_EVENT(xfs_file_buffered_read);
1178DEFINE_RW_EVENT(xfs_file_direct_read);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001179DEFINE_RW_EVENT(xfs_file_dax_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001180DEFINE_RW_EVENT(xfs_file_buffered_write);
1181DEFINE_RW_EVENT(xfs_file_direct_write);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001182DEFINE_RW_EVENT(xfs_file_dax_write);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001183DEFINE_RW_EVENT(xfs_file_splice_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001184
Li Zefanf8adb4d2010-05-24 08:25:57 +00001185DECLARE_EVENT_CLASS(xfs_page_class,
Lukas Czerner34097df2013-05-21 23:58:01 -04001186 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1187 unsigned int len),
1188 TP_ARGS(inode, page, off, len),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001189 TP_STRUCT__entry(
1190 __field(dev_t, dev)
1191 __field(xfs_ino_t, ino)
1192 __field(pgoff_t, pgoff)
1193 __field(loff_t, size)
1194 __field(unsigned long, offset)
Lukas Czerner34097df2013-05-21 23:58:01 -04001195 __field(unsigned int, length)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001196 __field(int, delalloc)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001197 __field(int, unwritten)
1198 ),
1199 TP_fast_assign(
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001200 int delalloc = -1, unwritten = -1;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001201
Li Zefanf8adb4d2010-05-24 08:25:57 +00001202 if (page_has_buffers(page))
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001203 xfs_count_page_state(page, &delalloc, &unwritten);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001204 __entry->dev = inode->i_sb->s_dev;
1205 __entry->ino = XFS_I(inode)->i_ino;
1206 __entry->pgoff = page_offset(page);
1207 __entry->size = i_size_read(inode);
1208 __entry->offset = off;
Lukas Czerner34097df2013-05-21 23:58:01 -04001209 __entry->length = len;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001210 __entry->delalloc = delalloc;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001211 __entry->unwritten = unwritten;
1212 ),
1213 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
Lukas Czerner34097df2013-05-21 23:58:01 -04001214 "length %x delalloc %d unwritten %d",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001215 MAJOR(__entry->dev), MINOR(__entry->dev),
1216 __entry->ino,
1217 __entry->pgoff,
1218 __entry->size,
1219 __entry->offset,
Lukas Czerner34097df2013-05-21 23:58:01 -04001220 __entry->length,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001221 __entry->delalloc,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001222 __entry->unwritten)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001223)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001224
1225#define DEFINE_PAGE_EVENT(name) \
1226DEFINE_EVENT(xfs_page_class, name, \
Lukas Czerner34097df2013-05-21 23:58:01 -04001227 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1228 unsigned int len), \
1229 TP_ARGS(inode, page, off, len))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001230DEFINE_PAGE_EVENT(xfs_writepage);
1231DEFINE_PAGE_EVENT(xfs_releasepage);
1232DEFINE_PAGE_EVENT(xfs_invalidatepage);
1233
Dave Chinner121e2132016-01-08 11:28:35 +11001234DECLARE_EVENT_CLASS(xfs_readpage_class,
1235 TP_PROTO(struct inode *inode, int nr_pages),
1236 TP_ARGS(inode, nr_pages),
1237 TP_STRUCT__entry(
1238 __field(dev_t, dev)
1239 __field(xfs_ino_t, ino)
1240 __field(int, nr_pages)
1241 ),
1242 TP_fast_assign(
1243 __entry->dev = inode->i_sb->s_dev;
1244 __entry->ino = inode->i_ino;
1245 __entry->nr_pages = nr_pages;
1246 ),
1247 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1248 MAJOR(__entry->dev), MINOR(__entry->dev),
1249 __entry->ino,
1250 __entry->nr_pages)
1251)
1252
1253#define DEFINE_READPAGE_EVENT(name) \
1254DEFINE_EVENT(xfs_readpage_class, name, \
1255 TP_PROTO(struct inode *inode, int nr_pages), \
1256 TP_ARGS(inode, nr_pages))
1257DEFINE_READPAGE_EVENT(xfs_vm_readpage);
1258DEFINE_READPAGE_EVENT(xfs_vm_readpages);
1259
Christoph Hellwiga206c812010-12-10 08:42:20 +00001260DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001261 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001262 int type, struct xfs_bmbt_irec *irec),
1263 TP_ARGS(ip, offset, count, type, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001264 TP_STRUCT__entry(
1265 __field(dev_t, dev)
1266 __field(xfs_ino_t, ino)
1267 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001268 __field(loff_t, offset)
1269 __field(size_t, count)
Christoph Hellwiga206c812010-12-10 08:42:20 +00001270 __field(int, type)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001271 __field(xfs_fileoff_t, startoff)
1272 __field(xfs_fsblock_t, startblock)
1273 __field(xfs_filblks_t, blockcount)
1274 ),
1275 TP_fast_assign(
1276 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1277 __entry->ino = ip->i_ino;
1278 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001279 __entry->offset = offset;
1280 __entry->count = count;
Christoph Hellwiga206c812010-12-10 08:42:20 +00001281 __entry->type = type;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001282 __entry->startoff = irec ? irec->br_startoff : 0;
1283 __entry->startblock = irec ? irec->br_startblock : 0;
1284 __entry->blockcount = irec ? irec->br_blockcount : 0;
1285 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001286 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1287 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001288 MAJOR(__entry->dev), MINOR(__entry->dev),
1289 __entry->ino,
1290 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001291 __entry->offset,
1292 __entry->count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001293 __print_symbolic(__entry->type, XFS_IO_TYPES),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001294 __entry->startoff,
1295 (__int64_t)__entry->startblock,
1296 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001297)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001298
1299#define DEFINE_IOMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001300DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001301 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001302 int type, struct xfs_bmbt_irec *irec), \
1303 TP_ARGS(ip, offset, count, type, irec))
1304DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1305DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1306DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1307DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
Christoph Hellwig273dda72016-02-08 14:40:51 +11001308DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct);
Christoph Hellwig68a9f5e2016-06-21 09:53:44 +10001309DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
1310DEFINE_IOMAP_EVENT(xfs_iomap_found);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001311
Li Zefanf8adb4d2010-05-24 08:25:57 +00001312DECLARE_EVENT_CLASS(xfs_simple_io_class,
1313 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1314 TP_ARGS(ip, offset, count),
1315 TP_STRUCT__entry(
1316 __field(dev_t, dev)
1317 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001318 __field(loff_t, isize)
1319 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001320 __field(loff_t, offset)
1321 __field(size_t, count)
1322 ),
1323 TP_fast_assign(
1324 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1325 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001326 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001327 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001328 __entry->offset = offset;
1329 __entry->count = count;
1330 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001331 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001332 "offset 0x%llx count %zd",
1333 MAJOR(__entry->dev), MINOR(__entry->dev),
1334 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001335 __entry->isize,
1336 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001337 __entry->offset,
1338 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001339);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001340
1341#define DEFINE_SIMPLE_IO_EVENT(name) \
1342DEFINE_EVENT(xfs_simple_io_class, name, \
1343 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1344 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001345DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1346DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Christoph Hellwiga206c812010-12-10 08:42:20 +00001347DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001348DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Brian Foster0a50f162015-10-12 16:02:08 +11001349DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
Christoph Hellwig273dda72016-02-08 14:40:51 +11001350DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1351DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1352DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001353
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001354DECLARE_EVENT_CLASS(xfs_itrunc_class,
1355 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1356 TP_ARGS(ip, new_size),
1357 TP_STRUCT__entry(
1358 __field(dev_t, dev)
1359 __field(xfs_ino_t, ino)
1360 __field(xfs_fsize_t, size)
1361 __field(xfs_fsize_t, new_size)
1362 ),
1363 TP_fast_assign(
1364 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1365 __entry->ino = ip->i_ino;
1366 __entry->size = ip->i_d.di_size;
1367 __entry->new_size = new_size;
1368 ),
1369 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1370 MAJOR(__entry->dev), MINOR(__entry->dev),
1371 __entry->ino,
1372 __entry->size,
1373 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001374)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001375
1376#define DEFINE_ITRUNC_EVENT(name) \
1377DEFINE_EVENT(xfs_itrunc_class, name, \
1378 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1379 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001380DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1381DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001382
1383TRACE_EVENT(xfs_pagecache_inval,
1384 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1385 TP_ARGS(ip, start, finish),
1386 TP_STRUCT__entry(
1387 __field(dev_t, dev)
1388 __field(xfs_ino_t, ino)
1389 __field(xfs_fsize_t, size)
1390 __field(xfs_off_t, start)
1391 __field(xfs_off_t, finish)
1392 ),
1393 TP_fast_assign(
1394 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1395 __entry->ino = ip->i_ino;
1396 __entry->size = ip->i_d.di_size;
1397 __entry->start = start;
1398 __entry->finish = finish;
1399 ),
1400 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1401 MAJOR(__entry->dev), MINOR(__entry->dev),
1402 __entry->ino,
1403 __entry->size,
1404 __entry->start,
1405 __entry->finish)
1406);
1407
1408TRACE_EVENT(xfs_bunmap,
1409 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1410 int flags, unsigned long caller_ip),
1411 TP_ARGS(ip, bno, len, flags, caller_ip),
1412 TP_STRUCT__entry(
1413 __field(dev_t, dev)
1414 __field(xfs_ino_t, ino)
1415 __field(xfs_fsize_t, size)
1416 __field(xfs_fileoff_t, bno)
1417 __field(xfs_filblks_t, len)
1418 __field(unsigned long, caller_ip)
1419 __field(int, flags)
1420 ),
1421 TP_fast_assign(
1422 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1423 __entry->ino = ip->i_ino;
1424 __entry->size = ip->i_d.di_size;
1425 __entry->bno = bno;
1426 __entry->len = len;
1427 __entry->caller_ip = caller_ip;
1428 __entry->flags = flags;
1429 ),
1430 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
Scott Wood65dd2972015-03-25 14:56:21 +11001431 "flags %s caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001432 MAJOR(__entry->dev), MINOR(__entry->dev),
1433 __entry->ino,
1434 __entry->size,
1435 __entry->bno,
1436 __entry->len,
1437 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1438 (void *)__entry->caller_ip)
1439
1440);
1441
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001442DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001443 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1444 xfs_agblock_t agbno, xfs_extlen_t len),
1445 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001446 TP_STRUCT__entry(
1447 __field(dev_t, dev)
1448 __field(xfs_agnumber_t, agno)
1449 __field(xfs_agblock_t, agbno)
1450 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001451 ),
1452 TP_fast_assign(
1453 __entry->dev = mp->m_super->s_dev;
1454 __entry->agno = agno;
1455 __entry->agbno = agbno;
1456 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001457 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001458 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001459 MAJOR(__entry->dev), MINOR(__entry->dev),
1460 __entry->agno,
1461 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001462 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001463);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001464#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001465DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001466 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1467 xfs_agblock_t agbno, xfs_extlen_t len), \
1468 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001469DEFINE_BUSY_EVENT(xfs_extent_busy);
1470DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1471DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1472DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1473DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001474
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001475TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001476 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1477 xfs_agblock_t agbno, xfs_extlen_t len,
1478 xfs_agblock_t tbno, xfs_extlen_t tlen),
1479 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1480 TP_STRUCT__entry(
1481 __field(dev_t, dev)
1482 __field(xfs_agnumber_t, agno)
1483 __field(xfs_agblock_t, agbno)
1484 __field(xfs_extlen_t, len)
1485 __field(xfs_agblock_t, tbno)
1486 __field(xfs_extlen_t, tlen)
1487 ),
1488 TP_fast_assign(
1489 __entry->dev = mp->m_super->s_dev;
1490 __entry->agno = agno;
1491 __entry->agbno = agbno;
1492 __entry->len = len;
1493 __entry->tbno = tbno;
1494 __entry->tlen = tlen;
1495 ),
1496 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1497 MAJOR(__entry->dev), MINOR(__entry->dev),
1498 __entry->agno,
1499 __entry->agbno,
1500 __entry->len,
1501 __entry->tbno,
1502 __entry->tlen)
1503);
1504
Dave Chinnered3b4d62010-05-21 12:07:08 +10001505TRACE_EVENT(xfs_trans_commit_lsn,
1506 TP_PROTO(struct xfs_trans *trans),
1507 TP_ARGS(trans),
1508 TP_STRUCT__entry(
1509 __field(dev_t, dev)
1510 __field(struct xfs_trans *, tp)
1511 __field(xfs_lsn_t, lsn)
1512 ),
1513 TP_fast_assign(
1514 __entry->dev = trans->t_mountp->m_super->s_dev;
1515 __entry->tp = trans;
1516 __entry->lsn = trans->t_commit_lsn;
1517 ),
1518 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1519 MAJOR(__entry->dev), MINOR(__entry->dev),
1520 __entry->tp,
Dave Chinnerfd45e4782010-01-02 02:38:56 +00001521 __entry->lsn)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001522);
1523
1524TRACE_EVENT(xfs_agf,
1525 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1526 unsigned long caller_ip),
1527 TP_ARGS(mp, agf, flags, caller_ip),
1528 TP_STRUCT__entry(
1529 __field(dev_t, dev)
1530 __field(xfs_agnumber_t, agno)
1531 __field(int, flags)
1532 __field(__u32, length)
1533 __field(__u32, bno_root)
1534 __field(__u32, cnt_root)
1535 __field(__u32, bno_level)
1536 __field(__u32, cnt_level)
1537 __field(__u32, flfirst)
1538 __field(__u32, fllast)
1539 __field(__u32, flcount)
1540 __field(__u32, freeblks)
1541 __field(__u32, longest)
1542 __field(unsigned long, caller_ip)
1543 ),
1544 TP_fast_assign(
1545 __entry->dev = mp->m_super->s_dev;
1546 __entry->agno = be32_to_cpu(agf->agf_seqno),
1547 __entry->flags = flags;
1548 __entry->length = be32_to_cpu(agf->agf_length),
1549 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1550 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1551 __entry->bno_level =
1552 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1553 __entry->cnt_level =
1554 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1555 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1556 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1557 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1558 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1559 __entry->longest = be32_to_cpu(agf->agf_longest);
1560 __entry->caller_ip = caller_ip;
1561 ),
1562 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1563 "levels b %u c %u flfirst %u fllast %u flcount %u "
Scott Wood65dd2972015-03-25 14:56:21 +11001564 "freeblks %u longest %u caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001565 MAJOR(__entry->dev), MINOR(__entry->dev),
1566 __entry->agno,
1567 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1568 __entry->length,
1569 __entry->bno_root,
1570 __entry->cnt_root,
1571 __entry->bno_level,
1572 __entry->cnt_level,
1573 __entry->flfirst,
1574 __entry->fllast,
1575 __entry->flcount,
1576 __entry->freeblks,
1577 __entry->longest,
1578 (void *)__entry->caller_ip)
1579);
1580
1581TRACE_EVENT(xfs_free_extent,
1582 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001583 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1584 int haveright),
1585 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001586 TP_STRUCT__entry(
1587 __field(dev_t, dev)
1588 __field(xfs_agnumber_t, agno)
1589 __field(xfs_agblock_t, agbno)
1590 __field(xfs_extlen_t, len)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001591 __field(int, resv)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001592 __field(int, haveleft)
1593 __field(int, haveright)
1594 ),
1595 TP_fast_assign(
1596 __entry->dev = mp->m_super->s_dev;
1597 __entry->agno = agno;
1598 __entry->agbno = agbno;
1599 __entry->len = len;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001600 __entry->resv = resv;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001601 __entry->haveleft = haveleft;
1602 __entry->haveright = haveright;
1603 ),
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001604 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001605 MAJOR(__entry->dev), MINOR(__entry->dev),
1606 __entry->agno,
1607 __entry->agbno,
1608 __entry->len,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001609 __entry->resv,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001610 __entry->haveleft ?
1611 (__entry->haveright ? "both" : "left") :
1612 (__entry->haveright ? "right" : "none"))
1613
1614);
1615
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001616DECLARE_EVENT_CLASS(xfs_alloc_class,
1617 TP_PROTO(struct xfs_alloc_arg *args),
1618 TP_ARGS(args),
1619 TP_STRUCT__entry(
1620 __field(dev_t, dev)
1621 __field(xfs_agnumber_t, agno)
1622 __field(xfs_agblock_t, agbno)
1623 __field(xfs_extlen_t, minlen)
1624 __field(xfs_extlen_t, maxlen)
1625 __field(xfs_extlen_t, mod)
1626 __field(xfs_extlen_t, prod)
1627 __field(xfs_extlen_t, minleft)
1628 __field(xfs_extlen_t, total)
1629 __field(xfs_extlen_t, alignment)
1630 __field(xfs_extlen_t, minalignslop)
1631 __field(xfs_extlen_t, len)
1632 __field(short, type)
1633 __field(short, otype)
1634 __field(char, wasdel)
1635 __field(char, wasfromfl)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001636 __field(int, resv)
Dave Chinner292378e2016-09-26 08:21:28 +10001637 __field(int, datatype)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001638 __field(xfs_fsblock_t, firstblock)
1639 ),
1640 TP_fast_assign(
1641 __entry->dev = args->mp->m_super->s_dev;
1642 __entry->agno = args->agno;
1643 __entry->agbno = args->agbno;
1644 __entry->minlen = args->minlen;
1645 __entry->maxlen = args->maxlen;
1646 __entry->mod = args->mod;
1647 __entry->prod = args->prod;
1648 __entry->minleft = args->minleft;
1649 __entry->total = args->total;
1650 __entry->alignment = args->alignment;
1651 __entry->minalignslop = args->minalignslop;
1652 __entry->len = args->len;
1653 __entry->type = args->type;
1654 __entry->otype = args->otype;
1655 __entry->wasdel = args->wasdel;
1656 __entry->wasfromfl = args->wasfromfl;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001657 __entry->resv = args->resv;
Dave Chinner292378e2016-09-26 08:21:28 +10001658 __entry->datatype = args->datatype;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001659 __entry->firstblock = args->firstblock;
1660 ),
1661 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1662 "prod %u minleft %u total %u alignment %u minalignslop %u "
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001663 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
Dave Chinner292378e2016-09-26 08:21:28 +10001664 "datatype 0x%x firstblock 0x%llx",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001665 MAJOR(__entry->dev), MINOR(__entry->dev),
1666 __entry->agno,
1667 __entry->agbno,
1668 __entry->minlen,
1669 __entry->maxlen,
1670 __entry->mod,
1671 __entry->prod,
1672 __entry->minleft,
1673 __entry->total,
1674 __entry->alignment,
1675 __entry->minalignslop,
1676 __entry->len,
1677 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1678 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1679 __entry->wasdel,
1680 __entry->wasfromfl,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001681 __entry->resv,
Dave Chinner292378e2016-09-26 08:21:28 +10001682 __entry->datatype,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001683 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001684)
1685
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001686#define DEFINE_ALLOC_EVENT(name) \
1687DEFINE_EVENT(xfs_alloc_class, name, \
1688 TP_PROTO(struct xfs_alloc_arg *args), \
1689 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001690DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001691DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001692DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1693DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1694DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1695DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1696DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1697DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001698DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1699DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001700DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1701DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1702DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1703DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1704DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001705DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001706DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1707DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1708DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1709DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1710DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1711DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1712DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1713DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1714DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1715
Dave Chinner5a5881c2012-03-22 05:15:13 +00001716DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001717 TP_PROTO(struct xfs_da_args *args),
1718 TP_ARGS(args),
1719 TP_STRUCT__entry(
1720 __field(dev_t, dev)
1721 __field(xfs_ino_t, ino)
1722 __dynamic_array(char, name, args->namelen)
1723 __field(int, namelen)
1724 __field(xfs_dahash_t, hashval)
1725 __field(xfs_ino_t, inumber)
1726 __field(int, op_flags)
1727 ),
1728 TP_fast_assign(
1729 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1730 __entry->ino = args->dp->i_ino;
1731 if (args->namelen)
1732 memcpy(__get_str(name), args->name, args->namelen);
1733 __entry->namelen = args->namelen;
1734 __entry->hashval = args->hashval;
1735 __entry->inumber = args->inumber;
1736 __entry->op_flags = args->op_flags;
1737 ),
1738 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1739 "inumber 0x%llx op_flags %s",
1740 MAJOR(__entry->dev), MINOR(__entry->dev),
1741 __entry->ino,
1742 __entry->namelen,
1743 __entry->namelen ? __get_str(name) : NULL,
1744 __entry->namelen,
1745 __entry->hashval,
1746 __entry->inumber,
1747 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001748)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001749
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001750#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001751DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001752 TP_PROTO(struct xfs_da_args *args), \
1753 TP_ARGS(args))
1754DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1755DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1756DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1757DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1758DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1759DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1760DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1761DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1762DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1763DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1764DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1765DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1766DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1767DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1768DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1769DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1770DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1771DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1772DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1773DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1774DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1775DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1776DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1777DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1778DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1779
Dave Chinneree732592012-11-12 22:53:53 +11001780DECLARE_EVENT_CLASS(xfs_attr_class,
1781 TP_PROTO(struct xfs_da_args *args),
1782 TP_ARGS(args),
1783 TP_STRUCT__entry(
1784 __field(dev_t, dev)
1785 __field(xfs_ino_t, ino)
1786 __dynamic_array(char, name, args->namelen)
1787 __field(int, namelen)
1788 __field(int, valuelen)
1789 __field(xfs_dahash_t, hashval)
1790 __field(int, op_flags)
1791 ),
1792 TP_fast_assign(
1793 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1794 __entry->ino = args->dp->i_ino;
1795 if (args->namelen)
1796 memcpy(__get_str(name), args->name, args->namelen);
1797 __entry->namelen = args->namelen;
1798 __entry->valuelen = args->valuelen;
1799 __entry->hashval = args->hashval;
1800 __entry->op_flags = args->op_flags;
1801 ),
1802 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1803 "hashval 0x%x op_flags %s",
1804 MAJOR(__entry->dev), MINOR(__entry->dev),
1805 __entry->ino,
1806 __entry->namelen,
1807 __entry->namelen ? __get_str(name) : NULL,
1808 __entry->namelen,
1809 __entry->valuelen,
1810 __entry->hashval,
1811 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1812)
1813
Dave Chinner5a5881c2012-03-22 05:15:13 +00001814#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11001815DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001816 TP_PROTO(struct xfs_da_args *args), \
1817 TP_ARGS(args))
1818DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1819DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1820DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1821DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1822DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1823DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
1824DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1825
1826DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1827DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1828DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11001829DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001830DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1831DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11001832DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1833DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001834DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1835DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11001836DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001837DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1838DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1839DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1840DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1841DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1842DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1843DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1844DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1845DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1846DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1847DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001848DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001849
1850DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11001851DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001852DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
1853DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1854DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1855
Dave Chinneree732592012-11-12 22:53:53 +11001856DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1857DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1858
1859DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1860DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1861DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1862
Dave Chinner5a5881c2012-03-22 05:15:13 +00001863#define DEFINE_DA_EVENT(name) \
1864DEFINE_EVENT(xfs_da_class, name, \
1865 TP_PROTO(struct xfs_da_args *args), \
1866 TP_ARGS(args))
1867DEFINE_DA_EVENT(xfs_da_split);
1868DEFINE_DA_EVENT(xfs_da_join);
1869DEFINE_DA_EVENT(xfs_da_link_before);
1870DEFINE_DA_EVENT(xfs_da_link_after);
1871DEFINE_DA_EVENT(xfs_da_unlink_back);
1872DEFINE_DA_EVENT(xfs_da_unlink_forward);
1873DEFINE_DA_EVENT(xfs_da_root_split);
1874DEFINE_DA_EVENT(xfs_da_root_join);
1875DEFINE_DA_EVENT(xfs_da_node_add);
1876DEFINE_DA_EVENT(xfs_da_node_create);
1877DEFINE_DA_EVENT(xfs_da_node_split);
1878DEFINE_DA_EVENT(xfs_da_node_remove);
1879DEFINE_DA_EVENT(xfs_da_node_rebalance);
1880DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001881DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001882DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1883DEFINE_DA_EVENT(xfs_da_grow_inode);
1884DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11001885DEFINE_DA_EVENT(xfs_da_fixhashpath);
1886DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001887
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001888DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1889 TP_PROTO(struct xfs_da_args *args, int idx),
1890 TP_ARGS(args, idx),
1891 TP_STRUCT__entry(
1892 __field(dev_t, dev)
1893 __field(xfs_ino_t, ino)
1894 __field(int, op_flags)
1895 __field(int, idx)
1896 ),
1897 TP_fast_assign(
1898 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1899 __entry->ino = args->dp->i_ino;
1900 __entry->op_flags = args->op_flags;
1901 __entry->idx = idx;
1902 ),
1903 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1904 MAJOR(__entry->dev), MINOR(__entry->dev),
1905 __entry->ino,
1906 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1907 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001908)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001909
1910#define DEFINE_DIR2_SPACE_EVENT(name) \
1911DEFINE_EVENT(xfs_dir2_space_class, name, \
1912 TP_PROTO(struct xfs_da_args *args, int idx), \
1913 TP_ARGS(args, idx))
1914DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1915DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1916DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1917DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001918
1919TRACE_EVENT(xfs_dir2_leafn_moveents,
1920 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1921 TP_ARGS(args, src_idx, dst_idx, count),
1922 TP_STRUCT__entry(
1923 __field(dev_t, dev)
1924 __field(xfs_ino_t, ino)
1925 __field(int, op_flags)
1926 __field(int, src_idx)
1927 __field(int, dst_idx)
1928 __field(int, count)
1929 ),
1930 TP_fast_assign(
1931 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1932 __entry->ino = args->dp->i_ino;
1933 __entry->op_flags = args->op_flags;
1934 __entry->src_idx = src_idx;
1935 __entry->dst_idx = dst_idx;
1936 __entry->count = count;
1937 ),
1938 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1939 "src_idx %d dst_idx %d count %d",
1940 MAJOR(__entry->dev), MINOR(__entry->dev),
1941 __entry->ino,
1942 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1943 __entry->src_idx,
1944 __entry->dst_idx,
1945 __entry->count)
1946);
1947
Dave Chinner3a85cd92010-01-14 01:33:55 +00001948#define XFS_SWAPEXT_INODES \
1949 { 0, "target" }, \
1950 { 1, "temp" }
1951
1952#define XFS_INODE_FORMAT_STR \
1953 { 0, "invalid" }, \
1954 { 1, "local" }, \
1955 { 2, "extent" }, \
1956 { 3, "btree" }
1957
1958DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1959 TP_PROTO(struct xfs_inode *ip, int which),
1960 TP_ARGS(ip, which),
1961 TP_STRUCT__entry(
1962 __field(dev_t, dev)
1963 __field(int, which)
1964 __field(xfs_ino_t, ino)
1965 __field(int, format)
1966 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00001967 __field(int, broot_size)
1968 __field(int, fork_off)
1969 ),
1970 TP_fast_assign(
1971 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1972 __entry->which = which;
1973 __entry->ino = ip->i_ino;
1974 __entry->format = ip->i_d.di_format;
1975 __entry->nex = ip->i_d.di_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00001976 __entry->broot_size = ip->i_df.if_broot_bytes;
1977 __entry->fork_off = XFS_IFORK_BOFF(ip);
1978 ),
1979 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00001980 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00001981 MAJOR(__entry->dev), MINOR(__entry->dev),
1982 __entry->ino,
1983 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1984 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1985 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00001986 __entry->broot_size,
1987 __entry->fork_off)
1988)
1989
1990#define DEFINE_SWAPEXT_EVENT(name) \
1991DEFINE_EVENT(xfs_swap_extent_class, name, \
1992 TP_PROTO(struct xfs_inode *ip, int which), \
1993 TP_ARGS(ip, which))
1994
1995DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1996DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1997
Brian Foster5cd9cee2016-09-26 08:34:52 +10001998TRACE_EVENT(xfs_log_recover_record,
1999 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
2000 TP_ARGS(log, rhead, pass),
2001 TP_STRUCT__entry(
2002 __field(dev_t, dev)
2003 __field(xfs_lsn_t, lsn)
2004 __field(int, len)
2005 __field(int, num_logops)
2006 __field(int, pass)
2007 ),
2008 TP_fast_assign(
2009 __entry->dev = log->l_mp->m_super->s_dev;
2010 __entry->lsn = be64_to_cpu(rhead->h_lsn);
2011 __entry->len = be32_to_cpu(rhead->h_len);
2012 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
2013 __entry->pass = pass;
2014 ),
2015 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2016 MAJOR(__entry->dev), MINOR(__entry->dev),
2017 __entry->lsn, __entry->len, __entry->num_logops,
2018 __entry->pass)
2019)
2020
Dave Chinner9abbc532010-04-13 15:06:46 +10002021DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002022 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10002023 struct xlog_recover_item *item, int pass),
2024 TP_ARGS(log, trans, item, pass),
2025 TP_STRUCT__entry(
2026 __field(dev_t, dev)
2027 __field(unsigned long, item)
2028 __field(xlog_tid_t, tid)
Brian Foster5cd9cee2016-09-26 08:34:52 +10002029 __field(xfs_lsn_t, lsn)
Dave Chinner9abbc532010-04-13 15:06:46 +10002030 __field(int, type)
2031 __field(int, pass)
2032 __field(int, count)
2033 __field(int, total)
2034 ),
2035 TP_fast_assign(
2036 __entry->dev = log->l_mp->m_super->s_dev;
2037 __entry->item = (unsigned long)item;
2038 __entry->tid = trans->r_log_tid;
Brian Foster5cd9cee2016-09-26 08:34:52 +10002039 __entry->lsn = trans->r_lsn;
Dave Chinner9abbc532010-04-13 15:06:46 +10002040 __entry->type = ITEM_TYPE(item);
2041 __entry->pass = pass;
2042 __entry->count = item->ri_cnt;
2043 __entry->total = item->ri_total;
2044 ),
Brian Foster5cd9cee2016-09-26 08:34:52 +10002045 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item 0x%p, "
2046 "item type %s item region count/total %d/%d",
Dave Chinner9abbc532010-04-13 15:06:46 +10002047 MAJOR(__entry->dev), MINOR(__entry->dev),
2048 __entry->tid,
Brian Foster5cd9cee2016-09-26 08:34:52 +10002049 __entry->lsn,
Dave Chinner9abbc532010-04-13 15:06:46 +10002050 __entry->pass,
2051 (void *)__entry->item,
2052 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2053 __entry->count,
2054 __entry->total)
2055)
2056
2057#define DEFINE_LOG_RECOVER_ITEM(name) \
2058DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002059 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10002060 struct xlog_recover_item *item, int pass), \
2061 TP_ARGS(log, trans, item, pass))
2062
2063DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2064DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2065DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2066DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2067DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2068
2069DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002070 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002071 TP_ARGS(log, buf_f),
2072 TP_STRUCT__entry(
2073 __field(dev_t, dev)
2074 __field(__int64_t, blkno)
2075 __field(unsigned short, len)
2076 __field(unsigned short, flags)
2077 __field(unsigned short, size)
2078 __field(unsigned int, map_size)
2079 ),
2080 TP_fast_assign(
2081 __entry->dev = log->l_mp->m_super->s_dev;
2082 __entry->blkno = buf_f->blf_blkno;
2083 __entry->len = buf_f->blf_len;
2084 __entry->flags = buf_f->blf_flags;
2085 __entry->size = buf_f->blf_size;
2086 __entry->map_size = buf_f->blf_map_size;
2087 ),
2088 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2089 "map_size %d",
2090 MAJOR(__entry->dev), MINOR(__entry->dev),
2091 __entry->blkno,
2092 __entry->len,
2093 __entry->flags,
2094 __entry->size,
2095 __entry->map_size)
2096)
2097
2098#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2099DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002100 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002101 TP_ARGS(log, buf_f))
2102
2103DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2104DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2105DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2106DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2107DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
Brian Foster5cd9cee2016-09-26 08:34:52 +10002108DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
Dave Chinner9abbc532010-04-13 15:06:46 +10002109DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2110DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2111DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2112
2113DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002114 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002115 TP_ARGS(log, in_f),
2116 TP_STRUCT__entry(
2117 __field(dev_t, dev)
2118 __field(xfs_ino_t, ino)
2119 __field(unsigned short, size)
2120 __field(int, fields)
2121 __field(unsigned short, asize)
2122 __field(unsigned short, dsize)
2123 __field(__int64_t, blkno)
2124 __field(int, len)
2125 __field(int, boffset)
2126 ),
2127 TP_fast_assign(
2128 __entry->dev = log->l_mp->m_super->s_dev;
2129 __entry->ino = in_f->ilf_ino;
2130 __entry->size = in_f->ilf_size;
2131 __entry->fields = in_f->ilf_fields;
2132 __entry->asize = in_f->ilf_asize;
2133 __entry->dsize = in_f->ilf_dsize;
2134 __entry->blkno = in_f->ilf_blkno;
2135 __entry->len = in_f->ilf_len;
2136 __entry->boffset = in_f->ilf_boffset;
2137 ),
2138 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2139 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2140 MAJOR(__entry->dev), MINOR(__entry->dev),
2141 __entry->ino,
2142 __entry->size,
2143 __entry->fields,
2144 __entry->asize,
2145 __entry->dsize,
2146 __entry->blkno,
2147 __entry->len,
2148 __entry->boffset)
2149)
2150#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2151DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002152 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002153 TP_ARGS(log, in_f))
2154
2155DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2156DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2157DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2158
Brian Foster78d57e42015-08-19 09:58:48 +10002159DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2160 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2161 TP_ARGS(log, in_f),
2162 TP_STRUCT__entry(
2163 __field(dev_t, dev)
2164 __field(xfs_agnumber_t, agno)
2165 __field(xfs_agblock_t, agbno)
2166 __field(unsigned int, count)
2167 __field(unsigned int, isize)
2168 __field(xfs_agblock_t, length)
2169 __field(unsigned int, gen)
2170 ),
2171 TP_fast_assign(
2172 __entry->dev = log->l_mp->m_super->s_dev;
2173 __entry->agno = be32_to_cpu(in_f->icl_ag);
2174 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2175 __entry->count = be32_to_cpu(in_f->icl_count);
2176 __entry->isize = be32_to_cpu(in_f->icl_isize);
2177 __entry->length = be32_to_cpu(in_f->icl_length);
2178 __entry->gen = be32_to_cpu(in_f->icl_gen);
2179 ),
2180 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2181 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
2182 __entry->agno, __entry->agbno, __entry->count, __entry->isize,
2183 __entry->length, __entry->gen)
2184)
2185#define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2186DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2187 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2188 TP_ARGS(log, in_f))
2189
2190DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2191DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2192
Christoph Hellwiga46db602011-01-07 13:02:04 +00002193DECLARE_EVENT_CLASS(xfs_discard_class,
2194 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2195 xfs_agblock_t agbno, xfs_extlen_t len),
2196 TP_ARGS(mp, agno, agbno, len),
2197 TP_STRUCT__entry(
2198 __field(dev_t, dev)
2199 __field(xfs_agnumber_t, agno)
2200 __field(xfs_agblock_t, agbno)
2201 __field(xfs_extlen_t, len)
2202 ),
2203 TP_fast_assign(
2204 __entry->dev = mp->m_super->s_dev;
2205 __entry->agno = agno;
2206 __entry->agbno = agbno;
2207 __entry->len = len;
2208 ),
2209 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
2210 MAJOR(__entry->dev), MINOR(__entry->dev),
2211 __entry->agno,
2212 __entry->agbno,
2213 __entry->len)
2214)
2215
2216#define DEFINE_DISCARD_EVENT(name) \
2217DEFINE_EVENT(xfs_discard_class, name, \
2218 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2219 xfs_agblock_t agbno, xfs_extlen_t len), \
2220 TP_ARGS(mp, agno, agbno, len))
2221DEFINE_DISCARD_EVENT(xfs_discard_extent);
2222DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2223DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2224DEFINE_DISCARD_EVENT(xfs_discard_busy);
2225
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002226/* btree cursor events */
2227DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2228 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2229 TP_ARGS(cur, level, bp),
2230 TP_STRUCT__entry(
2231 __field(dev_t, dev)
2232 __field(xfs_btnum_t, btnum)
2233 __field(int, level)
2234 __field(int, nlevels)
2235 __field(int, ptr)
2236 __field(xfs_daddr_t, daddr)
2237 ),
2238 TP_fast_assign(
2239 __entry->dev = cur->bc_mp->m_super->s_dev;
2240 __entry->btnum = cur->bc_btnum;
2241 __entry->level = level;
2242 __entry->nlevels = cur->bc_nlevels;
2243 __entry->ptr = cur->bc_ptrs[level];
2244 __entry->daddr = bp ? bp->b_bn : -1;
2245 ),
2246 TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
2247 MAJOR(__entry->dev), MINOR(__entry->dev),
2248 __entry->btnum,
2249 __entry->level,
2250 __entry->nlevels,
2251 __entry->ptr,
2252 (unsigned long long)__entry->daddr)
2253)
2254
2255#define DEFINE_BTREE_CUR_EVENT(name) \
2256DEFINE_EVENT(xfs_btree_cur_class, name, \
2257 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2258 TP_ARGS(cur, level, bp))
2259DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
Darrick J. Wong105f7d82016-08-03 11:10:21 +10002260DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002261
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002262/* deferred ops */
2263struct xfs_defer_pending;
2264struct xfs_defer_intake;
2265struct xfs_defer_ops;
2266
2267DECLARE_EVENT_CLASS(xfs_defer_class,
2268 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop),
2269 TP_ARGS(mp, dop),
2270 TP_STRUCT__entry(
2271 __field(dev_t, dev)
2272 __field(void *, dop)
2273 __field(bool, committed)
2274 __field(bool, low)
2275 ),
2276 TP_fast_assign(
2277 __entry->dev = mp ? mp->m_super->s_dev : 0;
2278 __entry->dop = dop;
2279 __entry->committed = dop->dop_committed;
2280 __entry->low = dop->dop_low;
2281 ),
2282 TP_printk("dev %d:%d ops %p committed %d low %d\n",
2283 MAJOR(__entry->dev), MINOR(__entry->dev),
2284 __entry->dop,
2285 __entry->committed,
2286 __entry->low)
2287)
2288#define DEFINE_DEFER_EVENT(name) \
2289DEFINE_EVENT(xfs_defer_class, name, \
2290 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \
2291 TP_ARGS(mp, dop))
2292
2293DECLARE_EVENT_CLASS(xfs_defer_error_class,
2294 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error),
2295 TP_ARGS(mp, dop, error),
2296 TP_STRUCT__entry(
2297 __field(dev_t, dev)
2298 __field(void *, dop)
2299 __field(bool, committed)
2300 __field(bool, low)
2301 __field(int, error)
2302 ),
2303 TP_fast_assign(
2304 __entry->dev = mp ? mp->m_super->s_dev : 0;
2305 __entry->dop = dop;
2306 __entry->committed = dop->dop_committed;
2307 __entry->low = dop->dop_low;
2308 __entry->error = error;
2309 ),
2310 TP_printk("dev %d:%d ops %p committed %d low %d err %d\n",
2311 MAJOR(__entry->dev), MINOR(__entry->dev),
2312 __entry->dop,
2313 __entry->committed,
2314 __entry->low,
2315 __entry->error)
2316)
2317#define DEFINE_DEFER_ERROR_EVENT(name) \
2318DEFINE_EVENT(xfs_defer_error_class, name, \
2319 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \
2320 TP_ARGS(mp, dop, error))
2321
2322DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2323 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2324 TP_ARGS(mp, dfp),
2325 TP_STRUCT__entry(
2326 __field(dev_t, dev)
2327 __field(int, type)
2328 __field(void *, intent)
2329 __field(bool, committed)
2330 __field(int, nr)
2331 ),
2332 TP_fast_assign(
2333 __entry->dev = mp ? mp->m_super->s_dev : 0;
2334 __entry->type = dfp->dfp_type->type;
2335 __entry->intent = dfp->dfp_intent;
Darrick J. Wongea78d802016-08-30 13:51:39 +10002336 __entry->committed = dfp->dfp_done != NULL;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002337 __entry->nr = dfp->dfp_count;
2338 ),
2339 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d\n",
2340 MAJOR(__entry->dev), MINOR(__entry->dev),
2341 __entry->type,
2342 __entry->intent,
2343 __entry->committed,
2344 __entry->nr)
2345)
2346#define DEFINE_DEFER_PENDING_EVENT(name) \
2347DEFINE_EVENT(xfs_defer_pending_class, name, \
2348 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2349 TP_ARGS(mp, dfp))
2350
2351DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2352 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2353 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2354 TP_ARGS(mp, agno, type, agbno, len),
2355 TP_STRUCT__entry(
2356 __field(dev_t, dev)
2357 __field(xfs_agnumber_t, agno)
2358 __field(int, type)
2359 __field(xfs_agblock_t, agbno)
2360 __field(xfs_extlen_t, len)
2361 ),
2362 TP_fast_assign(
2363 __entry->dev = mp->m_super->s_dev;
2364 __entry->agno = agno;
2365 __entry->type = type;
2366 __entry->agbno = agbno;
2367 __entry->len = len;
2368 ),
2369 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2370 MAJOR(__entry->dev), MINOR(__entry->dev),
2371 __entry->type,
2372 __entry->agno,
2373 __entry->agbno,
2374 __entry->len)
2375);
2376#define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2377DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2378 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2379 int type, \
2380 xfs_agblock_t bno, \
2381 xfs_extlen_t len), \
2382 TP_ARGS(mp, agno, type, bno, len))
2383
2384DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2385 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2386 int op,
2387 xfs_agblock_t agbno,
2388 xfs_ino_t ino,
2389 int whichfork,
2390 xfs_fileoff_t offset,
2391 xfs_filblks_t len,
2392 xfs_exntst_t state),
2393 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2394 TP_STRUCT__entry(
2395 __field(dev_t, dev)
2396 __field(xfs_agnumber_t, agno)
2397 __field(xfs_ino_t, ino)
2398 __field(xfs_agblock_t, agbno)
2399 __field(int, whichfork)
2400 __field(xfs_fileoff_t, l_loff)
2401 __field(xfs_filblks_t, l_len)
2402 __field(xfs_exntst_t, l_state)
2403 __field(int, op)
2404 ),
2405 TP_fast_assign(
2406 __entry->dev = mp->m_super->s_dev;
2407 __entry->agno = agno;
2408 __entry->ino = ino;
2409 __entry->agbno = agbno;
2410 __entry->whichfork = whichfork;
2411 __entry->l_loff = offset;
2412 __entry->l_len = len;
2413 __entry->l_state = state;
2414 __entry->op = op;
2415 ),
2416 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2417 MAJOR(__entry->dev), MINOR(__entry->dev),
2418 __entry->op,
2419 __entry->agno,
2420 __entry->agbno,
2421 __entry->ino,
2422 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
2423 __entry->l_loff,
2424 __entry->l_len,
2425 __entry->l_state)
2426);
2427#define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2428DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2429 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2430 int op, \
2431 xfs_agblock_t agbno, \
2432 xfs_ino_t ino, \
2433 int whichfork, \
2434 xfs_fileoff_t offset, \
2435 xfs_filblks_t len, \
2436 xfs_exntst_t state), \
2437 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2438
2439DEFINE_DEFER_EVENT(xfs_defer_init);
2440DEFINE_DEFER_EVENT(xfs_defer_cancel);
2441DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2442DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2443DEFINE_DEFER_EVENT(xfs_defer_finish);
2444DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2445
2446DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2447DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2448DEFINE_DEFER_ERROR_EVENT(xfs_defer_op_finish_error);
2449
2450DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work);
2451DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel);
2452DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_commit);
2453DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel);
2454DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2455DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2456
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002457#define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2458DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2459DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2460
Darrick J. Wong673930c2016-08-03 11:33:43 +10002461/* rmap tracepoints */
2462DECLARE_EVENT_CLASS(xfs_rmap_class,
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 TP_STRUCT__entry(
2468 __field(dev_t, dev)
2469 __field(xfs_agnumber_t, agno)
2470 __field(xfs_agblock_t, agbno)
2471 __field(xfs_extlen_t, len)
2472 __field(uint64_t, owner)
2473 __field(uint64_t, offset)
2474 __field(unsigned long, flags)
2475 ),
2476 TP_fast_assign(
2477 __entry->dev = mp->m_super->s_dev;
2478 __entry->agno = agno;
2479 __entry->agbno = agbno;
2480 __entry->len = len;
2481 __entry->owner = oinfo->oi_owner;
2482 __entry->offset = oinfo->oi_offset;
2483 __entry->flags = oinfo->oi_flags;
Darrick J. Wong035e00a2016-08-03 11:36:07 +10002484 if (unwritten)
2485 __entry->flags |= XFS_RMAP_UNWRITTEN;
Darrick J. Wong673930c2016-08-03 11:33:43 +10002486 ),
2487 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2488 MAJOR(__entry->dev), MINOR(__entry->dev),
2489 __entry->agno,
2490 __entry->agbno,
2491 __entry->len,
2492 __entry->owner,
2493 __entry->offset,
2494 __entry->flags)
2495);
2496#define DEFINE_RMAP_EVENT(name) \
2497DEFINE_EVENT(xfs_rmap_class, name, \
2498 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2499 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2500 struct xfs_owner_info *oinfo), \
2501 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2502
2503/* simple AG-based error/%ip tracepoint class */
2504DECLARE_EVENT_CLASS(xfs_ag_error_class,
2505 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2506 unsigned long caller_ip),
2507 TP_ARGS(mp, agno, error, caller_ip),
2508 TP_STRUCT__entry(
2509 __field(dev_t, dev)
2510 __field(xfs_agnumber_t, agno)
2511 __field(int, error)
2512 __field(unsigned long, caller_ip)
2513 ),
2514 TP_fast_assign(
2515 __entry->dev = mp->m_super->s_dev;
2516 __entry->agno = agno;
2517 __entry->error = error;
2518 __entry->caller_ip = caller_ip;
2519 ),
2520 TP_printk("dev %d:%d agno %u error %d caller %ps",
2521 MAJOR(__entry->dev), MINOR(__entry->dev),
2522 __entry->agno,
2523 __entry->error,
2524 (char *)__entry->caller_ip)
2525);
2526
2527#define DEFINE_AG_ERROR_EVENT(name) \
2528DEFINE_EVENT(xfs_ag_error_class, name, \
2529 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2530 unsigned long caller_ip), \
2531 TP_ARGS(mp, agno, error, caller_ip))
2532
2533DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2534DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2535DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2536DEFINE_RMAP_EVENT(xfs_rmap_map);
2537DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2538DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002539DEFINE_RMAP_EVENT(xfs_rmap_convert);
2540DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2541DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2542DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
Darrick J. Wong673930c2016-08-03 11:33:43 +10002543
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002544DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2545 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2546 xfs_agblock_t agbno, xfs_extlen_t len,
2547 uint64_t owner, uint64_t offset, unsigned int flags),
2548 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2549 TP_STRUCT__entry(
2550 __field(dev_t, dev)
2551 __field(xfs_agnumber_t, agno)
2552 __field(xfs_agblock_t, agbno)
2553 __field(xfs_extlen_t, len)
2554 __field(uint64_t, owner)
2555 __field(uint64_t, offset)
2556 __field(unsigned int, flags)
2557 ),
2558 TP_fast_assign(
2559 __entry->dev = mp->m_super->s_dev;
2560 __entry->agno = agno;
2561 __entry->agbno = agbno;
2562 __entry->len = len;
2563 __entry->owner = owner;
2564 __entry->offset = offset;
2565 __entry->flags = flags;
2566 ),
2567 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2568 MAJOR(__entry->dev), MINOR(__entry->dev),
2569 __entry->agno,
2570 __entry->agbno,
2571 __entry->len,
2572 __entry->owner,
2573 __entry->offset,
2574 __entry->flags)
2575);
2576#define DEFINE_RMAPBT_EVENT(name) \
2577DEFINE_EVENT(xfs_rmapbt_class, name, \
2578 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2579 xfs_agblock_t agbno, xfs_extlen_t len, \
2580 uint64_t owner, uint64_t offset, unsigned int flags), \
2581 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2582
2583#define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2584DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2585DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2586
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002587DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2588DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002589DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2590DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2591DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2592DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2593DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2594DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
Darrick J. Wong0a1b0b32016-08-03 11:44:21 +10002595DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2596DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002597DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002598
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10002599/* per-AG reservation */
2600DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2601 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2602 xfs_extlen_t len),
2603 TP_ARGS(pag, resv, len),
2604 TP_STRUCT__entry(
2605 __field(dev_t, dev)
2606 __field(xfs_agnumber_t, agno)
2607 __field(int, resv)
2608 __field(xfs_extlen_t, freeblks)
2609 __field(xfs_extlen_t, flcount)
2610 __field(xfs_extlen_t, reserved)
2611 __field(xfs_extlen_t, asked)
2612 __field(xfs_extlen_t, len)
2613 ),
2614 TP_fast_assign(
2615 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2616
2617 __entry->dev = pag->pag_mount->m_super->s_dev;
2618 __entry->agno = pag->pag_agno;
2619 __entry->resv = resv;
2620 __entry->freeblks = pag->pagf_freeblks;
2621 __entry->flcount = pag->pagf_flcount;
2622 __entry->reserved = r ? r->ar_reserved : 0;
2623 __entry->asked = r ? r->ar_asked : 0;
2624 __entry->len = len;
2625 ),
2626 TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u resv %u ask %u len %u\n",
2627 MAJOR(__entry->dev), MINOR(__entry->dev),
2628 __entry->agno,
2629 __entry->resv,
2630 __entry->freeblks,
2631 __entry->flcount,
2632 __entry->reserved,
2633 __entry->asked,
2634 __entry->len)
2635)
2636#define DEFINE_AG_RESV_EVENT(name) \
2637DEFINE_EVENT(xfs_ag_resv_class, name, \
2638 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2639 xfs_extlen_t len), \
2640 TP_ARGS(pag, type, len))
2641
2642/* per-AG reservation tracepoints */
2643DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2644DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2645DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2646DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2647DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2648DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2649
2650DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2651DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2652
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002653/* refcount tracepoint classes */
2654
2655/* reuse the discard trace class for agbno/aglen-based traces */
2656#define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2657
2658/* ag btree lookup tracepoint class */
2659#define XFS_AG_BTREE_CMP_FORMAT_STR \
2660 { XFS_LOOKUP_EQ, "eq" }, \
2661 { XFS_LOOKUP_LE, "le" }, \
2662 { XFS_LOOKUP_GE, "ge" }
2663DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2664 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2665 xfs_agblock_t agbno, xfs_lookup_t dir),
2666 TP_ARGS(mp, agno, agbno, dir),
2667 TP_STRUCT__entry(
2668 __field(dev_t, dev)
2669 __field(xfs_agnumber_t, agno)
2670 __field(xfs_agblock_t, agbno)
2671 __field(xfs_lookup_t, dir)
2672 ),
2673 TP_fast_assign(
2674 __entry->dev = mp->m_super->s_dev;
2675 __entry->agno = agno;
2676 __entry->agbno = agbno;
2677 __entry->dir = dir;
2678 ),
2679 TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)\n",
2680 MAJOR(__entry->dev), MINOR(__entry->dev),
2681 __entry->agno,
2682 __entry->agbno,
2683 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2684 __entry->dir)
2685)
2686
2687#define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2688DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2689 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2690 xfs_agblock_t agbno, xfs_lookup_t dir), \
2691 TP_ARGS(mp, agno, agbno, dir))
2692
2693/* single-rcext tracepoint class */
2694DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2695 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2696 struct xfs_refcount_irec *irec),
2697 TP_ARGS(mp, agno, irec),
2698 TP_STRUCT__entry(
2699 __field(dev_t, dev)
2700 __field(xfs_agnumber_t, agno)
2701 __field(xfs_agblock_t, startblock)
2702 __field(xfs_extlen_t, blockcount)
2703 __field(xfs_nlink_t, refcount)
2704 ),
2705 TP_fast_assign(
2706 __entry->dev = mp->m_super->s_dev;
2707 __entry->agno = agno;
2708 __entry->startblock = irec->rc_startblock;
2709 __entry->blockcount = irec->rc_blockcount;
2710 __entry->refcount = irec->rc_refcount;
2711 ),
2712 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u\n",
2713 MAJOR(__entry->dev), MINOR(__entry->dev),
2714 __entry->agno,
2715 __entry->startblock,
2716 __entry->blockcount,
2717 __entry->refcount)
2718)
2719
2720#define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2721DEFINE_EVENT(xfs_refcount_extent_class, name, \
2722 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2723 struct xfs_refcount_irec *irec), \
2724 TP_ARGS(mp, agno, irec))
2725
2726/* single-rcext and an agbno tracepoint class */
2727DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2728 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2729 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2730 TP_ARGS(mp, agno, irec, agbno),
2731 TP_STRUCT__entry(
2732 __field(dev_t, dev)
2733 __field(xfs_agnumber_t, agno)
2734 __field(xfs_agblock_t, startblock)
2735 __field(xfs_extlen_t, blockcount)
2736 __field(xfs_nlink_t, refcount)
2737 __field(xfs_agblock_t, agbno)
2738 ),
2739 TP_fast_assign(
2740 __entry->dev = mp->m_super->s_dev;
2741 __entry->agno = agno;
2742 __entry->startblock = irec->rc_startblock;
2743 __entry->blockcount = irec->rc_blockcount;
2744 __entry->refcount = irec->rc_refcount;
2745 __entry->agbno = agbno;
2746 ),
2747 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u\n",
2748 MAJOR(__entry->dev), MINOR(__entry->dev),
2749 __entry->agno,
2750 __entry->startblock,
2751 __entry->blockcount,
2752 __entry->refcount,
2753 __entry->agbno)
2754)
2755
2756#define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2757DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2758 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2759 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2760 TP_ARGS(mp, agno, irec, agbno))
2761
2762/* double-rcext tracepoint class */
2763DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
2764 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2765 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
2766 TP_ARGS(mp, agno, i1, i2),
2767 TP_STRUCT__entry(
2768 __field(dev_t, dev)
2769 __field(xfs_agnumber_t, agno)
2770 __field(xfs_agblock_t, i1_startblock)
2771 __field(xfs_extlen_t, i1_blockcount)
2772 __field(xfs_nlink_t, i1_refcount)
2773 __field(xfs_agblock_t, i2_startblock)
2774 __field(xfs_extlen_t, i2_blockcount)
2775 __field(xfs_nlink_t, i2_refcount)
2776 ),
2777 TP_fast_assign(
2778 __entry->dev = mp->m_super->s_dev;
2779 __entry->agno = agno;
2780 __entry->i1_startblock = i1->rc_startblock;
2781 __entry->i1_blockcount = i1->rc_blockcount;
2782 __entry->i1_refcount = i1->rc_refcount;
2783 __entry->i2_startblock = i2->rc_startblock;
2784 __entry->i2_blockcount = i2->rc_blockcount;
2785 __entry->i2_refcount = i2->rc_refcount;
2786 ),
2787 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2788 "agbno %u len %u refcount %u\n",
2789 MAJOR(__entry->dev), MINOR(__entry->dev),
2790 __entry->agno,
2791 __entry->i1_startblock,
2792 __entry->i1_blockcount,
2793 __entry->i1_refcount,
2794 __entry->i2_startblock,
2795 __entry->i2_blockcount,
2796 __entry->i2_refcount)
2797)
2798
2799#define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
2800DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
2801 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2802 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
2803 TP_ARGS(mp, agno, i1, i2))
2804
2805/* double-rcext and an agbno tracepoint class */
2806DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
2807 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2808 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2809 xfs_agblock_t agbno),
2810 TP_ARGS(mp, agno, i1, i2, agbno),
2811 TP_STRUCT__entry(
2812 __field(dev_t, dev)
2813 __field(xfs_agnumber_t, agno)
2814 __field(xfs_agblock_t, i1_startblock)
2815 __field(xfs_extlen_t, i1_blockcount)
2816 __field(xfs_nlink_t, i1_refcount)
2817 __field(xfs_agblock_t, i2_startblock)
2818 __field(xfs_extlen_t, i2_blockcount)
2819 __field(xfs_nlink_t, i2_refcount)
2820 __field(xfs_agblock_t, agbno)
2821 ),
2822 TP_fast_assign(
2823 __entry->dev = mp->m_super->s_dev;
2824 __entry->agno = agno;
2825 __entry->i1_startblock = i1->rc_startblock;
2826 __entry->i1_blockcount = i1->rc_blockcount;
2827 __entry->i1_refcount = i1->rc_refcount;
2828 __entry->i2_startblock = i2->rc_startblock;
2829 __entry->i2_blockcount = i2->rc_blockcount;
2830 __entry->i2_refcount = i2->rc_refcount;
2831 __entry->agbno = agbno;
2832 ),
2833 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2834 "agbno %u len %u refcount %u @ agbno %u\n",
2835 MAJOR(__entry->dev), MINOR(__entry->dev),
2836 __entry->agno,
2837 __entry->i1_startblock,
2838 __entry->i1_blockcount,
2839 __entry->i1_refcount,
2840 __entry->i2_startblock,
2841 __entry->i2_blockcount,
2842 __entry->i2_refcount,
2843 __entry->agbno)
2844)
2845
2846#define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
2847DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
2848 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2849 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2850 xfs_agblock_t agbno), \
2851 TP_ARGS(mp, agno, i1, i2, agbno))
2852
2853/* triple-rcext tracepoint class */
2854DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
2855 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2856 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2857 struct xfs_refcount_irec *i3),
2858 TP_ARGS(mp, agno, i1, i2, i3),
2859 TP_STRUCT__entry(
2860 __field(dev_t, dev)
2861 __field(xfs_agnumber_t, agno)
2862 __field(xfs_agblock_t, i1_startblock)
2863 __field(xfs_extlen_t, i1_blockcount)
2864 __field(xfs_nlink_t, i1_refcount)
2865 __field(xfs_agblock_t, i2_startblock)
2866 __field(xfs_extlen_t, i2_blockcount)
2867 __field(xfs_nlink_t, i2_refcount)
2868 __field(xfs_agblock_t, i3_startblock)
2869 __field(xfs_extlen_t, i3_blockcount)
2870 __field(xfs_nlink_t, i3_refcount)
2871 ),
2872 TP_fast_assign(
2873 __entry->dev = mp->m_super->s_dev;
2874 __entry->agno = agno;
2875 __entry->i1_startblock = i1->rc_startblock;
2876 __entry->i1_blockcount = i1->rc_blockcount;
2877 __entry->i1_refcount = i1->rc_refcount;
2878 __entry->i2_startblock = i2->rc_startblock;
2879 __entry->i2_blockcount = i2->rc_blockcount;
2880 __entry->i2_refcount = i2->rc_refcount;
2881 __entry->i3_startblock = i3->rc_startblock;
2882 __entry->i3_blockcount = i3->rc_blockcount;
2883 __entry->i3_refcount = i3->rc_refcount;
2884 ),
2885 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2886 "agbno %u len %u refcount %u -- "
2887 "agbno %u len %u refcount %u\n",
2888 MAJOR(__entry->dev), MINOR(__entry->dev),
2889 __entry->agno,
2890 __entry->i1_startblock,
2891 __entry->i1_blockcount,
2892 __entry->i1_refcount,
2893 __entry->i2_startblock,
2894 __entry->i2_blockcount,
2895 __entry->i2_refcount,
2896 __entry->i3_startblock,
2897 __entry->i3_blockcount,
2898 __entry->i3_refcount)
2899);
2900
2901#define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
2902DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
2903 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2904 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2905 struct xfs_refcount_irec *i3), \
2906 TP_ARGS(mp, agno, i1, i2, i3))
2907
2908/* refcount btree tracepoints */
2909DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
2910DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
2911DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
2912DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
2913DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
2914DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
2915DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
2916DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
2917DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
2918DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
2919
2920/* refcount adjustment tracepoints */
2921DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
2922DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
2923DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
2924DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
2925DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
2926DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
2927DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
2928DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
2929DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
2930DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
2931DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
2932DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
2933DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
2934DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
2935DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
2936DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
2937DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
2938
2939/* reflink helpers */
2940DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
2941DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
2942DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
2943
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00002944#endif /* _TRACE_XFS_H */
2945
2946#undef TRACE_INCLUDE_PATH
2947#define TRACE_INCLUDE_PATH .
2948#define TRACE_INCLUDE_FILE xfs_trace
2949#include <trace/define_trace.h>