blob: 8d916d33d93da78a4fb6d214fbd4282948211bc8 [file] [log] [blame]
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001/*
2 * Copyright (c) 2009, Christoph Hellwig
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#undef TRACE_SYSTEM
19#define TRACE_SYSTEM xfs
20
21#if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
22#define _TRACE_XFS_H
23
24#include <linux/tracepoint.h>
25
26struct xfs_agf;
27struct xfs_alloc_arg;
28struct xfs_attr_list_context;
29struct xfs_buf_log_item;
30struct xfs_da_args;
31struct xfs_da_node_entry;
32struct xfs_dquot;
Christoph Hellwig9e4c1092011-10-11 15:14:11 +000033struct xfs_log_item;
Mark Tinguelyad223e62012-06-14 09:22:15 -050034struct xlog;
Dave Chinner750b9c92013-11-01 15:27:18 +110035struct xlog_ticket;
Dave Chinner9abbc532010-04-13 15:06:46 +100036struct xlog_recover;
37struct xlog_recover_item;
38struct xfs_buf_log_format;
39struct xfs_inode_log_format;
Alex Elder1ed845d2012-08-01 09:56:49 -050040struct xfs_bmbt_irec;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000041
Christoph Hellwigea9a4882009-12-21 14:03:03 +000042DECLARE_EVENT_CLASS(xfs_attr_list_class,
43 TP_PROTO(struct xfs_attr_list_context *ctx),
44 TP_ARGS(ctx),
45 TP_STRUCT__entry(
46 __field(dev_t, dev)
47 __field(xfs_ino_t, ino)
48 __field(u32, hashval)
49 __field(u32, blkno)
50 __field(u32, offset)
51 __field(void *, alist)
52 __field(int, bufsize)
53 __field(int, count)
54 __field(int, firstu)
55 __field(int, dupcnt)
56 __field(int, flags)
57 ),
58 TP_fast_assign(
59 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
60 __entry->ino = ctx->dp->i_ino;
61 __entry->hashval = ctx->cursor->hashval;
62 __entry->blkno = ctx->cursor->blkno;
63 __entry->offset = ctx->cursor->offset;
64 __entry->alist = ctx->alist;
65 __entry->bufsize = ctx->bufsize;
66 __entry->count = ctx->count;
67 __entry->firstu = ctx->firstu;
68 __entry->flags = ctx->flags;
69 ),
70 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
71 "alist 0x%p size %u count %u firstu %u flags %d %s",
72 MAJOR(__entry->dev), MINOR(__entry->dev),
73 __entry->ino,
74 __entry->hashval,
75 __entry->blkno,
76 __entry->offset,
77 __entry->dupcnt,
78 __entry->alist,
79 __entry->bufsize,
80 __entry->count,
81 __entry->firstu,
82 __entry->flags,
83 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
84 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000085)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000086
87#define DEFINE_ATTR_LIST_EVENT(name) \
88DEFINE_EVENT(xfs_attr_list_class, name, \
89 TP_PROTO(struct xfs_attr_list_context *ctx), \
90 TP_ARGS(ctx))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000091DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
92DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
93DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
94DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
95DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
96DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
97DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
98DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
Dave Chinneree732592012-11-12 22:53:53 +110099DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
100DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000101
Li Zefanf8adb4d2010-05-24 08:25:57 +0000102DECLARE_EVENT_CLASS(xfs_perag_class,
103 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
104 unsigned long caller_ip),
105 TP_ARGS(mp, agno, refcount, caller_ip),
106 TP_STRUCT__entry(
107 __field(dev_t, dev)
108 __field(xfs_agnumber_t, agno)
109 __field(int, refcount)
110 __field(unsigned long, caller_ip)
111 ),
112 TP_fast_assign(
113 __entry->dev = mp->m_super->s_dev;
114 __entry->agno = agno;
115 __entry->refcount = refcount;
116 __entry->caller_ip = caller_ip;
117 ),
Scott Wood65dd2972015-03-25 14:56:21 +1100118 TP_printk("dev %d:%d agno %u refcount %d caller %ps",
Li Zefanf8adb4d2010-05-24 08:25:57 +0000119 MAJOR(__entry->dev), MINOR(__entry->dev),
120 __entry->agno,
121 __entry->refcount,
122 (char *)__entry->caller_ip)
123);
124
125#define DEFINE_PERAG_REF_EVENT(name) \
126DEFINE_EVENT(xfs_perag_class, name, \
127 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
128 unsigned long caller_ip), \
129 TP_ARGS(mp, agno, refcount, caller_ip))
130DEFINE_PERAG_REF_EVENT(xfs_perag_get);
Dave Chinner65d0f202010-09-24 18:40:15 +1000131DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000132DEFINE_PERAG_REF_EVENT(xfs_perag_put);
Dave Chinner16fd5362010-07-20 09:43:39 +1000133DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
134DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
Brian Foster27b52862012-11-06 09:50:38 -0500135DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
136DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000137
Dave Chinnerd1230312013-11-01 15:27:19 +1100138DECLARE_EVENT_CLASS(xfs_ag_class,
139 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
140 TP_ARGS(mp, agno),
141 TP_STRUCT__entry(
142 __field(dev_t, dev)
143 __field(xfs_agnumber_t, agno)
144 ),
145 TP_fast_assign(
146 __entry->dev = mp->m_super->s_dev;
147 __entry->agno = agno;
148 ),
149 TP_printk("dev %d:%d agno %u",
150 MAJOR(__entry->dev), MINOR(__entry->dev),
151 __entry->agno)
152);
153#define DEFINE_AG_EVENT(name) \
154DEFINE_EVENT(xfs_ag_class, name, \
155 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
156 TP_ARGS(mp, agno))
157
158DEFINE_AG_EVENT(xfs_read_agf);
159DEFINE_AG_EVENT(xfs_alloc_read_agf);
160DEFINE_AG_EVENT(xfs_read_agi);
161DEFINE_AG_EVENT(xfs_ialloc_read_agi);
162
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000163TRACE_EVENT(xfs_attr_list_node_descend,
164 TP_PROTO(struct xfs_attr_list_context *ctx,
165 struct xfs_da_node_entry *btree),
166 TP_ARGS(ctx, btree),
167 TP_STRUCT__entry(
168 __field(dev_t, dev)
169 __field(xfs_ino_t, ino)
170 __field(u32, hashval)
171 __field(u32, blkno)
172 __field(u32, offset)
173 __field(void *, alist)
174 __field(int, bufsize)
175 __field(int, count)
176 __field(int, firstu)
177 __field(int, dupcnt)
178 __field(int, flags)
179 __field(u32, bt_hashval)
180 __field(u32, bt_before)
181 ),
182 TP_fast_assign(
183 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
184 __entry->ino = ctx->dp->i_ino;
185 __entry->hashval = ctx->cursor->hashval;
186 __entry->blkno = ctx->cursor->blkno;
187 __entry->offset = ctx->cursor->offset;
188 __entry->alist = ctx->alist;
189 __entry->bufsize = ctx->bufsize;
190 __entry->count = ctx->count;
191 __entry->firstu = ctx->firstu;
192 __entry->flags = ctx->flags;
193 __entry->bt_hashval = be32_to_cpu(btree->hashval);
194 __entry->bt_before = be32_to_cpu(btree->before);
195 ),
196 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
197 "alist 0x%p size %u count %u firstu %u flags %d %s "
198 "node hashval %u, node before %u",
199 MAJOR(__entry->dev), MINOR(__entry->dev),
200 __entry->ino,
201 __entry->hashval,
202 __entry->blkno,
203 __entry->offset,
204 __entry->dupcnt,
205 __entry->alist,
206 __entry->bufsize,
207 __entry->count,
208 __entry->firstu,
209 __entry->flags,
210 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
211 __entry->bt_hashval,
212 __entry->bt_before)
213);
214
215TRACE_EVENT(xfs_iext_insert,
216 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
217 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
218 TP_ARGS(ip, idx, r, state, caller_ip),
219 TP_STRUCT__entry(
220 __field(dev_t, dev)
221 __field(xfs_ino_t, ino)
222 __field(xfs_extnum_t, idx)
223 __field(xfs_fileoff_t, startoff)
224 __field(xfs_fsblock_t, startblock)
225 __field(xfs_filblks_t, blockcount)
226 __field(xfs_exntst_t, state)
227 __field(int, bmap_state)
228 __field(unsigned long, caller_ip)
229 ),
230 TP_fast_assign(
231 __entry->dev = VFS_I(ip)->i_sb->s_dev;
232 __entry->ino = ip->i_ino;
233 __entry->idx = idx;
234 __entry->startoff = r->br_startoff;
235 __entry->startblock = r->br_startblock;
236 __entry->blockcount = r->br_blockcount;
237 __entry->state = r->br_state;
238 __entry->bmap_state = state;
239 __entry->caller_ip = caller_ip;
240 ),
241 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Scott Wood65dd2972015-03-25 14:56:21 +1100242 "offset %lld block %lld count %lld flag %d caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000243 MAJOR(__entry->dev), MINOR(__entry->dev),
244 __entry->ino,
245 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
246 (long)__entry->idx,
247 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000248 (__int64_t)__entry->startblock,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000249 __entry->blockcount,
250 __entry->state,
251 (char *)__entry->caller_ip)
252);
253
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000254DECLARE_EVENT_CLASS(xfs_bmap_class,
255 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
256 unsigned long caller_ip),
257 TP_ARGS(ip, idx, state, caller_ip),
258 TP_STRUCT__entry(
259 __field(dev_t, dev)
260 __field(xfs_ino_t, ino)
261 __field(xfs_extnum_t, idx)
262 __field(xfs_fileoff_t, startoff)
263 __field(xfs_fsblock_t, startblock)
264 __field(xfs_filblks_t, blockcount)
265 __field(xfs_exntst_t, state)
266 __field(int, bmap_state)
267 __field(unsigned long, caller_ip)
268 ),
269 TP_fast_assign(
270 struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ?
271 ip->i_afp : &ip->i_df;
272 struct xfs_bmbt_irec r;
273
274 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
275 __entry->dev = VFS_I(ip)->i_sb->s_dev;
276 __entry->ino = ip->i_ino;
277 __entry->idx = idx;
278 __entry->startoff = r.br_startoff;
279 __entry->startblock = r.br_startblock;
280 __entry->blockcount = r.br_blockcount;
281 __entry->state = r.br_state;
282 __entry->bmap_state = state;
283 __entry->caller_ip = caller_ip;
284 ),
285 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Scott Wood65dd2972015-03-25 14:56:21 +1100286 "offset %lld block %lld count %lld flag %d caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000287 MAJOR(__entry->dev), MINOR(__entry->dev),
288 __entry->ino,
289 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
290 (long)__entry->idx,
291 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000292 (__int64_t)__entry->startblock,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000293 __entry->blockcount,
294 __entry->state,
295 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000296)
297
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000298#define DEFINE_BMAP_EVENT(name) \
299DEFINE_EVENT(xfs_bmap_class, name, \
300 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
301 unsigned long caller_ip), \
302 TP_ARGS(ip, idx, state, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000303DEFINE_BMAP_EVENT(xfs_iext_remove);
304DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
305DEFINE_BMAP_EVENT(xfs_bmap_post_update);
306DEFINE_BMAP_EVENT(xfs_extlist);
307
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000308DECLARE_EVENT_CLASS(xfs_buf_class,
309 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
310 TP_ARGS(bp, caller_ip),
311 TP_STRUCT__entry(
312 __field(dev_t, dev)
313 __field(xfs_daddr_t, bno)
Dave Chinner4e94b712012-04-23 15:58:51 +1000314 __field(int, nblks)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000315 __field(int, hold)
316 __field(int, pincount)
317 __field(unsigned, lockval)
318 __field(unsigned, flags)
319 __field(unsigned long, caller_ip)
320 ),
321 TP_fast_assign(
322 __entry->dev = bp->b_target->bt_dev;
323 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000324 __entry->nblks = bp->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000325 __entry->hold = atomic_read(&bp->b_hold);
326 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200327 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000328 __entry->flags = bp->b_flags;
329 __entry->caller_ip = caller_ip;
330 ),
Dave Chinner4e94b712012-04-23 15:58:51 +1000331 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
Scott Wood65dd2972015-03-25 14:56:21 +1100332 "lock %d flags %s caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000333 MAJOR(__entry->dev), MINOR(__entry->dev),
334 (unsigned long long)__entry->bno,
Dave Chinner4e94b712012-04-23 15:58:51 +1000335 __entry->nblks,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000336 __entry->hold,
337 __entry->pincount,
338 __entry->lockval,
339 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
340 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000341)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000342
343#define DEFINE_BUF_EVENT(name) \
344DEFINE_EVENT(xfs_buf_class, name, \
345 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
346 TP_ARGS(bp, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000347DEFINE_BUF_EVENT(xfs_buf_init);
348DEFINE_BUF_EVENT(xfs_buf_free);
349DEFINE_BUF_EVENT(xfs_buf_hold);
350DEFINE_BUF_EVENT(xfs_buf_rele);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000351DEFINE_BUF_EVENT(xfs_buf_iodone);
Dave Chinner595bff72014-10-02 09:05:14 +1000352DEFINE_BUF_EVENT(xfs_buf_submit);
353DEFINE_BUF_EVENT(xfs_buf_submit_wait);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000354DEFINE_BUF_EVENT(xfs_buf_bawrite);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000355DEFINE_BUF_EVENT(xfs_buf_lock);
356DEFINE_BUF_EVENT(xfs_buf_lock_done);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200357DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000358DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000359DEFINE_BUF_EVENT(xfs_buf_iowait);
360DEFINE_BUF_EVENT(xfs_buf_iowait_done);
361DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000362DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000363DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Dave Chinner686865f2010-09-24 20:07:47 +1000364DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000365DEFINE_BUF_EVENT(xfs_bdstrat_shut);
366DEFINE_BUF_EVENT(xfs_buf_item_relse);
367DEFINE_BUF_EVENT(xfs_buf_item_iodone);
368DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
369DEFINE_BUF_EVENT(xfs_buf_error_relse);
Dave Chinner9f878322013-01-21 23:53:55 +1100370DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000371DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
372DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
373
374/* not really buffer traces, but the buf provides useful information */
375DEFINE_BUF_EVENT(xfs_btree_corrupt);
376DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
377DEFINE_BUF_EVENT(xfs_reset_dqcounts);
378DEFINE_BUF_EVENT(xfs_inode_item_push);
379
380/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000381DECLARE_EVENT_CLASS(xfs_buf_flags_class,
382 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
383 TP_ARGS(bp, flags, caller_ip),
384 TP_STRUCT__entry(
385 __field(dev_t, dev)
386 __field(xfs_daddr_t, bno)
387 __field(size_t, buffer_length)
388 __field(int, hold)
389 __field(int, pincount)
390 __field(unsigned, lockval)
391 __field(unsigned, flags)
392 __field(unsigned long, caller_ip)
393 ),
394 TP_fast_assign(
395 __entry->dev = bp->b_target->bt_dev;
396 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000397 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000398 __entry->flags = flags;
399 __entry->hold = atomic_read(&bp->b_hold);
400 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200401 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000402 __entry->caller_ip = caller_ip;
403 ),
404 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Scott Wood65dd2972015-03-25 14:56:21 +1100405 "lock %d flags %s caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000406 MAJOR(__entry->dev), MINOR(__entry->dev),
407 (unsigned long long)__entry->bno,
408 __entry->buffer_length,
409 __entry->hold,
410 __entry->pincount,
411 __entry->lockval,
412 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
413 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000414)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000415
416#define DEFINE_BUF_FLAGS_EVENT(name) \
417DEFINE_EVENT(xfs_buf_flags_class, name, \
418 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
419 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000420DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
421DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
422DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
423
424TRACE_EVENT(xfs_buf_ioerror,
425 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
426 TP_ARGS(bp, error, caller_ip),
427 TP_STRUCT__entry(
428 __field(dev_t, dev)
429 __field(xfs_daddr_t, bno)
430 __field(size_t, buffer_length)
431 __field(unsigned, flags)
432 __field(int, hold)
433 __field(int, pincount)
434 __field(unsigned, lockval)
435 __field(int, error)
436 __field(unsigned long, caller_ip)
437 ),
438 TP_fast_assign(
439 __entry->dev = bp->b_target->bt_dev;
440 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000441 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000442 __entry->hold = atomic_read(&bp->b_hold);
443 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200444 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000445 __entry->error = error;
446 __entry->flags = bp->b_flags;
447 __entry->caller_ip = caller_ip;
448 ),
449 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Scott Wood65dd2972015-03-25 14:56:21 +1100450 "lock %d error %d flags %s caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000451 MAJOR(__entry->dev), MINOR(__entry->dev),
452 (unsigned long long)__entry->bno,
453 __entry->buffer_length,
454 __entry->hold,
455 __entry->pincount,
456 __entry->lockval,
457 __entry->error,
458 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
459 (void *)__entry->caller_ip)
460);
461
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000462DECLARE_EVENT_CLASS(xfs_buf_item_class,
463 TP_PROTO(struct xfs_buf_log_item *bip),
464 TP_ARGS(bip),
465 TP_STRUCT__entry(
466 __field(dev_t, dev)
467 __field(xfs_daddr_t, buf_bno)
468 __field(size_t, buf_len)
469 __field(int, buf_hold)
470 __field(int, buf_pincount)
471 __field(int, buf_lockval)
472 __field(unsigned, buf_flags)
473 __field(unsigned, bli_recur)
474 __field(int, bli_refcount)
475 __field(unsigned, bli_flags)
476 __field(void *, li_desc)
477 __field(unsigned, li_flags)
478 ),
479 TP_fast_assign(
480 __entry->dev = bip->bli_buf->b_target->bt_dev;
481 __entry->bli_flags = bip->bli_flags;
482 __entry->bli_recur = bip->bli_recur;
483 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
484 __entry->buf_bno = bip->bli_buf->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000485 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000486 __entry->buf_flags = bip->bli_buf->b_flags;
487 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
488 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200489 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000490 __entry->li_desc = bip->bli_item.li_desc;
491 __entry->li_flags = bip->bli_item.li_flags;
492 ),
493 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
494 "lock %d flags %s recur %d refcount %d bliflags %s "
495 "lidesc 0x%p liflags %s",
496 MAJOR(__entry->dev), MINOR(__entry->dev),
497 (unsigned long long)__entry->buf_bno,
498 __entry->buf_len,
499 __entry->buf_hold,
500 __entry->buf_pincount,
501 __entry->buf_lockval,
502 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
503 __entry->bli_recur,
504 __entry->bli_refcount,
505 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
506 __entry->li_desc,
507 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000508)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000509
510#define DEFINE_BUF_ITEM_EVENT(name) \
511DEFINE_EVENT(xfs_buf_item_class, name, \
512 TP_PROTO(struct xfs_buf_log_item *bip), \
513 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000514DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000515DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000516DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
517DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000518DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000519DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000520DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000521DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
522DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
523DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000524DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
525DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
526DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
527DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
528DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
529DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
530DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
531DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
532DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
533DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
534DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
535DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
536DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
537DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
538DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
539DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000540DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000541
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000542DECLARE_EVENT_CLASS(xfs_filestream_class,
543 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
544 TP_ARGS(ip, agno),
545 TP_STRUCT__entry(
546 __field(dev_t, dev)
547 __field(xfs_ino_t, ino)
548 __field(xfs_agnumber_t, agno)
549 __field(int, streams)
550 ),
551 TP_fast_assign(
552 __entry->dev = VFS_I(ip)->i_sb->s_dev;
553 __entry->ino = ip->i_ino;
554 __entry->agno = agno;
555 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
556 ),
557 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
558 MAJOR(__entry->dev), MINOR(__entry->dev),
559 __entry->ino,
560 __entry->agno,
561 __entry->streams)
562)
563#define DEFINE_FILESTREAM_EVENT(name) \
564DEFINE_EVENT(xfs_filestream_class, name, \
565 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
566 TP_ARGS(ip, agno))
567DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
568DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
569DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
570
571TRACE_EVENT(xfs_filestream_pick,
572 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
573 xfs_extlen_t free, int nscan),
574 TP_ARGS(ip, agno, free, nscan),
575 TP_STRUCT__entry(
576 __field(dev_t, dev)
577 __field(xfs_ino_t, ino)
578 __field(xfs_agnumber_t, agno)
579 __field(int, streams)
580 __field(xfs_extlen_t, free)
581 __field(int, nscan)
582 ),
583 TP_fast_assign(
584 __entry->dev = VFS_I(ip)->i_sb->s_dev;
585 __entry->ino = ip->i_ino;
586 __entry->agno = agno;
587 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
588 __entry->free = free;
589 __entry->nscan = nscan;
590 ),
591 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
592 MAJOR(__entry->dev), MINOR(__entry->dev),
593 __entry->ino,
594 __entry->agno,
595 __entry->streams,
596 __entry->free,
597 __entry->nscan)
598);
599
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000600DECLARE_EVENT_CLASS(xfs_lock_class,
601 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
602 unsigned long caller_ip),
603 TP_ARGS(ip, lock_flags, caller_ip),
604 TP_STRUCT__entry(
605 __field(dev_t, dev)
606 __field(xfs_ino_t, ino)
607 __field(int, lock_flags)
608 __field(unsigned long, caller_ip)
609 ),
610 TP_fast_assign(
611 __entry->dev = VFS_I(ip)->i_sb->s_dev;
612 __entry->ino = ip->i_ino;
613 __entry->lock_flags = lock_flags;
614 __entry->caller_ip = caller_ip;
615 ),
Scott Wood65dd2972015-03-25 14:56:21 +1100616 TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000617 MAJOR(__entry->dev), MINOR(__entry->dev),
618 __entry->ino,
619 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
620 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000621)
622
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000623#define DEFINE_LOCK_EVENT(name) \
624DEFINE_EVENT(xfs_lock_class, name, \
625 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
626 unsigned long caller_ip), \
627 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000628DEFINE_LOCK_EVENT(xfs_ilock);
629DEFINE_LOCK_EVENT(xfs_ilock_nowait);
630DEFINE_LOCK_EVENT(xfs_ilock_demote);
631DEFINE_LOCK_EVENT(xfs_iunlock);
632
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000633DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000634 TP_PROTO(struct xfs_inode *ip),
635 TP_ARGS(ip),
636 TP_STRUCT__entry(
637 __field(dev_t, dev)
638 __field(xfs_ino_t, ino)
639 ),
640 TP_fast_assign(
641 __entry->dev = VFS_I(ip)->i_sb->s_dev;
642 __entry->ino = ip->i_ino;
643 ),
644 TP_printk("dev %d:%d ino 0x%llx",
645 MAJOR(__entry->dev), MINOR(__entry->dev),
646 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000647)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000648
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000649#define DEFINE_INODE_EVENT(name) \
650DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000651 TP_PROTO(struct xfs_inode *ip), \
652 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000653DEFINE_INODE_EVENT(xfs_iget_skip);
654DEFINE_INODE_EVENT(xfs_iget_reclaim);
655DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
656DEFINE_INODE_EVENT(xfs_iget_hit);
657DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000658
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000659DEFINE_INODE_EVENT(xfs_getattr);
660DEFINE_INODE_EVENT(xfs_setattr);
661DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500662DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000663DEFINE_INODE_EVENT(xfs_alloc_file_space);
664DEFINE_INODE_EVENT(xfs_free_file_space);
Dave Chinner897b73b2014-04-14 18:15:11 +1000665DEFINE_INODE_EVENT(xfs_zero_file_space);
Namjae Jeone1d8fb82014-02-24 10:58:19 +1100666DEFINE_INODE_EVENT(xfs_collapse_file_space);
Namjae Jeona904b1c2015-03-25 15:08:56 +1100667DEFINE_INODE_EVENT(xfs_insert_file_space);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000668DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000669#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200670DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000671#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000672DEFINE_INODE_EVENT(xfs_vm_bmap);
673DEFINE_INODE_EVENT(xfs_file_ioctl);
674DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
675DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000676DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000677DEFINE_INODE_EVENT(xfs_file_fsync);
678DEFINE_INODE_EVENT(xfs_destroy_inode);
Al Virob57922d2010-06-07 14:34:48 -0400679DEFINE_INODE_EVENT(xfs_evict_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400680DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000681
682DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
683DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
684
Brian Foster27b52862012-11-06 09:50:38 -0500685DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
686DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500687DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Brian Foster27b52862012-11-06 09:50:38 -0500688
Dave Chinnerde0e8c22015-02-23 21:44:19 +1100689DEFINE_INODE_EVENT(xfs_filemap_fault);
Dave Chinner075a9242015-02-23 21:44:54 +1100690DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite);
Dave Chinnerde0e8c22015-02-23 21:44:19 +1100691
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000692DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000693 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
694 TP_ARGS(ip, caller_ip),
695 TP_STRUCT__entry(
696 __field(dev_t, dev)
697 __field(xfs_ino_t, ino)
698 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100699 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000700 __field(unsigned long, caller_ip)
701 ),
702 TP_fast_assign(
703 __entry->dev = VFS_I(ip)->i_sb->s_dev;
704 __entry->ino = ip->i_ino;
705 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100706 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000707 __entry->caller_ip = caller_ip;
708 ),
Scott Wood65dd2972015-03-25 14:56:21 +1100709 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000710 MAJOR(__entry->dev), MINOR(__entry->dev),
711 __entry->ino,
712 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100713 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000714 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000715)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000716
Brian Foster19cb7e32013-03-18 10:51:48 -0400717TRACE_EVENT(xfs_iomap_prealloc_size,
718 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
719 unsigned int writeio_blocks),
720 TP_ARGS(ip, blocks, shift, writeio_blocks),
721 TP_STRUCT__entry(
722 __field(dev_t, dev)
723 __field(xfs_ino_t, ino)
724 __field(xfs_fsblock_t, blocks)
725 __field(int, shift)
726 __field(unsigned int, writeio_blocks)
727 ),
728 TP_fast_assign(
729 __entry->dev = VFS_I(ip)->i_sb->s_dev;
730 __entry->ino = ip->i_ino;
731 __entry->blocks = blocks;
732 __entry->shift = shift;
733 __entry->writeio_blocks = writeio_blocks;
734 ),
735 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
736 "m_writeio_blocks %u",
737 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
738 __entry->blocks, __entry->shift, __entry->writeio_blocks)
739)
740
Brian Foster56d11152015-05-29 09:18:32 +1000741TRACE_EVENT(xfs_irec_merge_pre,
742 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
743 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
744 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
745 TP_STRUCT__entry(
746 __field(dev_t, dev)
747 __field(xfs_agnumber_t, agno)
748 __field(xfs_agino_t, agino)
749 __field(uint16_t, holemask)
750 __field(xfs_agino_t, nagino)
751 __field(uint16_t, nholemask)
752 ),
753 TP_fast_assign(
754 __entry->dev = mp->m_super->s_dev;
755 __entry->agno = agno;
756 __entry->agino = agino;
757 __entry->holemask = holemask;
758 __entry->nagino = nagino;
759 __entry->nholemask = holemask;
760 ),
761 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
762 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
763 __entry->agino, __entry->holemask, __entry->nagino,
764 __entry->nholemask)
765)
766
767TRACE_EVENT(xfs_irec_merge_post,
768 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
769 uint16_t holemask),
770 TP_ARGS(mp, agno, agino, holemask),
771 TP_STRUCT__entry(
772 __field(dev_t, dev)
773 __field(xfs_agnumber_t, agno)
774 __field(xfs_agino_t, agino)
775 __field(uint16_t, holemask)
776 ),
777 TP_fast_assign(
778 __entry->dev = mp->m_super->s_dev;
779 __entry->agno = agno;
780 __entry->agino = agino;
781 __entry->holemask = holemask;
782 ),
783 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
784 MINOR(__entry->dev), __entry->agno, __entry->agino,
785 __entry->holemask)
786)
787
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000788#define DEFINE_IREF_EVENT(name) \
789DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000790 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
791 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000792DEFINE_IREF_EVENT(xfs_ihold);
793DEFINE_IREF_EVENT(xfs_irele);
794DEFINE_IREF_EVENT(xfs_inode_pin);
795DEFINE_IREF_EVENT(xfs_inode_unpin);
796DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100797
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000798DECLARE_EVENT_CLASS(xfs_namespace_class,
799 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
800 TP_ARGS(dp, name),
801 TP_STRUCT__entry(
802 __field(dev_t, dev)
803 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000804 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000805 __dynamic_array(char, name, name->len)
806 ),
807 TP_fast_assign(
808 __entry->dev = VFS_I(dp)->i_sb->s_dev;
809 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000810 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000811 memcpy(__get_str(name), name->name, name->len);
812 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000813 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000814 MAJOR(__entry->dev), MINOR(__entry->dev),
815 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000816 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000817 __get_str(name))
818)
819
820#define DEFINE_NAMESPACE_EVENT(name) \
821DEFINE_EVENT(xfs_namespace_class, name, \
822 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
823 TP_ARGS(dp, name))
824DEFINE_NAMESPACE_EVENT(xfs_remove);
825DEFINE_NAMESPACE_EVENT(xfs_link);
826DEFINE_NAMESPACE_EVENT(xfs_lookup);
827DEFINE_NAMESPACE_EVENT(xfs_create);
828DEFINE_NAMESPACE_EVENT(xfs_symlink);
829
830TRACE_EVENT(xfs_rename,
831 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
832 struct xfs_name *src_name, struct xfs_name *target_name),
833 TP_ARGS(src_dp, target_dp, src_name, target_name),
834 TP_STRUCT__entry(
835 __field(dev_t, dev)
836 __field(xfs_ino_t, src_dp_ino)
837 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000838 __field(int, src_namelen)
839 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000840 __dynamic_array(char, src_name, src_name->len)
841 __dynamic_array(char, target_name, target_name->len)
842 ),
843 TP_fast_assign(
844 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
845 __entry->src_dp_ino = src_dp->i_ino;
846 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000847 __entry->src_namelen = src_name->len;
848 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000849 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000850 memcpy(__get_str(target_name), target_name->name,
851 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000852 ),
853 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000854 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000855 MAJOR(__entry->dev), MINOR(__entry->dev),
856 __entry->src_dp_ino,
857 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000858 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000859 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000860 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000861 __get_str(target_name))
862)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000863
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000864DECLARE_EVENT_CLASS(xfs_dquot_class,
865 TP_PROTO(struct xfs_dquot *dqp),
866 TP_ARGS(dqp),
867 TP_STRUCT__entry(
868 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000869 __field(u32, id)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000870 __field(unsigned, flags)
871 __field(unsigned, nrefs)
872 __field(unsigned long long, res_bcount)
873 __field(unsigned long long, bcount)
874 __field(unsigned long long, icount)
875 __field(unsigned long long, blk_hardlimit)
876 __field(unsigned long long, blk_softlimit)
877 __field(unsigned long long, ino_hardlimit)
878 __field(unsigned long long, ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000879 ), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000880 TP_fast_assign(
881 __entry->dev = dqp->q_mount->m_super->s_dev;
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000882 __entry->id = be32_to_cpu(dqp->q_core.d_id);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000883 __entry->flags = dqp->dq_flags;
884 __entry->nrefs = dqp->q_nrefs;
885 __entry->res_bcount = dqp->q_res_bcount;
886 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
887 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
888 __entry->blk_hardlimit =
889 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
890 __entry->blk_softlimit =
891 be64_to_cpu(dqp->q_core.d_blk_softlimit);
892 __entry->ino_hardlimit =
893 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
894 __entry->ino_softlimit =
895 be64_to_cpu(dqp->q_core.d_ino_softlimit);
896 ),
897 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000898 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
899 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000900 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000901 __entry->id,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000902 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
903 __entry->nrefs,
904 __entry->res_bcount,
905 __entry->bcount,
906 __entry->blk_hardlimit,
907 __entry->blk_softlimit,
908 __entry->icount,
909 __entry->ino_hardlimit,
910 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000911)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000912
913#define DEFINE_DQUOT_EVENT(name) \
914DEFINE_EVENT(xfs_dquot_class, name, \
915 TP_PROTO(struct xfs_dquot *dqp), \
916 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000917DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000918DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
919DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b2012-02-01 13:57:20 +0000920DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
921DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000922DEFINE_DQUOT_EVENT(xfs_dqattach_found);
923DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000924DEFINE_DQUOT_EVENT(xfs_dqalloc);
925DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
926DEFINE_DQUOT_EVENT(xfs_dqread);
927DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000928DEFINE_DQUOT_EVENT(xfs_dqget_hit);
929DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000930DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
931DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000932DEFINE_DQUOT_EVENT(xfs_dqput);
933DEFINE_DQUOT_EVENT(xfs_dqput_wait);
934DEFINE_DQUOT_EVENT(xfs_dqput_free);
935DEFINE_DQUOT_EVENT(xfs_dqrele);
936DEFINE_DQUOT_EVENT(xfs_dqflush);
937DEFINE_DQUOT_EVENT(xfs_dqflush_force);
938DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000939
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000940DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -0500941 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000942 TP_ARGS(log, tic),
943 TP_STRUCT__entry(
944 __field(dev_t, dev)
945 __field(unsigned, trans_type)
946 __field(char, ocnt)
947 __field(char, cnt)
948 __field(int, curr_res)
949 __field(int, unit_res)
950 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +1100951 __field(int, reserveq)
952 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000953 __field(int, grant_reserve_cycle)
954 __field(int, grant_reserve_bytes)
955 __field(int, grant_write_cycle)
956 __field(int, grant_write_bytes)
957 __field(int, curr_cycle)
958 __field(int, curr_block)
959 __field(xfs_lsn_t, tail_lsn)
960 ),
961 TP_fast_assign(
962 __entry->dev = log->l_mp->m_super->s_dev;
963 __entry->trans_type = tic->t_trans_type;
964 __entry->ocnt = tic->t_ocnt;
965 __entry->cnt = tic->t_cnt;
966 __entry->curr_res = tic->t_curr_res;
967 __entry->unit_res = tic->t_unit_res;
968 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +0000969 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
970 __entry->writeq = list_empty(&log->l_write_head.waiters);
971 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100972 &__entry->grant_reserve_cycle,
973 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +0000974 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100975 &__entry->grant_write_cycle,
976 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000977 __entry->curr_cycle = log->l_curr_cycle;
978 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +1100979 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000980 ),
981 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +1100982 "t_unit_res %u t_flags %s reserveq %s "
983 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000984 "grant_reserve_bytes %d grant_write_cycle %d "
985 "grant_write_bytes %d curr_cycle %d curr_block %d "
986 "tail_cycle %d tail_block %d",
987 MAJOR(__entry->dev), MINOR(__entry->dev),
988 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
989 __entry->ocnt,
990 __entry->cnt,
991 __entry->curr_res,
992 __entry->unit_res,
993 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +1100994 __entry->reserveq ? "empty" : "active",
995 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000996 __entry->grant_reserve_cycle,
997 __entry->grant_reserve_bytes,
998 __entry->grant_write_cycle,
999 __entry->grant_write_bytes,
1000 __entry->curr_cycle,
1001 __entry->curr_block,
1002 CYCLE_LSN(__entry->tail_lsn),
1003 BLOCK_LSN(__entry->tail_lsn)
1004 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001005)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001006
1007#define DEFINE_LOGGRANT_EVENT(name) \
1008DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001009 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001010 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001011DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
1012DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001013DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +00001014DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1015DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +11001016DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +00001017DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1018DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1019DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1020DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001021DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1022DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1023DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1024DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1025DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1026DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1027
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001028DECLARE_EVENT_CLASS(xfs_log_item_class,
1029 TP_PROTO(struct xfs_log_item *lip),
1030 TP_ARGS(lip),
1031 TP_STRUCT__entry(
1032 __field(dev_t, dev)
1033 __field(void *, lip)
1034 __field(uint, type)
1035 __field(uint, flags)
1036 __field(xfs_lsn_t, lsn)
1037 ),
1038 TP_fast_assign(
1039 __entry->dev = lip->li_mountp->m_super->s_dev;
1040 __entry->lip = lip;
1041 __entry->type = lip->li_type;
1042 __entry->flags = lip->li_flags;
1043 __entry->lsn = lip->li_lsn;
1044 ),
1045 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
1046 MAJOR(__entry->dev), MINOR(__entry->dev),
1047 __entry->lip,
1048 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1049 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1050 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1051)
1052
Dave Chinner14c26c62012-04-24 16:33:31 +10001053TRACE_EVENT(xfs_log_force,
1054 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn),
1055 TP_ARGS(mp, lsn),
1056 TP_STRUCT__entry(
1057 __field(dev_t, dev)
1058 __field(xfs_lsn_t, lsn)
1059 ),
1060 TP_fast_assign(
1061 __entry->dev = mp->m_super->s_dev;
1062 __entry->lsn = lsn;
1063 ),
1064 TP_printk("dev %d:%d lsn 0x%llx",
1065 MAJOR(__entry->dev), MINOR(__entry->dev),
1066 __entry->lsn)
1067)
1068
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001069#define DEFINE_LOG_ITEM_EVENT(name) \
1070DEFINE_EVENT(xfs_log_item_class, name, \
1071 TP_PROTO(struct xfs_log_item *lip), \
1072 TP_ARGS(lip))
1073DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001074DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1075DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +10001076DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001077
Dave Chinner750b9c92013-11-01 15:27:18 +11001078DECLARE_EVENT_CLASS(xfs_ail_class,
1079 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1080 TP_ARGS(lip, old_lsn, new_lsn),
1081 TP_STRUCT__entry(
1082 __field(dev_t, dev)
1083 __field(void *, lip)
1084 __field(uint, type)
1085 __field(uint, flags)
1086 __field(xfs_lsn_t, old_lsn)
1087 __field(xfs_lsn_t, new_lsn)
1088 ),
1089 TP_fast_assign(
1090 __entry->dev = lip->li_mountp->m_super->s_dev;
1091 __entry->lip = lip;
1092 __entry->type = lip->li_type;
1093 __entry->flags = lip->li_flags;
1094 __entry->old_lsn = old_lsn;
1095 __entry->new_lsn = new_lsn;
1096 ),
1097 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
1098 MAJOR(__entry->dev), MINOR(__entry->dev),
1099 __entry->lip,
1100 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1101 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1102 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1103 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1104)
1105
1106#define DEFINE_AIL_EVENT(name) \
1107DEFINE_EVENT(xfs_ail_class, name, \
1108 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1109 TP_ARGS(lip, old_lsn, new_lsn))
1110DEFINE_AIL_EVENT(xfs_ail_insert);
1111DEFINE_AIL_EVENT(xfs_ail_move);
1112DEFINE_AIL_EVENT(xfs_ail_delete);
1113
1114TRACE_EVENT(xfs_log_assign_tail_lsn,
1115 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1116 TP_ARGS(log, new_lsn),
1117 TP_STRUCT__entry(
1118 __field(dev_t, dev)
1119 __field(xfs_lsn_t, new_lsn)
1120 __field(xfs_lsn_t, old_lsn)
1121 __field(xfs_lsn_t, last_sync_lsn)
1122 ),
1123 TP_fast_assign(
1124 __entry->dev = log->l_mp->m_super->s_dev;
1125 __entry->new_lsn = new_lsn;
1126 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1127 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1128 ),
1129 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1130 MAJOR(__entry->dev), MINOR(__entry->dev),
1131 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1132 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1133 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1134)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001135
Li Zefanf8adb4d2010-05-24 08:25:57 +00001136DECLARE_EVENT_CLASS(xfs_file_class,
1137 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags),
1138 TP_ARGS(ip, count, offset, flags),
1139 TP_STRUCT__entry(
1140 __field(dev_t, dev)
1141 __field(xfs_ino_t, ino)
1142 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001143 __field(loff_t, offset)
1144 __field(size_t, count)
1145 __field(int, flags)
1146 ),
1147 TP_fast_assign(
1148 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1149 __entry->ino = ip->i_ino;
1150 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001151 __entry->offset = offset;
1152 __entry->count = count;
1153 __entry->flags = flags;
1154 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001155 TP_printk("dev %d:%d ino 0x%llx size 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001156 "offset 0x%llx count 0x%zx ioflags %s",
1157 MAJOR(__entry->dev), MINOR(__entry->dev),
1158 __entry->ino,
1159 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001160 __entry->offset,
1161 __entry->count,
1162 __print_flags(__entry->flags, "|", XFS_IO_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001163)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001164
1165#define DEFINE_RW_EVENT(name) \
1166DEFINE_EVENT(xfs_file_class, name, \
1167 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
1168 TP_ARGS(ip, count, offset, flags))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001169DEFINE_RW_EVENT(xfs_file_read);
1170DEFINE_RW_EVENT(xfs_file_buffered_write);
1171DEFINE_RW_EVENT(xfs_file_direct_write);
1172DEFINE_RW_EVENT(xfs_file_splice_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001173
Li Zefanf8adb4d2010-05-24 08:25:57 +00001174DECLARE_EVENT_CLASS(xfs_page_class,
Lukas Czerner34097df2013-05-21 23:58:01 -04001175 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1176 unsigned int len),
1177 TP_ARGS(inode, page, off, len),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001178 TP_STRUCT__entry(
1179 __field(dev_t, dev)
1180 __field(xfs_ino_t, ino)
1181 __field(pgoff_t, pgoff)
1182 __field(loff_t, size)
1183 __field(unsigned long, offset)
Lukas Czerner34097df2013-05-21 23:58:01 -04001184 __field(unsigned int, length)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001185 __field(int, delalloc)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001186 __field(int, unwritten)
1187 ),
1188 TP_fast_assign(
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001189 int delalloc = -1, unwritten = -1;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001190
Li Zefanf8adb4d2010-05-24 08:25:57 +00001191 if (page_has_buffers(page))
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001192 xfs_count_page_state(page, &delalloc, &unwritten);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001193 __entry->dev = inode->i_sb->s_dev;
1194 __entry->ino = XFS_I(inode)->i_ino;
1195 __entry->pgoff = page_offset(page);
1196 __entry->size = i_size_read(inode);
1197 __entry->offset = off;
Lukas Czerner34097df2013-05-21 23:58:01 -04001198 __entry->length = len;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001199 __entry->delalloc = delalloc;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001200 __entry->unwritten = unwritten;
1201 ),
1202 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
Lukas Czerner34097df2013-05-21 23:58:01 -04001203 "length %x delalloc %d unwritten %d",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001204 MAJOR(__entry->dev), MINOR(__entry->dev),
1205 __entry->ino,
1206 __entry->pgoff,
1207 __entry->size,
1208 __entry->offset,
Lukas Czerner34097df2013-05-21 23:58:01 -04001209 __entry->length,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001210 __entry->delalloc,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001211 __entry->unwritten)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001212)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001213
1214#define DEFINE_PAGE_EVENT(name) \
1215DEFINE_EVENT(xfs_page_class, name, \
Lukas Czerner34097df2013-05-21 23:58:01 -04001216 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1217 unsigned int len), \
1218 TP_ARGS(inode, page, off, len))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001219DEFINE_PAGE_EVENT(xfs_writepage);
1220DEFINE_PAGE_EVENT(xfs_releasepage);
1221DEFINE_PAGE_EVENT(xfs_invalidatepage);
1222
Christoph Hellwiga206c812010-12-10 08:42:20 +00001223DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001224 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001225 int type, struct xfs_bmbt_irec *irec),
1226 TP_ARGS(ip, offset, count, type, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001227 TP_STRUCT__entry(
1228 __field(dev_t, dev)
1229 __field(xfs_ino_t, ino)
1230 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001231 __field(loff_t, offset)
1232 __field(size_t, count)
Christoph Hellwiga206c812010-12-10 08:42:20 +00001233 __field(int, type)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001234 __field(xfs_fileoff_t, startoff)
1235 __field(xfs_fsblock_t, startblock)
1236 __field(xfs_filblks_t, blockcount)
1237 ),
1238 TP_fast_assign(
1239 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1240 __entry->ino = ip->i_ino;
1241 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001242 __entry->offset = offset;
1243 __entry->count = count;
Christoph Hellwiga206c812010-12-10 08:42:20 +00001244 __entry->type = type;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001245 __entry->startoff = irec ? irec->br_startoff : 0;
1246 __entry->startblock = irec ? irec->br_startblock : 0;
1247 __entry->blockcount = irec ? irec->br_blockcount : 0;
1248 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001249 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1250 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001251 MAJOR(__entry->dev), MINOR(__entry->dev),
1252 __entry->ino,
1253 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001254 __entry->offset,
1255 __entry->count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001256 __print_symbolic(__entry->type, XFS_IO_TYPES),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001257 __entry->startoff,
1258 (__int64_t)__entry->startblock,
1259 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001260)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001261
1262#define DEFINE_IOMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001263DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001264 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001265 int type, struct xfs_bmbt_irec *irec), \
1266 TP_ARGS(ip, offset, count, type, irec))
1267DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1268DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1269DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1270DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
Dave Chinnerd5cc2e32015-04-16 21:59:07 +10001271DEFINE_IOMAP_EVENT(xfs_gbmap_direct);
1272DEFINE_IOMAP_EVENT(xfs_gbmap_direct_new);
1273DEFINE_IOMAP_EVENT(xfs_gbmap_direct_update);
Dave Chinnera06c2772015-04-16 22:00:00 +10001274DEFINE_IOMAP_EVENT(xfs_gbmap_direct_none);
Dave Chinner6dfa1b62015-04-16 21:59:34 +10001275DEFINE_IOMAP_EVENT(xfs_gbmap_direct_endio);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001276
Li Zefanf8adb4d2010-05-24 08:25:57 +00001277DECLARE_EVENT_CLASS(xfs_simple_io_class,
1278 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1279 TP_ARGS(ip, offset, count),
1280 TP_STRUCT__entry(
1281 __field(dev_t, dev)
1282 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001283 __field(loff_t, isize)
1284 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001285 __field(loff_t, offset)
1286 __field(size_t, count)
1287 ),
1288 TP_fast_assign(
1289 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1290 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001291 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001292 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001293 __entry->offset = offset;
1294 __entry->count = count;
1295 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001296 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001297 "offset 0x%llx count %zd",
1298 MAJOR(__entry->dev), MINOR(__entry->dev),
1299 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001300 __entry->isize,
1301 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001302 __entry->offset,
1303 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001304);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001305
1306#define DEFINE_SIMPLE_IO_EVENT(name) \
1307DEFINE_EVENT(xfs_simple_io_class, name, \
1308 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1309 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001310DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1311DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Christoph Hellwiga206c812010-12-10 08:42:20 +00001312DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001313DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001314
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001315DECLARE_EVENT_CLASS(xfs_itrunc_class,
1316 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1317 TP_ARGS(ip, new_size),
1318 TP_STRUCT__entry(
1319 __field(dev_t, dev)
1320 __field(xfs_ino_t, ino)
1321 __field(xfs_fsize_t, size)
1322 __field(xfs_fsize_t, new_size)
1323 ),
1324 TP_fast_assign(
1325 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1326 __entry->ino = ip->i_ino;
1327 __entry->size = ip->i_d.di_size;
1328 __entry->new_size = new_size;
1329 ),
1330 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1331 MAJOR(__entry->dev), MINOR(__entry->dev),
1332 __entry->ino,
1333 __entry->size,
1334 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001335)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001336
1337#define DEFINE_ITRUNC_EVENT(name) \
1338DEFINE_EVENT(xfs_itrunc_class, name, \
1339 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1340 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001341DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1342DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001343
1344TRACE_EVENT(xfs_pagecache_inval,
1345 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1346 TP_ARGS(ip, start, finish),
1347 TP_STRUCT__entry(
1348 __field(dev_t, dev)
1349 __field(xfs_ino_t, ino)
1350 __field(xfs_fsize_t, size)
1351 __field(xfs_off_t, start)
1352 __field(xfs_off_t, finish)
1353 ),
1354 TP_fast_assign(
1355 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1356 __entry->ino = ip->i_ino;
1357 __entry->size = ip->i_d.di_size;
1358 __entry->start = start;
1359 __entry->finish = finish;
1360 ),
1361 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1362 MAJOR(__entry->dev), MINOR(__entry->dev),
1363 __entry->ino,
1364 __entry->size,
1365 __entry->start,
1366 __entry->finish)
1367);
1368
1369TRACE_EVENT(xfs_bunmap,
1370 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1371 int flags, unsigned long caller_ip),
1372 TP_ARGS(ip, bno, len, flags, caller_ip),
1373 TP_STRUCT__entry(
1374 __field(dev_t, dev)
1375 __field(xfs_ino_t, ino)
1376 __field(xfs_fsize_t, size)
1377 __field(xfs_fileoff_t, bno)
1378 __field(xfs_filblks_t, len)
1379 __field(unsigned long, caller_ip)
1380 __field(int, flags)
1381 ),
1382 TP_fast_assign(
1383 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1384 __entry->ino = ip->i_ino;
1385 __entry->size = ip->i_d.di_size;
1386 __entry->bno = bno;
1387 __entry->len = len;
1388 __entry->caller_ip = caller_ip;
1389 __entry->flags = flags;
1390 ),
1391 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
Scott Wood65dd2972015-03-25 14:56:21 +11001392 "flags %s caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001393 MAJOR(__entry->dev), MINOR(__entry->dev),
1394 __entry->ino,
1395 __entry->size,
1396 __entry->bno,
1397 __entry->len,
1398 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1399 (void *)__entry->caller_ip)
1400
1401);
1402
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001403DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001404 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1405 xfs_agblock_t agbno, xfs_extlen_t len),
1406 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001407 TP_STRUCT__entry(
1408 __field(dev_t, dev)
1409 __field(xfs_agnumber_t, agno)
1410 __field(xfs_agblock_t, agbno)
1411 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001412 ),
1413 TP_fast_assign(
1414 __entry->dev = mp->m_super->s_dev;
1415 __entry->agno = agno;
1416 __entry->agbno = agbno;
1417 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001418 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001419 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001420 MAJOR(__entry->dev), MINOR(__entry->dev),
1421 __entry->agno,
1422 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001423 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001424);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001425#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001426DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001427 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1428 xfs_agblock_t agbno, xfs_extlen_t len), \
1429 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001430DEFINE_BUSY_EVENT(xfs_extent_busy);
1431DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1432DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1433DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1434DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001435
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001436TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001437 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1438 xfs_agblock_t agbno, xfs_extlen_t len,
1439 xfs_agblock_t tbno, xfs_extlen_t tlen),
1440 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1441 TP_STRUCT__entry(
1442 __field(dev_t, dev)
1443 __field(xfs_agnumber_t, agno)
1444 __field(xfs_agblock_t, agbno)
1445 __field(xfs_extlen_t, len)
1446 __field(xfs_agblock_t, tbno)
1447 __field(xfs_extlen_t, tlen)
1448 ),
1449 TP_fast_assign(
1450 __entry->dev = mp->m_super->s_dev;
1451 __entry->agno = agno;
1452 __entry->agbno = agbno;
1453 __entry->len = len;
1454 __entry->tbno = tbno;
1455 __entry->tlen = tlen;
1456 ),
1457 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1458 MAJOR(__entry->dev), MINOR(__entry->dev),
1459 __entry->agno,
1460 __entry->agbno,
1461 __entry->len,
1462 __entry->tbno,
1463 __entry->tlen)
1464);
1465
Dave Chinnered3b4d62010-05-21 12:07:08 +10001466TRACE_EVENT(xfs_trans_commit_lsn,
1467 TP_PROTO(struct xfs_trans *trans),
1468 TP_ARGS(trans),
1469 TP_STRUCT__entry(
1470 __field(dev_t, dev)
1471 __field(struct xfs_trans *, tp)
1472 __field(xfs_lsn_t, lsn)
1473 ),
1474 TP_fast_assign(
1475 __entry->dev = trans->t_mountp->m_super->s_dev;
1476 __entry->tp = trans;
1477 __entry->lsn = trans->t_commit_lsn;
1478 ),
1479 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1480 MAJOR(__entry->dev), MINOR(__entry->dev),
1481 __entry->tp,
Dave Chinnerfd45e4782010-01-02 02:38:56 +00001482 __entry->lsn)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001483);
1484
1485TRACE_EVENT(xfs_agf,
1486 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1487 unsigned long caller_ip),
1488 TP_ARGS(mp, agf, flags, caller_ip),
1489 TP_STRUCT__entry(
1490 __field(dev_t, dev)
1491 __field(xfs_agnumber_t, agno)
1492 __field(int, flags)
1493 __field(__u32, length)
1494 __field(__u32, bno_root)
1495 __field(__u32, cnt_root)
1496 __field(__u32, bno_level)
1497 __field(__u32, cnt_level)
1498 __field(__u32, flfirst)
1499 __field(__u32, fllast)
1500 __field(__u32, flcount)
1501 __field(__u32, freeblks)
1502 __field(__u32, longest)
1503 __field(unsigned long, caller_ip)
1504 ),
1505 TP_fast_assign(
1506 __entry->dev = mp->m_super->s_dev;
1507 __entry->agno = be32_to_cpu(agf->agf_seqno),
1508 __entry->flags = flags;
1509 __entry->length = be32_to_cpu(agf->agf_length),
1510 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1511 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1512 __entry->bno_level =
1513 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1514 __entry->cnt_level =
1515 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1516 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1517 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1518 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1519 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1520 __entry->longest = be32_to_cpu(agf->agf_longest);
1521 __entry->caller_ip = caller_ip;
1522 ),
1523 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1524 "levels b %u c %u flfirst %u fllast %u flcount %u "
Scott Wood65dd2972015-03-25 14:56:21 +11001525 "freeblks %u longest %u caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001526 MAJOR(__entry->dev), MINOR(__entry->dev),
1527 __entry->agno,
1528 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1529 __entry->length,
1530 __entry->bno_root,
1531 __entry->cnt_root,
1532 __entry->bno_level,
1533 __entry->cnt_level,
1534 __entry->flfirst,
1535 __entry->fllast,
1536 __entry->flcount,
1537 __entry->freeblks,
1538 __entry->longest,
1539 (void *)__entry->caller_ip)
1540);
1541
1542TRACE_EVENT(xfs_free_extent,
1543 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1544 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1545 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1546 TP_STRUCT__entry(
1547 __field(dev_t, dev)
1548 __field(xfs_agnumber_t, agno)
1549 __field(xfs_agblock_t, agbno)
1550 __field(xfs_extlen_t, len)
1551 __field(int, isfl)
1552 __field(int, haveleft)
1553 __field(int, haveright)
1554 ),
1555 TP_fast_assign(
1556 __entry->dev = mp->m_super->s_dev;
1557 __entry->agno = agno;
1558 __entry->agbno = agbno;
1559 __entry->len = len;
1560 __entry->isfl = isfl;
1561 __entry->haveleft = haveleft;
1562 __entry->haveright = haveright;
1563 ),
1564 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1565 MAJOR(__entry->dev), MINOR(__entry->dev),
1566 __entry->agno,
1567 __entry->agbno,
1568 __entry->len,
1569 __entry->isfl,
1570 __entry->haveleft ?
1571 (__entry->haveright ? "both" : "left") :
1572 (__entry->haveright ? "right" : "none"))
1573
1574);
1575
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001576DECLARE_EVENT_CLASS(xfs_alloc_class,
1577 TP_PROTO(struct xfs_alloc_arg *args),
1578 TP_ARGS(args),
1579 TP_STRUCT__entry(
1580 __field(dev_t, dev)
1581 __field(xfs_agnumber_t, agno)
1582 __field(xfs_agblock_t, agbno)
1583 __field(xfs_extlen_t, minlen)
1584 __field(xfs_extlen_t, maxlen)
1585 __field(xfs_extlen_t, mod)
1586 __field(xfs_extlen_t, prod)
1587 __field(xfs_extlen_t, minleft)
1588 __field(xfs_extlen_t, total)
1589 __field(xfs_extlen_t, alignment)
1590 __field(xfs_extlen_t, minalignslop)
1591 __field(xfs_extlen_t, len)
1592 __field(short, type)
1593 __field(short, otype)
1594 __field(char, wasdel)
1595 __field(char, wasfromfl)
1596 __field(char, isfl)
1597 __field(char, userdata)
1598 __field(xfs_fsblock_t, firstblock)
1599 ),
1600 TP_fast_assign(
1601 __entry->dev = args->mp->m_super->s_dev;
1602 __entry->agno = args->agno;
1603 __entry->agbno = args->agbno;
1604 __entry->minlen = args->minlen;
1605 __entry->maxlen = args->maxlen;
1606 __entry->mod = args->mod;
1607 __entry->prod = args->prod;
1608 __entry->minleft = args->minleft;
1609 __entry->total = args->total;
1610 __entry->alignment = args->alignment;
1611 __entry->minalignslop = args->minalignslop;
1612 __entry->len = args->len;
1613 __entry->type = args->type;
1614 __entry->otype = args->otype;
1615 __entry->wasdel = args->wasdel;
1616 __entry->wasfromfl = args->wasfromfl;
1617 __entry->isfl = args->isfl;
1618 __entry->userdata = args->userdata;
1619 __entry->firstblock = args->firstblock;
1620 ),
1621 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1622 "prod %u minleft %u total %u alignment %u minalignslop %u "
1623 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1624 "userdata %d firstblock 0x%llx",
1625 MAJOR(__entry->dev), MINOR(__entry->dev),
1626 __entry->agno,
1627 __entry->agbno,
1628 __entry->minlen,
1629 __entry->maxlen,
1630 __entry->mod,
1631 __entry->prod,
1632 __entry->minleft,
1633 __entry->total,
1634 __entry->alignment,
1635 __entry->minalignslop,
1636 __entry->len,
1637 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1638 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1639 __entry->wasdel,
1640 __entry->wasfromfl,
1641 __entry->isfl,
1642 __entry->userdata,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001643 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001644)
1645
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001646#define DEFINE_ALLOC_EVENT(name) \
1647DEFINE_EVENT(xfs_alloc_class, name, \
1648 TP_PROTO(struct xfs_alloc_arg *args), \
1649 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001650DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001651DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001652DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1653DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1654DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1655DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1656DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1657DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001658DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1659DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001660DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1661DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1662DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1663DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1664DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001665DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001666DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1667DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1668DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1669DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1670DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1671DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1672DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1673DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1674DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1675
Dave Chinner5a5881c2012-03-22 05:15:13 +00001676DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001677 TP_PROTO(struct xfs_da_args *args),
1678 TP_ARGS(args),
1679 TP_STRUCT__entry(
1680 __field(dev_t, dev)
1681 __field(xfs_ino_t, ino)
1682 __dynamic_array(char, name, args->namelen)
1683 __field(int, namelen)
1684 __field(xfs_dahash_t, hashval)
1685 __field(xfs_ino_t, inumber)
1686 __field(int, op_flags)
1687 ),
1688 TP_fast_assign(
1689 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1690 __entry->ino = args->dp->i_ino;
1691 if (args->namelen)
1692 memcpy(__get_str(name), args->name, args->namelen);
1693 __entry->namelen = args->namelen;
1694 __entry->hashval = args->hashval;
1695 __entry->inumber = args->inumber;
1696 __entry->op_flags = args->op_flags;
1697 ),
1698 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1699 "inumber 0x%llx op_flags %s",
1700 MAJOR(__entry->dev), MINOR(__entry->dev),
1701 __entry->ino,
1702 __entry->namelen,
1703 __entry->namelen ? __get_str(name) : NULL,
1704 __entry->namelen,
1705 __entry->hashval,
1706 __entry->inumber,
1707 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001708)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001709
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001710#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001711DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001712 TP_PROTO(struct xfs_da_args *args), \
1713 TP_ARGS(args))
1714DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1715DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1716DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1717DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1718DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1719DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1720DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1721DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1722DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1723DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1724DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1725DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1726DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1727DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1728DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1729DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1730DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1731DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1732DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1733DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1734DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1735DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1736DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1737DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1738DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1739
Dave Chinneree732592012-11-12 22:53:53 +11001740DECLARE_EVENT_CLASS(xfs_attr_class,
1741 TP_PROTO(struct xfs_da_args *args),
1742 TP_ARGS(args),
1743 TP_STRUCT__entry(
1744 __field(dev_t, dev)
1745 __field(xfs_ino_t, ino)
1746 __dynamic_array(char, name, args->namelen)
1747 __field(int, namelen)
1748 __field(int, valuelen)
1749 __field(xfs_dahash_t, hashval)
1750 __field(int, op_flags)
1751 ),
1752 TP_fast_assign(
1753 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1754 __entry->ino = args->dp->i_ino;
1755 if (args->namelen)
1756 memcpy(__get_str(name), args->name, args->namelen);
1757 __entry->namelen = args->namelen;
1758 __entry->valuelen = args->valuelen;
1759 __entry->hashval = args->hashval;
1760 __entry->op_flags = args->op_flags;
1761 ),
1762 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1763 "hashval 0x%x op_flags %s",
1764 MAJOR(__entry->dev), MINOR(__entry->dev),
1765 __entry->ino,
1766 __entry->namelen,
1767 __entry->namelen ? __get_str(name) : NULL,
1768 __entry->namelen,
1769 __entry->valuelen,
1770 __entry->hashval,
1771 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1772)
1773
Dave Chinner5a5881c2012-03-22 05:15:13 +00001774#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11001775DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001776 TP_PROTO(struct xfs_da_args *args), \
1777 TP_ARGS(args))
1778DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1779DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1780DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1781DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1782DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1783DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
1784DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1785
1786DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1787DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1788DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11001789DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001790DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1791DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11001792DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1793DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001794DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1795DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11001796DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001797DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1798DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1799DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1800DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1801DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1802DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1803DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1804DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1805DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1806DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1807DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001808DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001809
1810DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11001811DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001812DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
1813DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1814DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1815
Dave Chinneree732592012-11-12 22:53:53 +11001816DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1817DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1818
1819DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1820DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1821DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1822
Dave Chinner5a5881c2012-03-22 05:15:13 +00001823#define DEFINE_DA_EVENT(name) \
1824DEFINE_EVENT(xfs_da_class, name, \
1825 TP_PROTO(struct xfs_da_args *args), \
1826 TP_ARGS(args))
1827DEFINE_DA_EVENT(xfs_da_split);
1828DEFINE_DA_EVENT(xfs_da_join);
1829DEFINE_DA_EVENT(xfs_da_link_before);
1830DEFINE_DA_EVENT(xfs_da_link_after);
1831DEFINE_DA_EVENT(xfs_da_unlink_back);
1832DEFINE_DA_EVENT(xfs_da_unlink_forward);
1833DEFINE_DA_EVENT(xfs_da_root_split);
1834DEFINE_DA_EVENT(xfs_da_root_join);
1835DEFINE_DA_EVENT(xfs_da_node_add);
1836DEFINE_DA_EVENT(xfs_da_node_create);
1837DEFINE_DA_EVENT(xfs_da_node_split);
1838DEFINE_DA_EVENT(xfs_da_node_remove);
1839DEFINE_DA_EVENT(xfs_da_node_rebalance);
1840DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001841DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001842DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1843DEFINE_DA_EVENT(xfs_da_grow_inode);
1844DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11001845DEFINE_DA_EVENT(xfs_da_fixhashpath);
1846DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001847
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001848DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1849 TP_PROTO(struct xfs_da_args *args, int idx),
1850 TP_ARGS(args, idx),
1851 TP_STRUCT__entry(
1852 __field(dev_t, dev)
1853 __field(xfs_ino_t, ino)
1854 __field(int, op_flags)
1855 __field(int, idx)
1856 ),
1857 TP_fast_assign(
1858 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1859 __entry->ino = args->dp->i_ino;
1860 __entry->op_flags = args->op_flags;
1861 __entry->idx = idx;
1862 ),
1863 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1864 MAJOR(__entry->dev), MINOR(__entry->dev),
1865 __entry->ino,
1866 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1867 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001868)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001869
1870#define DEFINE_DIR2_SPACE_EVENT(name) \
1871DEFINE_EVENT(xfs_dir2_space_class, name, \
1872 TP_PROTO(struct xfs_da_args *args, int idx), \
1873 TP_ARGS(args, idx))
1874DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1875DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1876DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1877DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001878
1879TRACE_EVENT(xfs_dir2_leafn_moveents,
1880 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1881 TP_ARGS(args, src_idx, dst_idx, count),
1882 TP_STRUCT__entry(
1883 __field(dev_t, dev)
1884 __field(xfs_ino_t, ino)
1885 __field(int, op_flags)
1886 __field(int, src_idx)
1887 __field(int, dst_idx)
1888 __field(int, count)
1889 ),
1890 TP_fast_assign(
1891 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1892 __entry->ino = args->dp->i_ino;
1893 __entry->op_flags = args->op_flags;
1894 __entry->src_idx = src_idx;
1895 __entry->dst_idx = dst_idx;
1896 __entry->count = count;
1897 ),
1898 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1899 "src_idx %d dst_idx %d count %d",
1900 MAJOR(__entry->dev), MINOR(__entry->dev),
1901 __entry->ino,
1902 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1903 __entry->src_idx,
1904 __entry->dst_idx,
1905 __entry->count)
1906);
1907
Dave Chinner3a85cd92010-01-14 01:33:55 +00001908#define XFS_SWAPEXT_INODES \
1909 { 0, "target" }, \
1910 { 1, "temp" }
1911
1912#define XFS_INODE_FORMAT_STR \
1913 { 0, "invalid" }, \
1914 { 1, "local" }, \
1915 { 2, "extent" }, \
1916 { 3, "btree" }
1917
1918DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1919 TP_PROTO(struct xfs_inode *ip, int which),
1920 TP_ARGS(ip, which),
1921 TP_STRUCT__entry(
1922 __field(dev_t, dev)
1923 __field(int, which)
1924 __field(xfs_ino_t, ino)
1925 __field(int, format)
1926 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00001927 __field(int, broot_size)
1928 __field(int, fork_off)
1929 ),
1930 TP_fast_assign(
1931 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1932 __entry->which = which;
1933 __entry->ino = ip->i_ino;
1934 __entry->format = ip->i_d.di_format;
1935 __entry->nex = ip->i_d.di_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00001936 __entry->broot_size = ip->i_df.if_broot_bytes;
1937 __entry->fork_off = XFS_IFORK_BOFF(ip);
1938 ),
1939 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00001940 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00001941 MAJOR(__entry->dev), MINOR(__entry->dev),
1942 __entry->ino,
1943 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1944 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1945 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00001946 __entry->broot_size,
1947 __entry->fork_off)
1948)
1949
1950#define DEFINE_SWAPEXT_EVENT(name) \
1951DEFINE_EVENT(xfs_swap_extent_class, name, \
1952 TP_PROTO(struct xfs_inode *ip, int which), \
1953 TP_ARGS(ip, which))
1954
1955DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1956DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1957
Dave Chinner9abbc532010-04-13 15:06:46 +10001958DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001959 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10001960 struct xlog_recover_item *item, int pass),
1961 TP_ARGS(log, trans, item, pass),
1962 TP_STRUCT__entry(
1963 __field(dev_t, dev)
1964 __field(unsigned long, item)
1965 __field(xlog_tid_t, tid)
1966 __field(int, type)
1967 __field(int, pass)
1968 __field(int, count)
1969 __field(int, total)
1970 ),
1971 TP_fast_assign(
1972 __entry->dev = log->l_mp->m_super->s_dev;
1973 __entry->item = (unsigned long)item;
1974 __entry->tid = trans->r_log_tid;
1975 __entry->type = ITEM_TYPE(item);
1976 __entry->pass = pass;
1977 __entry->count = item->ri_cnt;
1978 __entry->total = item->ri_total;
1979 ),
1980 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
1981 "item region count/total %d/%d",
1982 MAJOR(__entry->dev), MINOR(__entry->dev),
1983 __entry->tid,
1984 __entry->pass,
1985 (void *)__entry->item,
1986 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1987 __entry->count,
1988 __entry->total)
1989)
1990
1991#define DEFINE_LOG_RECOVER_ITEM(name) \
1992DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001993 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10001994 struct xlog_recover_item *item, int pass), \
1995 TP_ARGS(log, trans, item, pass))
1996
1997DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
1998DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
1999DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2000DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2001DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2002
2003DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002004 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002005 TP_ARGS(log, buf_f),
2006 TP_STRUCT__entry(
2007 __field(dev_t, dev)
2008 __field(__int64_t, blkno)
2009 __field(unsigned short, len)
2010 __field(unsigned short, flags)
2011 __field(unsigned short, size)
2012 __field(unsigned int, map_size)
2013 ),
2014 TP_fast_assign(
2015 __entry->dev = log->l_mp->m_super->s_dev;
2016 __entry->blkno = buf_f->blf_blkno;
2017 __entry->len = buf_f->blf_len;
2018 __entry->flags = buf_f->blf_flags;
2019 __entry->size = buf_f->blf_size;
2020 __entry->map_size = buf_f->blf_map_size;
2021 ),
2022 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2023 "map_size %d",
2024 MAJOR(__entry->dev), MINOR(__entry->dev),
2025 __entry->blkno,
2026 __entry->len,
2027 __entry->flags,
2028 __entry->size,
2029 __entry->map_size)
2030)
2031
2032#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2033DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002034 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002035 TP_ARGS(log, buf_f))
2036
2037DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2038DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2039DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2040DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2041DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2042DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2043DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2044DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2045
2046DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002047 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002048 TP_ARGS(log, in_f),
2049 TP_STRUCT__entry(
2050 __field(dev_t, dev)
2051 __field(xfs_ino_t, ino)
2052 __field(unsigned short, size)
2053 __field(int, fields)
2054 __field(unsigned short, asize)
2055 __field(unsigned short, dsize)
2056 __field(__int64_t, blkno)
2057 __field(int, len)
2058 __field(int, boffset)
2059 ),
2060 TP_fast_assign(
2061 __entry->dev = log->l_mp->m_super->s_dev;
2062 __entry->ino = in_f->ilf_ino;
2063 __entry->size = in_f->ilf_size;
2064 __entry->fields = in_f->ilf_fields;
2065 __entry->asize = in_f->ilf_asize;
2066 __entry->dsize = in_f->ilf_dsize;
2067 __entry->blkno = in_f->ilf_blkno;
2068 __entry->len = in_f->ilf_len;
2069 __entry->boffset = in_f->ilf_boffset;
2070 ),
2071 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2072 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2073 MAJOR(__entry->dev), MINOR(__entry->dev),
2074 __entry->ino,
2075 __entry->size,
2076 __entry->fields,
2077 __entry->asize,
2078 __entry->dsize,
2079 __entry->blkno,
2080 __entry->len,
2081 __entry->boffset)
2082)
2083#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2084DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002085 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002086 TP_ARGS(log, in_f))
2087
2088DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2089DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2090DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2091
Christoph Hellwiga46db602011-01-07 13:02:04 +00002092DECLARE_EVENT_CLASS(xfs_discard_class,
2093 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2094 xfs_agblock_t agbno, xfs_extlen_t len),
2095 TP_ARGS(mp, agno, agbno, len),
2096 TP_STRUCT__entry(
2097 __field(dev_t, dev)
2098 __field(xfs_agnumber_t, agno)
2099 __field(xfs_agblock_t, agbno)
2100 __field(xfs_extlen_t, len)
2101 ),
2102 TP_fast_assign(
2103 __entry->dev = mp->m_super->s_dev;
2104 __entry->agno = agno;
2105 __entry->agbno = agbno;
2106 __entry->len = len;
2107 ),
2108 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
2109 MAJOR(__entry->dev), MINOR(__entry->dev),
2110 __entry->agno,
2111 __entry->agbno,
2112 __entry->len)
2113)
2114
2115#define DEFINE_DISCARD_EVENT(name) \
2116DEFINE_EVENT(xfs_discard_class, name, \
2117 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2118 xfs_agblock_t agbno, xfs_extlen_t len), \
2119 TP_ARGS(mp, agno, agbno, len))
2120DEFINE_DISCARD_EVENT(xfs_discard_extent);
2121DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2122DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2123DEFINE_DISCARD_EVENT(xfs_discard_busy);
2124
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00002125#endif /* _TRACE_XFS_H */
2126
2127#undef TRACE_INCLUDE_PATH
2128#define TRACE_INCLUDE_PATH .
2129#define TRACE_INCLUDE_FILE xfs_trace
2130#include <trace/define_trace.h>