blob: 47910e638c187fdd46470ca2c4ca975f2d3c1334 [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;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000034struct xlog_ticket;
Mark Tinguelyad223e62012-06-14 09:22:15 -050035struct xlog;
Dave Chinner9abbc532010-04-13 15:06:46 +100036struct xlog_recover;
37struct xlog_recover_item;
38struct xfs_buf_log_format;
39struct xfs_inode_log_format;
Alex Elder1ed845d2012-08-01 09:56:49 -050040struct xfs_bmbt_irec;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000041
Christoph Hellwigea9a4882009-12-21 14:03:03 +000042DECLARE_EVENT_CLASS(xfs_attr_list_class,
43 TP_PROTO(struct xfs_attr_list_context *ctx),
44 TP_ARGS(ctx),
45 TP_STRUCT__entry(
46 __field(dev_t, dev)
47 __field(xfs_ino_t, ino)
48 __field(u32, hashval)
49 __field(u32, blkno)
50 __field(u32, offset)
51 __field(void *, alist)
52 __field(int, bufsize)
53 __field(int, count)
54 __field(int, firstu)
55 __field(int, dupcnt)
56 __field(int, flags)
57 ),
58 TP_fast_assign(
59 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
60 __entry->ino = ctx->dp->i_ino;
61 __entry->hashval = ctx->cursor->hashval;
62 __entry->blkno = ctx->cursor->blkno;
63 __entry->offset = ctx->cursor->offset;
64 __entry->alist = ctx->alist;
65 __entry->bufsize = ctx->bufsize;
66 __entry->count = ctx->count;
67 __entry->firstu = ctx->firstu;
68 __entry->flags = ctx->flags;
69 ),
70 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
71 "alist 0x%p size %u count %u firstu %u flags %d %s",
72 MAJOR(__entry->dev), MINOR(__entry->dev),
73 __entry->ino,
74 __entry->hashval,
75 __entry->blkno,
76 __entry->offset,
77 __entry->dupcnt,
78 __entry->alist,
79 __entry->bufsize,
80 __entry->count,
81 __entry->firstu,
82 __entry->flags,
83 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
84 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000085)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000086
87#define DEFINE_ATTR_LIST_EVENT(name) \
88DEFINE_EVENT(xfs_attr_list_class, name, \
89 TP_PROTO(struct xfs_attr_list_context *ctx), \
90 TP_ARGS(ctx))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000091DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
92DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
93DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
94DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
95DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
96DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
97DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
98DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
Dave Chinneree732592012-11-12 22:53:53 +110099DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
100DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000101
Li Zefanf8adb4d2010-05-24 08:25:57 +0000102DECLARE_EVENT_CLASS(xfs_perag_class,
103 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
104 unsigned long caller_ip),
105 TP_ARGS(mp, agno, refcount, caller_ip),
106 TP_STRUCT__entry(
107 __field(dev_t, dev)
108 __field(xfs_agnumber_t, agno)
109 __field(int, refcount)
110 __field(unsigned long, caller_ip)
111 ),
112 TP_fast_assign(
113 __entry->dev = mp->m_super->s_dev;
114 __entry->agno = agno;
115 __entry->refcount = refcount;
116 __entry->caller_ip = caller_ip;
117 ),
118 TP_printk("dev %d:%d agno %u refcount %d caller %pf",
119 MAJOR(__entry->dev), MINOR(__entry->dev),
120 __entry->agno,
121 __entry->refcount,
122 (char *)__entry->caller_ip)
123);
124
125#define DEFINE_PERAG_REF_EVENT(name) \
126DEFINE_EVENT(xfs_perag_class, name, \
127 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
128 unsigned long caller_ip), \
129 TP_ARGS(mp, agno, refcount, caller_ip))
130DEFINE_PERAG_REF_EVENT(xfs_perag_get);
Dave Chinner65d0f202010-09-24 18:40:15 +1000131DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000132DEFINE_PERAG_REF_EVENT(xfs_perag_put);
Dave Chinner16fd5362010-07-20 09:43:39 +1000133DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
134DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
Brian Foster27b52862012-11-06 09:50:38 -0500135DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
136DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000137
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000138TRACE_EVENT(xfs_attr_list_node_descend,
139 TP_PROTO(struct xfs_attr_list_context *ctx,
140 struct xfs_da_node_entry *btree),
141 TP_ARGS(ctx, btree),
142 TP_STRUCT__entry(
143 __field(dev_t, dev)
144 __field(xfs_ino_t, ino)
145 __field(u32, hashval)
146 __field(u32, blkno)
147 __field(u32, offset)
148 __field(void *, alist)
149 __field(int, bufsize)
150 __field(int, count)
151 __field(int, firstu)
152 __field(int, dupcnt)
153 __field(int, flags)
154 __field(u32, bt_hashval)
155 __field(u32, bt_before)
156 ),
157 TP_fast_assign(
158 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
159 __entry->ino = ctx->dp->i_ino;
160 __entry->hashval = ctx->cursor->hashval;
161 __entry->blkno = ctx->cursor->blkno;
162 __entry->offset = ctx->cursor->offset;
163 __entry->alist = ctx->alist;
164 __entry->bufsize = ctx->bufsize;
165 __entry->count = ctx->count;
166 __entry->firstu = ctx->firstu;
167 __entry->flags = ctx->flags;
168 __entry->bt_hashval = be32_to_cpu(btree->hashval);
169 __entry->bt_before = be32_to_cpu(btree->before);
170 ),
171 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
172 "alist 0x%p size %u count %u firstu %u flags %d %s "
173 "node hashval %u, node before %u",
174 MAJOR(__entry->dev), MINOR(__entry->dev),
175 __entry->ino,
176 __entry->hashval,
177 __entry->blkno,
178 __entry->offset,
179 __entry->dupcnt,
180 __entry->alist,
181 __entry->bufsize,
182 __entry->count,
183 __entry->firstu,
184 __entry->flags,
185 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
186 __entry->bt_hashval,
187 __entry->bt_before)
188);
189
190TRACE_EVENT(xfs_iext_insert,
191 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
192 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
193 TP_ARGS(ip, idx, r, state, caller_ip),
194 TP_STRUCT__entry(
195 __field(dev_t, dev)
196 __field(xfs_ino_t, ino)
197 __field(xfs_extnum_t, idx)
198 __field(xfs_fileoff_t, startoff)
199 __field(xfs_fsblock_t, startblock)
200 __field(xfs_filblks_t, blockcount)
201 __field(xfs_exntst_t, state)
202 __field(int, bmap_state)
203 __field(unsigned long, caller_ip)
204 ),
205 TP_fast_assign(
206 __entry->dev = VFS_I(ip)->i_sb->s_dev;
207 __entry->ino = ip->i_ino;
208 __entry->idx = idx;
209 __entry->startoff = r->br_startoff;
210 __entry->startblock = r->br_startblock;
211 __entry->blockcount = r->br_blockcount;
212 __entry->state = r->br_state;
213 __entry->bmap_state = state;
214 __entry->caller_ip = caller_ip;
215 ),
216 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000217 "offset %lld block %lld count %lld flag %d caller %pf",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000218 MAJOR(__entry->dev), MINOR(__entry->dev),
219 __entry->ino,
220 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
221 (long)__entry->idx,
222 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000223 (__int64_t)__entry->startblock,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000224 __entry->blockcount,
225 __entry->state,
226 (char *)__entry->caller_ip)
227);
228
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000229DECLARE_EVENT_CLASS(xfs_bmap_class,
230 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
231 unsigned long caller_ip),
232 TP_ARGS(ip, idx, state, caller_ip),
233 TP_STRUCT__entry(
234 __field(dev_t, dev)
235 __field(xfs_ino_t, ino)
236 __field(xfs_extnum_t, idx)
237 __field(xfs_fileoff_t, startoff)
238 __field(xfs_fsblock_t, startblock)
239 __field(xfs_filblks_t, blockcount)
240 __field(xfs_exntst_t, state)
241 __field(int, bmap_state)
242 __field(unsigned long, caller_ip)
243 ),
244 TP_fast_assign(
245 struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ?
246 ip->i_afp : &ip->i_df;
247 struct xfs_bmbt_irec r;
248
249 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
250 __entry->dev = VFS_I(ip)->i_sb->s_dev;
251 __entry->ino = ip->i_ino;
252 __entry->idx = idx;
253 __entry->startoff = r.br_startoff;
254 __entry->startblock = r.br_startblock;
255 __entry->blockcount = r.br_blockcount;
256 __entry->state = r.br_state;
257 __entry->bmap_state = state;
258 __entry->caller_ip = caller_ip;
259 ),
260 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000261 "offset %lld block %lld count %lld flag %d caller %pf",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000262 MAJOR(__entry->dev), MINOR(__entry->dev),
263 __entry->ino,
264 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
265 (long)__entry->idx,
266 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000267 (__int64_t)__entry->startblock,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000268 __entry->blockcount,
269 __entry->state,
270 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000271)
272
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000273#define DEFINE_BMAP_EVENT(name) \
274DEFINE_EVENT(xfs_bmap_class, name, \
275 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
276 unsigned long caller_ip), \
277 TP_ARGS(ip, idx, state, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000278DEFINE_BMAP_EVENT(xfs_iext_remove);
279DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
280DEFINE_BMAP_EVENT(xfs_bmap_post_update);
281DEFINE_BMAP_EVENT(xfs_extlist);
282
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000283DECLARE_EVENT_CLASS(xfs_buf_class,
284 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
285 TP_ARGS(bp, caller_ip),
286 TP_STRUCT__entry(
287 __field(dev_t, dev)
288 __field(xfs_daddr_t, bno)
Dave Chinner4e94b712012-04-23 15:58:51 +1000289 __field(int, nblks)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000290 __field(int, hold)
291 __field(int, pincount)
292 __field(unsigned, lockval)
293 __field(unsigned, flags)
294 __field(unsigned long, caller_ip)
295 ),
296 TP_fast_assign(
297 __entry->dev = bp->b_target->bt_dev;
298 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000299 __entry->nblks = bp->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000300 __entry->hold = atomic_read(&bp->b_hold);
301 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200302 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000303 __entry->flags = bp->b_flags;
304 __entry->caller_ip = caller_ip;
305 ),
Dave Chinner4e94b712012-04-23 15:58:51 +1000306 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000307 "lock %d flags %s caller %pf",
308 MAJOR(__entry->dev), MINOR(__entry->dev),
309 (unsigned long long)__entry->bno,
Dave Chinner4e94b712012-04-23 15:58:51 +1000310 __entry->nblks,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000311 __entry->hold,
312 __entry->pincount,
313 __entry->lockval,
314 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
315 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000316)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000317
318#define DEFINE_BUF_EVENT(name) \
319DEFINE_EVENT(xfs_buf_class, name, \
320 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
321 TP_ARGS(bp, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000322DEFINE_BUF_EVENT(xfs_buf_init);
323DEFINE_BUF_EVENT(xfs_buf_free);
324DEFINE_BUF_EVENT(xfs_buf_hold);
325DEFINE_BUF_EVENT(xfs_buf_rele);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000326DEFINE_BUF_EVENT(xfs_buf_iodone);
327DEFINE_BUF_EVENT(xfs_buf_iorequest);
328DEFINE_BUF_EVENT(xfs_buf_bawrite);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000329DEFINE_BUF_EVENT(xfs_buf_lock);
330DEFINE_BUF_EVENT(xfs_buf_lock_done);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200331DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000332DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000333DEFINE_BUF_EVENT(xfs_buf_iowait);
334DEFINE_BUF_EVENT(xfs_buf_iowait_done);
335DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000336DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000337DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Dave Chinner686865f2010-09-24 20:07:47 +1000338DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000339DEFINE_BUF_EVENT(xfs_bdstrat_shut);
340DEFINE_BUF_EVENT(xfs_buf_item_relse);
341DEFINE_BUF_EVENT(xfs_buf_item_iodone);
342DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
343DEFINE_BUF_EVENT(xfs_buf_error_relse);
Dave Chinner9f878322013-01-21 23:53:55 +1100344DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000345DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
346DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
347
348/* not really buffer traces, but the buf provides useful information */
349DEFINE_BUF_EVENT(xfs_btree_corrupt);
350DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
351DEFINE_BUF_EVENT(xfs_reset_dqcounts);
352DEFINE_BUF_EVENT(xfs_inode_item_push);
353
354/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000355DECLARE_EVENT_CLASS(xfs_buf_flags_class,
356 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
357 TP_ARGS(bp, flags, caller_ip),
358 TP_STRUCT__entry(
359 __field(dev_t, dev)
360 __field(xfs_daddr_t, bno)
361 __field(size_t, buffer_length)
362 __field(int, hold)
363 __field(int, pincount)
364 __field(unsigned, lockval)
365 __field(unsigned, flags)
366 __field(unsigned long, caller_ip)
367 ),
368 TP_fast_assign(
369 __entry->dev = bp->b_target->bt_dev;
370 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000371 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000372 __entry->flags = flags;
373 __entry->hold = atomic_read(&bp->b_hold);
374 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200375 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000376 __entry->caller_ip = caller_ip;
377 ),
378 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
379 "lock %d flags %s caller %pf",
380 MAJOR(__entry->dev), MINOR(__entry->dev),
381 (unsigned long long)__entry->bno,
382 __entry->buffer_length,
383 __entry->hold,
384 __entry->pincount,
385 __entry->lockval,
386 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
387 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000388)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000389
390#define DEFINE_BUF_FLAGS_EVENT(name) \
391DEFINE_EVENT(xfs_buf_flags_class, name, \
392 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
393 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000394DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
395DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
396DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
397
398TRACE_EVENT(xfs_buf_ioerror,
399 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
400 TP_ARGS(bp, error, caller_ip),
401 TP_STRUCT__entry(
402 __field(dev_t, dev)
403 __field(xfs_daddr_t, bno)
404 __field(size_t, buffer_length)
405 __field(unsigned, flags)
406 __field(int, hold)
407 __field(int, pincount)
408 __field(unsigned, lockval)
409 __field(int, error)
410 __field(unsigned long, caller_ip)
411 ),
412 TP_fast_assign(
413 __entry->dev = bp->b_target->bt_dev;
414 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000415 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000416 __entry->hold = atomic_read(&bp->b_hold);
417 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200418 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000419 __entry->error = error;
420 __entry->flags = bp->b_flags;
421 __entry->caller_ip = caller_ip;
422 ),
423 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
424 "lock %d error %d flags %s caller %pf",
425 MAJOR(__entry->dev), MINOR(__entry->dev),
426 (unsigned long long)__entry->bno,
427 __entry->buffer_length,
428 __entry->hold,
429 __entry->pincount,
430 __entry->lockval,
431 __entry->error,
432 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
433 (void *)__entry->caller_ip)
434);
435
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000436DECLARE_EVENT_CLASS(xfs_buf_item_class,
437 TP_PROTO(struct xfs_buf_log_item *bip),
438 TP_ARGS(bip),
439 TP_STRUCT__entry(
440 __field(dev_t, dev)
441 __field(xfs_daddr_t, buf_bno)
442 __field(size_t, buf_len)
443 __field(int, buf_hold)
444 __field(int, buf_pincount)
445 __field(int, buf_lockval)
446 __field(unsigned, buf_flags)
447 __field(unsigned, bli_recur)
448 __field(int, bli_refcount)
449 __field(unsigned, bli_flags)
450 __field(void *, li_desc)
451 __field(unsigned, li_flags)
452 ),
453 TP_fast_assign(
454 __entry->dev = bip->bli_buf->b_target->bt_dev;
455 __entry->bli_flags = bip->bli_flags;
456 __entry->bli_recur = bip->bli_recur;
457 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
458 __entry->buf_bno = bip->bli_buf->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000459 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000460 __entry->buf_flags = bip->bli_buf->b_flags;
461 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
462 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200463 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000464 __entry->li_desc = bip->bli_item.li_desc;
465 __entry->li_flags = bip->bli_item.li_flags;
466 ),
467 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
468 "lock %d flags %s recur %d refcount %d bliflags %s "
469 "lidesc 0x%p liflags %s",
470 MAJOR(__entry->dev), MINOR(__entry->dev),
471 (unsigned long long)__entry->buf_bno,
472 __entry->buf_len,
473 __entry->buf_hold,
474 __entry->buf_pincount,
475 __entry->buf_lockval,
476 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
477 __entry->bli_recur,
478 __entry->bli_refcount,
479 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
480 __entry->li_desc,
481 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000482)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000483
484#define DEFINE_BUF_ITEM_EVENT(name) \
485DEFINE_EVENT(xfs_buf_item_class, name, \
486 TP_PROTO(struct xfs_buf_log_item *bip), \
487 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000488DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000489DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000490DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
491DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000492DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000493DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000494DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000495DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
496DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
497DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000498DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
499DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
500DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
501DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
502DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
503DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
504DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
505DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
506DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
507DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
508DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
509DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
510DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
511DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
512DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
513DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000514DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000515
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000516DECLARE_EVENT_CLASS(xfs_lock_class,
517 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
518 unsigned long caller_ip),
519 TP_ARGS(ip, lock_flags, caller_ip),
520 TP_STRUCT__entry(
521 __field(dev_t, dev)
522 __field(xfs_ino_t, ino)
523 __field(int, lock_flags)
524 __field(unsigned long, caller_ip)
525 ),
526 TP_fast_assign(
527 __entry->dev = VFS_I(ip)->i_sb->s_dev;
528 __entry->ino = ip->i_ino;
529 __entry->lock_flags = lock_flags;
530 __entry->caller_ip = caller_ip;
531 ),
532 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf",
533 MAJOR(__entry->dev), MINOR(__entry->dev),
534 __entry->ino,
535 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
536 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000537)
538
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000539#define DEFINE_LOCK_EVENT(name) \
540DEFINE_EVENT(xfs_lock_class, name, \
541 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
542 unsigned long caller_ip), \
543 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000544DEFINE_LOCK_EVENT(xfs_ilock);
545DEFINE_LOCK_EVENT(xfs_ilock_nowait);
546DEFINE_LOCK_EVENT(xfs_ilock_demote);
547DEFINE_LOCK_EVENT(xfs_iunlock);
548
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000549DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000550 TP_PROTO(struct xfs_inode *ip),
551 TP_ARGS(ip),
552 TP_STRUCT__entry(
553 __field(dev_t, dev)
554 __field(xfs_ino_t, ino)
555 ),
556 TP_fast_assign(
557 __entry->dev = VFS_I(ip)->i_sb->s_dev;
558 __entry->ino = ip->i_ino;
559 ),
560 TP_printk("dev %d:%d ino 0x%llx",
561 MAJOR(__entry->dev), MINOR(__entry->dev),
562 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000563)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000564
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000565#define DEFINE_INODE_EVENT(name) \
566DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000567 TP_PROTO(struct xfs_inode *ip), \
568 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000569DEFINE_INODE_EVENT(xfs_iget_skip);
570DEFINE_INODE_EVENT(xfs_iget_reclaim);
571DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
572DEFINE_INODE_EVENT(xfs_iget_hit);
573DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000574
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000575DEFINE_INODE_EVENT(xfs_getattr);
576DEFINE_INODE_EVENT(xfs_setattr);
577DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500578DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000579DEFINE_INODE_EVENT(xfs_alloc_file_space);
580DEFINE_INODE_EVENT(xfs_free_file_space);
581DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000582#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200583DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000584#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000585DEFINE_INODE_EVENT(xfs_vm_bmap);
586DEFINE_INODE_EVENT(xfs_file_ioctl);
587DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
588DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000589DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000590DEFINE_INODE_EVENT(xfs_file_fsync);
591DEFINE_INODE_EVENT(xfs_destroy_inode);
Al Virob57922d2010-06-07 14:34:48 -0400592DEFINE_INODE_EVENT(xfs_evict_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400593DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000594
595DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
596DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
597
Brian Foster27b52862012-11-06 09:50:38 -0500598DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
599DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500600DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Brian Foster27b52862012-11-06 09:50:38 -0500601
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000602DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000603 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
604 TP_ARGS(ip, caller_ip),
605 TP_STRUCT__entry(
606 __field(dev_t, dev)
607 __field(xfs_ino_t, ino)
608 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100609 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000610 __field(unsigned long, caller_ip)
611 ),
612 TP_fast_assign(
613 __entry->dev = VFS_I(ip)->i_sb->s_dev;
614 __entry->ino = ip->i_ino;
615 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100616 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000617 __entry->caller_ip = caller_ip;
618 ),
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100619 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pf",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000620 MAJOR(__entry->dev), MINOR(__entry->dev),
621 __entry->ino,
622 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100623 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000624 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000625)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000626
Brian Foster19cb7e32013-03-18 10:51:48 -0400627TRACE_EVENT(xfs_iomap_prealloc_size,
628 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
629 unsigned int writeio_blocks),
630 TP_ARGS(ip, blocks, shift, writeio_blocks),
631 TP_STRUCT__entry(
632 __field(dev_t, dev)
633 __field(xfs_ino_t, ino)
634 __field(xfs_fsblock_t, blocks)
635 __field(int, shift)
636 __field(unsigned int, writeio_blocks)
637 ),
638 TP_fast_assign(
639 __entry->dev = VFS_I(ip)->i_sb->s_dev;
640 __entry->ino = ip->i_ino;
641 __entry->blocks = blocks;
642 __entry->shift = shift;
643 __entry->writeio_blocks = writeio_blocks;
644 ),
645 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
646 "m_writeio_blocks %u",
647 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
648 __entry->blocks, __entry->shift, __entry->writeio_blocks)
649)
650
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000651#define DEFINE_IREF_EVENT(name) \
652DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000653 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
654 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000655DEFINE_IREF_EVENT(xfs_ihold);
656DEFINE_IREF_EVENT(xfs_irele);
657DEFINE_IREF_EVENT(xfs_inode_pin);
658DEFINE_IREF_EVENT(xfs_inode_unpin);
659DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100660
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000661DECLARE_EVENT_CLASS(xfs_namespace_class,
662 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
663 TP_ARGS(dp, name),
664 TP_STRUCT__entry(
665 __field(dev_t, dev)
666 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000667 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000668 __dynamic_array(char, name, name->len)
669 ),
670 TP_fast_assign(
671 __entry->dev = VFS_I(dp)->i_sb->s_dev;
672 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000673 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000674 memcpy(__get_str(name), name->name, name->len);
675 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000676 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000677 MAJOR(__entry->dev), MINOR(__entry->dev),
678 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000679 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000680 __get_str(name))
681)
682
683#define DEFINE_NAMESPACE_EVENT(name) \
684DEFINE_EVENT(xfs_namespace_class, name, \
685 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
686 TP_ARGS(dp, name))
687DEFINE_NAMESPACE_EVENT(xfs_remove);
688DEFINE_NAMESPACE_EVENT(xfs_link);
689DEFINE_NAMESPACE_EVENT(xfs_lookup);
690DEFINE_NAMESPACE_EVENT(xfs_create);
691DEFINE_NAMESPACE_EVENT(xfs_symlink);
692
693TRACE_EVENT(xfs_rename,
694 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
695 struct xfs_name *src_name, struct xfs_name *target_name),
696 TP_ARGS(src_dp, target_dp, src_name, target_name),
697 TP_STRUCT__entry(
698 __field(dev_t, dev)
699 __field(xfs_ino_t, src_dp_ino)
700 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000701 __field(int, src_namelen)
702 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000703 __dynamic_array(char, src_name, src_name->len)
704 __dynamic_array(char, target_name, target_name->len)
705 ),
706 TP_fast_assign(
707 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
708 __entry->src_dp_ino = src_dp->i_ino;
709 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000710 __entry->src_namelen = src_name->len;
711 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000712 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000713 memcpy(__get_str(target_name), target_name->name,
714 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000715 ),
716 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000717 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000718 MAJOR(__entry->dev), MINOR(__entry->dev),
719 __entry->src_dp_ino,
720 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000721 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000722 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000723 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000724 __get_str(target_name))
725)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000726
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000727DECLARE_EVENT_CLASS(xfs_dquot_class,
728 TP_PROTO(struct xfs_dquot *dqp),
729 TP_ARGS(dqp),
730 TP_STRUCT__entry(
731 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000732 __field(u32, id)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000733 __field(unsigned, flags)
734 __field(unsigned, nrefs)
735 __field(unsigned long long, res_bcount)
736 __field(unsigned long long, bcount)
737 __field(unsigned long long, icount)
738 __field(unsigned long long, blk_hardlimit)
739 __field(unsigned long long, blk_softlimit)
740 __field(unsigned long long, ino_hardlimit)
741 __field(unsigned long long, ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000742 ), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000743 TP_fast_assign(
744 __entry->dev = dqp->q_mount->m_super->s_dev;
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000745 __entry->id = be32_to_cpu(dqp->q_core.d_id);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000746 __entry->flags = dqp->dq_flags;
747 __entry->nrefs = dqp->q_nrefs;
748 __entry->res_bcount = dqp->q_res_bcount;
749 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
750 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
751 __entry->blk_hardlimit =
752 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
753 __entry->blk_softlimit =
754 be64_to_cpu(dqp->q_core.d_blk_softlimit);
755 __entry->ino_hardlimit =
756 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
757 __entry->ino_softlimit =
758 be64_to_cpu(dqp->q_core.d_ino_softlimit);
759 ),
760 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000761 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
762 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000763 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000764 __entry->id,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000765 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
766 __entry->nrefs,
767 __entry->res_bcount,
768 __entry->bcount,
769 __entry->blk_hardlimit,
770 __entry->blk_softlimit,
771 __entry->icount,
772 __entry->ino_hardlimit,
773 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000774)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000775
776#define DEFINE_DQUOT_EVENT(name) \
777DEFINE_EVENT(xfs_dquot_class, name, \
778 TP_PROTO(struct xfs_dquot *dqp), \
779 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000780DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000781DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
782DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b32012-02-01 13:57:20 +0000783DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
784DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000785DEFINE_DQUOT_EVENT(xfs_dqattach_found);
786DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000787DEFINE_DQUOT_EVENT(xfs_dqalloc);
788DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
789DEFINE_DQUOT_EVENT(xfs_dqread);
790DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000791DEFINE_DQUOT_EVENT(xfs_dqget_hit);
792DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000793DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
794DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000795DEFINE_DQUOT_EVENT(xfs_dqput);
796DEFINE_DQUOT_EVENT(xfs_dqput_wait);
797DEFINE_DQUOT_EVENT(xfs_dqput_free);
798DEFINE_DQUOT_EVENT(xfs_dqrele);
799DEFINE_DQUOT_EVENT(xfs_dqflush);
800DEFINE_DQUOT_EVENT(xfs_dqflush_force);
801DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000802
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000803DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -0500804 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000805 TP_ARGS(log, tic),
806 TP_STRUCT__entry(
807 __field(dev_t, dev)
808 __field(unsigned, trans_type)
809 __field(char, ocnt)
810 __field(char, cnt)
811 __field(int, curr_res)
812 __field(int, unit_res)
813 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +1100814 __field(int, reserveq)
815 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000816 __field(int, grant_reserve_cycle)
817 __field(int, grant_reserve_bytes)
818 __field(int, grant_write_cycle)
819 __field(int, grant_write_bytes)
820 __field(int, curr_cycle)
821 __field(int, curr_block)
822 __field(xfs_lsn_t, tail_lsn)
823 ),
824 TP_fast_assign(
825 __entry->dev = log->l_mp->m_super->s_dev;
826 __entry->trans_type = tic->t_trans_type;
827 __entry->ocnt = tic->t_ocnt;
828 __entry->cnt = tic->t_cnt;
829 __entry->curr_res = tic->t_curr_res;
830 __entry->unit_res = tic->t_unit_res;
831 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +0000832 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
833 __entry->writeq = list_empty(&log->l_write_head.waiters);
834 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100835 &__entry->grant_reserve_cycle,
836 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +0000837 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100838 &__entry->grant_write_cycle,
839 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000840 __entry->curr_cycle = log->l_curr_cycle;
841 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +1100842 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000843 ),
844 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +1100845 "t_unit_res %u t_flags %s reserveq %s "
846 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000847 "grant_reserve_bytes %d grant_write_cycle %d "
848 "grant_write_bytes %d curr_cycle %d curr_block %d "
849 "tail_cycle %d tail_block %d",
850 MAJOR(__entry->dev), MINOR(__entry->dev),
851 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
852 __entry->ocnt,
853 __entry->cnt,
854 __entry->curr_res,
855 __entry->unit_res,
856 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +1100857 __entry->reserveq ? "empty" : "active",
858 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000859 __entry->grant_reserve_cycle,
860 __entry->grant_reserve_bytes,
861 __entry->grant_write_cycle,
862 __entry->grant_write_bytes,
863 __entry->curr_cycle,
864 __entry->curr_block,
865 CYCLE_LSN(__entry->tail_lsn),
866 BLOCK_LSN(__entry->tail_lsn)
867 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000868)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000869
870#define DEFINE_LOGGRANT_EVENT(name) \
871DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -0500872 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000873 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000874DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
875DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000876DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +0000877DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
878DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +1100879DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +0000880DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
881DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
882DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
883DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000884DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
885DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
886DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
887DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
888DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
889DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
890
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000891DECLARE_EVENT_CLASS(xfs_log_item_class,
892 TP_PROTO(struct xfs_log_item *lip),
893 TP_ARGS(lip),
894 TP_STRUCT__entry(
895 __field(dev_t, dev)
896 __field(void *, lip)
897 __field(uint, type)
898 __field(uint, flags)
899 __field(xfs_lsn_t, lsn)
900 ),
901 TP_fast_assign(
902 __entry->dev = lip->li_mountp->m_super->s_dev;
903 __entry->lip = lip;
904 __entry->type = lip->li_type;
905 __entry->flags = lip->li_flags;
906 __entry->lsn = lip->li_lsn;
907 ),
908 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
909 MAJOR(__entry->dev), MINOR(__entry->dev),
910 __entry->lip,
911 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
912 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
913 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
914)
915
Dave Chinner14c26c62012-04-24 16:33:31 +1000916TRACE_EVENT(xfs_log_force,
917 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn),
918 TP_ARGS(mp, lsn),
919 TP_STRUCT__entry(
920 __field(dev_t, dev)
921 __field(xfs_lsn_t, lsn)
922 ),
923 TP_fast_assign(
924 __entry->dev = mp->m_super->s_dev;
925 __entry->lsn = lsn;
926 ),
927 TP_printk("dev %d:%d lsn 0x%llx",
928 MAJOR(__entry->dev), MINOR(__entry->dev),
929 __entry->lsn)
930)
931
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000932#define DEFINE_LOG_ITEM_EVENT(name) \
933DEFINE_EVENT(xfs_log_item_class, name, \
934 TP_PROTO(struct xfs_log_item *lip), \
935 TP_ARGS(lip))
936DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000937DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
938DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000939DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +0000940
941
Li Zefanf8adb4d2010-05-24 08:25:57 +0000942DECLARE_EVENT_CLASS(xfs_file_class,
943 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags),
944 TP_ARGS(ip, count, offset, flags),
945 TP_STRUCT__entry(
946 __field(dev_t, dev)
947 __field(xfs_ino_t, ino)
948 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000949 __field(loff_t, offset)
950 __field(size_t, count)
951 __field(int, flags)
952 ),
953 TP_fast_assign(
954 __entry->dev = VFS_I(ip)->i_sb->s_dev;
955 __entry->ino = ip->i_ino;
956 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +0000957 __entry->offset = offset;
958 __entry->count = count;
959 __entry->flags = flags;
960 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +0000961 TP_printk("dev %d:%d ino 0x%llx size 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +0000962 "offset 0x%llx count 0x%zx ioflags %s",
963 MAJOR(__entry->dev), MINOR(__entry->dev),
964 __entry->ino,
965 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +0000966 __entry->offset,
967 __entry->count,
968 __print_flags(__entry->flags, "|", XFS_IO_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000969)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000970
971#define DEFINE_RW_EVENT(name) \
972DEFINE_EVENT(xfs_file_class, name, \
973 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
974 TP_ARGS(ip, count, offset, flags))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000975DEFINE_RW_EVENT(xfs_file_read);
976DEFINE_RW_EVENT(xfs_file_buffered_write);
977DEFINE_RW_EVENT(xfs_file_direct_write);
978DEFINE_RW_EVENT(xfs_file_splice_read);
979DEFINE_RW_EVENT(xfs_file_splice_write);
980
Li Zefanf8adb4d2010-05-24 08:25:57 +0000981DECLARE_EVENT_CLASS(xfs_page_class,
Lukas Czerner34097df2013-05-21 23:58:01 -0400982 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
983 unsigned int len),
984 TP_ARGS(inode, page, off, len),
Li Zefanf8adb4d2010-05-24 08:25:57 +0000985 TP_STRUCT__entry(
986 __field(dev_t, dev)
987 __field(xfs_ino_t, ino)
988 __field(pgoff_t, pgoff)
989 __field(loff_t, size)
990 __field(unsigned long, offset)
Lukas Czerner34097df2013-05-21 23:58:01 -0400991 __field(unsigned int, length)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000992 __field(int, delalloc)
Li Zefanf8adb4d2010-05-24 08:25:57 +0000993 __field(int, unwritten)
994 ),
995 TP_fast_assign(
Christoph Hellwig20cb52e2010-06-24 09:46:01 +1000996 int delalloc = -1, unwritten = -1;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000997
Li Zefanf8adb4d2010-05-24 08:25:57 +0000998 if (page_has_buffers(page))
Christoph Hellwig20cb52e2010-06-24 09:46:01 +1000999 xfs_count_page_state(page, &delalloc, &unwritten);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001000 __entry->dev = inode->i_sb->s_dev;
1001 __entry->ino = XFS_I(inode)->i_ino;
1002 __entry->pgoff = page_offset(page);
1003 __entry->size = i_size_read(inode);
1004 __entry->offset = off;
Lukas Czerner34097df2013-05-21 23:58:01 -04001005 __entry->length = len;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001006 __entry->delalloc = delalloc;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001007 __entry->unwritten = unwritten;
1008 ),
1009 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
Lukas Czerner34097df2013-05-21 23:58:01 -04001010 "length %x delalloc %d unwritten %d",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001011 MAJOR(__entry->dev), MINOR(__entry->dev),
1012 __entry->ino,
1013 __entry->pgoff,
1014 __entry->size,
1015 __entry->offset,
Lukas Czerner34097df2013-05-21 23:58:01 -04001016 __entry->length,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001017 __entry->delalloc,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001018 __entry->unwritten)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001019)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001020
1021#define DEFINE_PAGE_EVENT(name) \
1022DEFINE_EVENT(xfs_page_class, name, \
Lukas Czerner34097df2013-05-21 23:58:01 -04001023 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1024 unsigned int len), \
1025 TP_ARGS(inode, page, off, len))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001026DEFINE_PAGE_EVENT(xfs_writepage);
1027DEFINE_PAGE_EVENT(xfs_releasepage);
1028DEFINE_PAGE_EVENT(xfs_invalidatepage);
1029
Christoph Hellwiga206c812010-12-10 08:42:20 +00001030DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001031 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001032 int type, struct xfs_bmbt_irec *irec),
1033 TP_ARGS(ip, offset, count, type, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001034 TP_STRUCT__entry(
1035 __field(dev_t, dev)
1036 __field(xfs_ino_t, ino)
1037 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001038 __field(loff_t, offset)
1039 __field(size_t, count)
Christoph Hellwiga206c812010-12-10 08:42:20 +00001040 __field(int, type)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001041 __field(xfs_fileoff_t, startoff)
1042 __field(xfs_fsblock_t, startblock)
1043 __field(xfs_filblks_t, blockcount)
1044 ),
1045 TP_fast_assign(
1046 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1047 __entry->ino = ip->i_ino;
1048 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001049 __entry->offset = offset;
1050 __entry->count = count;
Christoph Hellwiga206c812010-12-10 08:42:20 +00001051 __entry->type = type;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001052 __entry->startoff = irec ? irec->br_startoff : 0;
1053 __entry->startblock = irec ? irec->br_startblock : 0;
1054 __entry->blockcount = irec ? irec->br_blockcount : 0;
1055 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001056 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1057 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001058 MAJOR(__entry->dev), MINOR(__entry->dev),
1059 __entry->ino,
1060 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001061 __entry->offset,
1062 __entry->count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001063 __print_symbolic(__entry->type, XFS_IO_TYPES),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001064 __entry->startoff,
1065 (__int64_t)__entry->startblock,
1066 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001067)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001068
1069#define DEFINE_IOMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001070DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001071 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001072 int type, struct xfs_bmbt_irec *irec), \
1073 TP_ARGS(ip, offset, count, type, irec))
1074DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1075DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1076DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1077DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001078
Li Zefanf8adb4d2010-05-24 08:25:57 +00001079DECLARE_EVENT_CLASS(xfs_simple_io_class,
1080 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1081 TP_ARGS(ip, offset, count),
1082 TP_STRUCT__entry(
1083 __field(dev_t, dev)
1084 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001085 __field(loff_t, isize)
1086 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001087 __field(loff_t, offset)
1088 __field(size_t, count)
1089 ),
1090 TP_fast_assign(
1091 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1092 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001093 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001094 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001095 __entry->offset = offset;
1096 __entry->count = count;
1097 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001098 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001099 "offset 0x%llx count %zd",
1100 MAJOR(__entry->dev), MINOR(__entry->dev),
1101 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001102 __entry->isize,
1103 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001104 __entry->offset,
1105 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001106);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001107
1108#define DEFINE_SIMPLE_IO_EVENT(name) \
1109DEFINE_EVENT(xfs_simple_io_class, name, \
1110 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1111 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001112DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1113DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Christoph Hellwiga206c812010-12-10 08:42:20 +00001114DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001115DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001116
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001117DECLARE_EVENT_CLASS(xfs_itrunc_class,
1118 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1119 TP_ARGS(ip, new_size),
1120 TP_STRUCT__entry(
1121 __field(dev_t, dev)
1122 __field(xfs_ino_t, ino)
1123 __field(xfs_fsize_t, size)
1124 __field(xfs_fsize_t, new_size)
1125 ),
1126 TP_fast_assign(
1127 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1128 __entry->ino = ip->i_ino;
1129 __entry->size = ip->i_d.di_size;
1130 __entry->new_size = new_size;
1131 ),
1132 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1133 MAJOR(__entry->dev), MINOR(__entry->dev),
1134 __entry->ino,
1135 __entry->size,
1136 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001137)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001138
1139#define DEFINE_ITRUNC_EVENT(name) \
1140DEFINE_EVENT(xfs_itrunc_class, name, \
1141 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1142 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001143DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1144DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001145
1146TRACE_EVENT(xfs_pagecache_inval,
1147 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1148 TP_ARGS(ip, start, finish),
1149 TP_STRUCT__entry(
1150 __field(dev_t, dev)
1151 __field(xfs_ino_t, ino)
1152 __field(xfs_fsize_t, size)
1153 __field(xfs_off_t, start)
1154 __field(xfs_off_t, finish)
1155 ),
1156 TP_fast_assign(
1157 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1158 __entry->ino = ip->i_ino;
1159 __entry->size = ip->i_d.di_size;
1160 __entry->start = start;
1161 __entry->finish = finish;
1162 ),
1163 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1164 MAJOR(__entry->dev), MINOR(__entry->dev),
1165 __entry->ino,
1166 __entry->size,
1167 __entry->start,
1168 __entry->finish)
1169);
1170
1171TRACE_EVENT(xfs_bunmap,
1172 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1173 int flags, unsigned long caller_ip),
1174 TP_ARGS(ip, bno, len, flags, caller_ip),
1175 TP_STRUCT__entry(
1176 __field(dev_t, dev)
1177 __field(xfs_ino_t, ino)
1178 __field(xfs_fsize_t, size)
1179 __field(xfs_fileoff_t, bno)
1180 __field(xfs_filblks_t, len)
1181 __field(unsigned long, caller_ip)
1182 __field(int, flags)
1183 ),
1184 TP_fast_assign(
1185 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1186 __entry->ino = ip->i_ino;
1187 __entry->size = ip->i_d.di_size;
1188 __entry->bno = bno;
1189 __entry->len = len;
1190 __entry->caller_ip = caller_ip;
1191 __entry->flags = flags;
1192 ),
1193 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1194 "flags %s caller %pf",
1195 MAJOR(__entry->dev), MINOR(__entry->dev),
1196 __entry->ino,
1197 __entry->size,
1198 __entry->bno,
1199 __entry->len,
1200 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1201 (void *)__entry->caller_ip)
1202
1203);
1204
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001205DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001206 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1207 xfs_agblock_t agbno, xfs_extlen_t len),
1208 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001209 TP_STRUCT__entry(
1210 __field(dev_t, dev)
1211 __field(xfs_agnumber_t, agno)
1212 __field(xfs_agblock_t, agbno)
1213 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001214 ),
1215 TP_fast_assign(
1216 __entry->dev = mp->m_super->s_dev;
1217 __entry->agno = agno;
1218 __entry->agbno = agbno;
1219 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001220 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001221 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001222 MAJOR(__entry->dev), MINOR(__entry->dev),
1223 __entry->agno,
1224 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001225 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001226);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001227#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001228DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001229 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1230 xfs_agblock_t agbno, xfs_extlen_t len), \
1231 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001232DEFINE_BUSY_EVENT(xfs_extent_busy);
1233DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1234DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1235DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1236DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001237
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001238TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001239 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1240 xfs_agblock_t agbno, xfs_extlen_t len,
1241 xfs_agblock_t tbno, xfs_extlen_t tlen),
1242 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1243 TP_STRUCT__entry(
1244 __field(dev_t, dev)
1245 __field(xfs_agnumber_t, agno)
1246 __field(xfs_agblock_t, agbno)
1247 __field(xfs_extlen_t, len)
1248 __field(xfs_agblock_t, tbno)
1249 __field(xfs_extlen_t, tlen)
1250 ),
1251 TP_fast_assign(
1252 __entry->dev = mp->m_super->s_dev;
1253 __entry->agno = agno;
1254 __entry->agbno = agbno;
1255 __entry->len = len;
1256 __entry->tbno = tbno;
1257 __entry->tlen = tlen;
1258 ),
1259 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1260 MAJOR(__entry->dev), MINOR(__entry->dev),
1261 __entry->agno,
1262 __entry->agbno,
1263 __entry->len,
1264 __entry->tbno,
1265 __entry->tlen)
1266);
1267
Dave Chinnered3b4d62010-05-21 12:07:08 +10001268TRACE_EVENT(xfs_trans_commit_lsn,
1269 TP_PROTO(struct xfs_trans *trans),
1270 TP_ARGS(trans),
1271 TP_STRUCT__entry(
1272 __field(dev_t, dev)
1273 __field(struct xfs_trans *, tp)
1274 __field(xfs_lsn_t, lsn)
1275 ),
1276 TP_fast_assign(
1277 __entry->dev = trans->t_mountp->m_super->s_dev;
1278 __entry->tp = trans;
1279 __entry->lsn = trans->t_commit_lsn;
1280 ),
1281 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1282 MAJOR(__entry->dev), MINOR(__entry->dev),
1283 __entry->tp,
Dave Chinnerfd45e4782010-01-02 02:38:56 +00001284 __entry->lsn)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001285);
1286
1287TRACE_EVENT(xfs_agf,
1288 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1289 unsigned long caller_ip),
1290 TP_ARGS(mp, agf, flags, caller_ip),
1291 TP_STRUCT__entry(
1292 __field(dev_t, dev)
1293 __field(xfs_agnumber_t, agno)
1294 __field(int, flags)
1295 __field(__u32, length)
1296 __field(__u32, bno_root)
1297 __field(__u32, cnt_root)
1298 __field(__u32, bno_level)
1299 __field(__u32, cnt_level)
1300 __field(__u32, flfirst)
1301 __field(__u32, fllast)
1302 __field(__u32, flcount)
1303 __field(__u32, freeblks)
1304 __field(__u32, longest)
1305 __field(unsigned long, caller_ip)
1306 ),
1307 TP_fast_assign(
1308 __entry->dev = mp->m_super->s_dev;
1309 __entry->agno = be32_to_cpu(agf->agf_seqno),
1310 __entry->flags = flags;
1311 __entry->length = be32_to_cpu(agf->agf_length),
1312 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1313 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1314 __entry->bno_level =
1315 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1316 __entry->cnt_level =
1317 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1318 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1319 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1320 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1321 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1322 __entry->longest = be32_to_cpu(agf->agf_longest);
1323 __entry->caller_ip = caller_ip;
1324 ),
1325 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1326 "levels b %u c %u flfirst %u fllast %u flcount %u "
1327 "freeblks %u longest %u caller %pf",
1328 MAJOR(__entry->dev), MINOR(__entry->dev),
1329 __entry->agno,
1330 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1331 __entry->length,
1332 __entry->bno_root,
1333 __entry->cnt_root,
1334 __entry->bno_level,
1335 __entry->cnt_level,
1336 __entry->flfirst,
1337 __entry->fllast,
1338 __entry->flcount,
1339 __entry->freeblks,
1340 __entry->longest,
1341 (void *)__entry->caller_ip)
1342);
1343
1344TRACE_EVENT(xfs_free_extent,
1345 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1346 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1347 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1348 TP_STRUCT__entry(
1349 __field(dev_t, dev)
1350 __field(xfs_agnumber_t, agno)
1351 __field(xfs_agblock_t, agbno)
1352 __field(xfs_extlen_t, len)
1353 __field(int, isfl)
1354 __field(int, haveleft)
1355 __field(int, haveright)
1356 ),
1357 TP_fast_assign(
1358 __entry->dev = mp->m_super->s_dev;
1359 __entry->agno = agno;
1360 __entry->agbno = agbno;
1361 __entry->len = len;
1362 __entry->isfl = isfl;
1363 __entry->haveleft = haveleft;
1364 __entry->haveright = haveright;
1365 ),
1366 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1367 MAJOR(__entry->dev), MINOR(__entry->dev),
1368 __entry->agno,
1369 __entry->agbno,
1370 __entry->len,
1371 __entry->isfl,
1372 __entry->haveleft ?
1373 (__entry->haveright ? "both" : "left") :
1374 (__entry->haveright ? "right" : "none"))
1375
1376);
1377
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001378DECLARE_EVENT_CLASS(xfs_alloc_class,
1379 TP_PROTO(struct xfs_alloc_arg *args),
1380 TP_ARGS(args),
1381 TP_STRUCT__entry(
1382 __field(dev_t, dev)
1383 __field(xfs_agnumber_t, agno)
1384 __field(xfs_agblock_t, agbno)
1385 __field(xfs_extlen_t, minlen)
1386 __field(xfs_extlen_t, maxlen)
1387 __field(xfs_extlen_t, mod)
1388 __field(xfs_extlen_t, prod)
1389 __field(xfs_extlen_t, minleft)
1390 __field(xfs_extlen_t, total)
1391 __field(xfs_extlen_t, alignment)
1392 __field(xfs_extlen_t, minalignslop)
1393 __field(xfs_extlen_t, len)
1394 __field(short, type)
1395 __field(short, otype)
1396 __field(char, wasdel)
1397 __field(char, wasfromfl)
1398 __field(char, isfl)
1399 __field(char, userdata)
1400 __field(xfs_fsblock_t, firstblock)
1401 ),
1402 TP_fast_assign(
1403 __entry->dev = args->mp->m_super->s_dev;
1404 __entry->agno = args->agno;
1405 __entry->agbno = args->agbno;
1406 __entry->minlen = args->minlen;
1407 __entry->maxlen = args->maxlen;
1408 __entry->mod = args->mod;
1409 __entry->prod = args->prod;
1410 __entry->minleft = args->minleft;
1411 __entry->total = args->total;
1412 __entry->alignment = args->alignment;
1413 __entry->minalignslop = args->minalignslop;
1414 __entry->len = args->len;
1415 __entry->type = args->type;
1416 __entry->otype = args->otype;
1417 __entry->wasdel = args->wasdel;
1418 __entry->wasfromfl = args->wasfromfl;
1419 __entry->isfl = args->isfl;
1420 __entry->userdata = args->userdata;
1421 __entry->firstblock = args->firstblock;
1422 ),
1423 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1424 "prod %u minleft %u total %u alignment %u minalignslop %u "
1425 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1426 "userdata %d firstblock 0x%llx",
1427 MAJOR(__entry->dev), MINOR(__entry->dev),
1428 __entry->agno,
1429 __entry->agbno,
1430 __entry->minlen,
1431 __entry->maxlen,
1432 __entry->mod,
1433 __entry->prod,
1434 __entry->minleft,
1435 __entry->total,
1436 __entry->alignment,
1437 __entry->minalignslop,
1438 __entry->len,
1439 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1440 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1441 __entry->wasdel,
1442 __entry->wasfromfl,
1443 __entry->isfl,
1444 __entry->userdata,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001445 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001446)
1447
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001448#define DEFINE_ALLOC_EVENT(name) \
1449DEFINE_EVENT(xfs_alloc_class, name, \
1450 TP_PROTO(struct xfs_alloc_arg *args), \
1451 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001452DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001453DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001454DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1455DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1456DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1457DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1458DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1459DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001460DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1461DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001462DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1463DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1464DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1465DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1466DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001467DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001468DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1469DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1470DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1471DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1472DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1473DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1474DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1475DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1476DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1477
Dave Chinner5a5881c2012-03-22 05:15:13 +00001478DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001479 TP_PROTO(struct xfs_da_args *args),
1480 TP_ARGS(args),
1481 TP_STRUCT__entry(
1482 __field(dev_t, dev)
1483 __field(xfs_ino_t, ino)
1484 __dynamic_array(char, name, args->namelen)
1485 __field(int, namelen)
1486 __field(xfs_dahash_t, hashval)
1487 __field(xfs_ino_t, inumber)
1488 __field(int, op_flags)
1489 ),
1490 TP_fast_assign(
1491 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1492 __entry->ino = args->dp->i_ino;
1493 if (args->namelen)
1494 memcpy(__get_str(name), args->name, args->namelen);
1495 __entry->namelen = args->namelen;
1496 __entry->hashval = args->hashval;
1497 __entry->inumber = args->inumber;
1498 __entry->op_flags = args->op_flags;
1499 ),
1500 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1501 "inumber 0x%llx op_flags %s",
1502 MAJOR(__entry->dev), MINOR(__entry->dev),
1503 __entry->ino,
1504 __entry->namelen,
1505 __entry->namelen ? __get_str(name) : NULL,
1506 __entry->namelen,
1507 __entry->hashval,
1508 __entry->inumber,
1509 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001510)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001511
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001512#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001513DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001514 TP_PROTO(struct xfs_da_args *args), \
1515 TP_ARGS(args))
1516DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1517DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1518DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1519DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1520DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1521DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1522DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1523DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1524DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1525DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1526DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1527DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1528DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1529DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1530DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1531DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1532DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1533DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1534DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1535DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1536DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1537DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1538DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1539DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1540DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1541
Dave Chinneree732592012-11-12 22:53:53 +11001542DECLARE_EVENT_CLASS(xfs_attr_class,
1543 TP_PROTO(struct xfs_da_args *args),
1544 TP_ARGS(args),
1545 TP_STRUCT__entry(
1546 __field(dev_t, dev)
1547 __field(xfs_ino_t, ino)
1548 __dynamic_array(char, name, args->namelen)
1549 __field(int, namelen)
1550 __field(int, valuelen)
1551 __field(xfs_dahash_t, hashval)
1552 __field(int, op_flags)
1553 ),
1554 TP_fast_assign(
1555 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1556 __entry->ino = args->dp->i_ino;
1557 if (args->namelen)
1558 memcpy(__get_str(name), args->name, args->namelen);
1559 __entry->namelen = args->namelen;
1560 __entry->valuelen = args->valuelen;
1561 __entry->hashval = args->hashval;
1562 __entry->op_flags = args->op_flags;
1563 ),
1564 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1565 "hashval 0x%x op_flags %s",
1566 MAJOR(__entry->dev), MINOR(__entry->dev),
1567 __entry->ino,
1568 __entry->namelen,
1569 __entry->namelen ? __get_str(name) : NULL,
1570 __entry->namelen,
1571 __entry->valuelen,
1572 __entry->hashval,
1573 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1574)
1575
Dave Chinner5a5881c2012-03-22 05:15:13 +00001576#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11001577DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001578 TP_PROTO(struct xfs_da_args *args), \
1579 TP_ARGS(args))
1580DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1581DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1582DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1583DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1584DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1585DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
1586DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1587
1588DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1589DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1590DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11001591DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001592DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1593DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11001594DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1595DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001596DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1597DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11001598DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001599DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1600DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1601DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1602DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1603DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1604DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1605DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1606DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1607DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1608DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1609DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001610DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001611
1612DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11001613DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001614DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
1615DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1616DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1617
Dave Chinneree732592012-11-12 22:53:53 +11001618DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1619DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1620
1621DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1622DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1623DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1624
Dave Chinner5a5881c2012-03-22 05:15:13 +00001625#define DEFINE_DA_EVENT(name) \
1626DEFINE_EVENT(xfs_da_class, name, \
1627 TP_PROTO(struct xfs_da_args *args), \
1628 TP_ARGS(args))
1629DEFINE_DA_EVENT(xfs_da_split);
1630DEFINE_DA_EVENT(xfs_da_join);
1631DEFINE_DA_EVENT(xfs_da_link_before);
1632DEFINE_DA_EVENT(xfs_da_link_after);
1633DEFINE_DA_EVENT(xfs_da_unlink_back);
1634DEFINE_DA_EVENT(xfs_da_unlink_forward);
1635DEFINE_DA_EVENT(xfs_da_root_split);
1636DEFINE_DA_EVENT(xfs_da_root_join);
1637DEFINE_DA_EVENT(xfs_da_node_add);
1638DEFINE_DA_EVENT(xfs_da_node_create);
1639DEFINE_DA_EVENT(xfs_da_node_split);
1640DEFINE_DA_EVENT(xfs_da_node_remove);
1641DEFINE_DA_EVENT(xfs_da_node_rebalance);
1642DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001643DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001644DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1645DEFINE_DA_EVENT(xfs_da_grow_inode);
1646DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11001647DEFINE_DA_EVENT(xfs_da_fixhashpath);
1648DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001649
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001650DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1651 TP_PROTO(struct xfs_da_args *args, int idx),
1652 TP_ARGS(args, idx),
1653 TP_STRUCT__entry(
1654 __field(dev_t, dev)
1655 __field(xfs_ino_t, ino)
1656 __field(int, op_flags)
1657 __field(int, idx)
1658 ),
1659 TP_fast_assign(
1660 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1661 __entry->ino = args->dp->i_ino;
1662 __entry->op_flags = args->op_flags;
1663 __entry->idx = idx;
1664 ),
1665 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1666 MAJOR(__entry->dev), MINOR(__entry->dev),
1667 __entry->ino,
1668 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1669 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001670)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001671
1672#define DEFINE_DIR2_SPACE_EVENT(name) \
1673DEFINE_EVENT(xfs_dir2_space_class, name, \
1674 TP_PROTO(struct xfs_da_args *args, int idx), \
1675 TP_ARGS(args, idx))
1676DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1677DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1678DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1679DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001680
1681TRACE_EVENT(xfs_dir2_leafn_moveents,
1682 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1683 TP_ARGS(args, src_idx, dst_idx, count),
1684 TP_STRUCT__entry(
1685 __field(dev_t, dev)
1686 __field(xfs_ino_t, ino)
1687 __field(int, op_flags)
1688 __field(int, src_idx)
1689 __field(int, dst_idx)
1690 __field(int, count)
1691 ),
1692 TP_fast_assign(
1693 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1694 __entry->ino = args->dp->i_ino;
1695 __entry->op_flags = args->op_flags;
1696 __entry->src_idx = src_idx;
1697 __entry->dst_idx = dst_idx;
1698 __entry->count = count;
1699 ),
1700 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1701 "src_idx %d dst_idx %d count %d",
1702 MAJOR(__entry->dev), MINOR(__entry->dev),
1703 __entry->ino,
1704 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1705 __entry->src_idx,
1706 __entry->dst_idx,
1707 __entry->count)
1708);
1709
Dave Chinner3a85cd92010-01-14 01:33:55 +00001710#define XFS_SWAPEXT_INODES \
1711 { 0, "target" }, \
1712 { 1, "temp" }
1713
1714#define XFS_INODE_FORMAT_STR \
1715 { 0, "invalid" }, \
1716 { 1, "local" }, \
1717 { 2, "extent" }, \
1718 { 3, "btree" }
1719
1720DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1721 TP_PROTO(struct xfs_inode *ip, int which),
1722 TP_ARGS(ip, which),
1723 TP_STRUCT__entry(
1724 __field(dev_t, dev)
1725 __field(int, which)
1726 __field(xfs_ino_t, ino)
1727 __field(int, format)
1728 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00001729 __field(int, broot_size)
1730 __field(int, fork_off)
1731 ),
1732 TP_fast_assign(
1733 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1734 __entry->which = which;
1735 __entry->ino = ip->i_ino;
1736 __entry->format = ip->i_d.di_format;
1737 __entry->nex = ip->i_d.di_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00001738 __entry->broot_size = ip->i_df.if_broot_bytes;
1739 __entry->fork_off = XFS_IFORK_BOFF(ip);
1740 ),
1741 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00001742 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00001743 MAJOR(__entry->dev), MINOR(__entry->dev),
1744 __entry->ino,
1745 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1746 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1747 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00001748 __entry->broot_size,
1749 __entry->fork_off)
1750)
1751
1752#define DEFINE_SWAPEXT_EVENT(name) \
1753DEFINE_EVENT(xfs_swap_extent_class, name, \
1754 TP_PROTO(struct xfs_inode *ip, int which), \
1755 TP_ARGS(ip, which))
1756
1757DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1758DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1759
Dave Chinner9abbc532010-04-13 15:06:46 +10001760DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001761 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10001762 struct xlog_recover_item *item, int pass),
1763 TP_ARGS(log, trans, item, pass),
1764 TP_STRUCT__entry(
1765 __field(dev_t, dev)
1766 __field(unsigned long, item)
1767 __field(xlog_tid_t, tid)
1768 __field(int, type)
1769 __field(int, pass)
1770 __field(int, count)
1771 __field(int, total)
1772 ),
1773 TP_fast_assign(
1774 __entry->dev = log->l_mp->m_super->s_dev;
1775 __entry->item = (unsigned long)item;
1776 __entry->tid = trans->r_log_tid;
1777 __entry->type = ITEM_TYPE(item);
1778 __entry->pass = pass;
1779 __entry->count = item->ri_cnt;
1780 __entry->total = item->ri_total;
1781 ),
1782 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
1783 "item region count/total %d/%d",
1784 MAJOR(__entry->dev), MINOR(__entry->dev),
1785 __entry->tid,
1786 __entry->pass,
1787 (void *)__entry->item,
1788 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1789 __entry->count,
1790 __entry->total)
1791)
1792
1793#define DEFINE_LOG_RECOVER_ITEM(name) \
1794DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001795 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10001796 struct xlog_recover_item *item, int pass), \
1797 TP_ARGS(log, trans, item, pass))
1798
1799DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
1800DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
1801DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
1802DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
1803DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
1804
1805DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001806 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10001807 TP_ARGS(log, buf_f),
1808 TP_STRUCT__entry(
1809 __field(dev_t, dev)
1810 __field(__int64_t, blkno)
1811 __field(unsigned short, len)
1812 __field(unsigned short, flags)
1813 __field(unsigned short, size)
1814 __field(unsigned int, map_size)
1815 ),
1816 TP_fast_assign(
1817 __entry->dev = log->l_mp->m_super->s_dev;
1818 __entry->blkno = buf_f->blf_blkno;
1819 __entry->len = buf_f->blf_len;
1820 __entry->flags = buf_f->blf_flags;
1821 __entry->size = buf_f->blf_size;
1822 __entry->map_size = buf_f->blf_map_size;
1823 ),
1824 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
1825 "map_size %d",
1826 MAJOR(__entry->dev), MINOR(__entry->dev),
1827 __entry->blkno,
1828 __entry->len,
1829 __entry->flags,
1830 __entry->size,
1831 __entry->map_size)
1832)
1833
1834#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
1835DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001836 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10001837 TP_ARGS(log, buf_f))
1838
1839DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
1840DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
1841DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
1842DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
1843DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
1844DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
1845DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
1846DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
1847
1848DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001849 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10001850 TP_ARGS(log, in_f),
1851 TP_STRUCT__entry(
1852 __field(dev_t, dev)
1853 __field(xfs_ino_t, ino)
1854 __field(unsigned short, size)
1855 __field(int, fields)
1856 __field(unsigned short, asize)
1857 __field(unsigned short, dsize)
1858 __field(__int64_t, blkno)
1859 __field(int, len)
1860 __field(int, boffset)
1861 ),
1862 TP_fast_assign(
1863 __entry->dev = log->l_mp->m_super->s_dev;
1864 __entry->ino = in_f->ilf_ino;
1865 __entry->size = in_f->ilf_size;
1866 __entry->fields = in_f->ilf_fields;
1867 __entry->asize = in_f->ilf_asize;
1868 __entry->dsize = in_f->ilf_dsize;
1869 __entry->blkno = in_f->ilf_blkno;
1870 __entry->len = in_f->ilf_len;
1871 __entry->boffset = in_f->ilf_boffset;
1872 ),
1873 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
1874 "dsize %d, blkno 0x%llx, len %d, boffset %d",
1875 MAJOR(__entry->dev), MINOR(__entry->dev),
1876 __entry->ino,
1877 __entry->size,
1878 __entry->fields,
1879 __entry->asize,
1880 __entry->dsize,
1881 __entry->blkno,
1882 __entry->len,
1883 __entry->boffset)
1884)
1885#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
1886DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001887 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10001888 TP_ARGS(log, in_f))
1889
1890DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
1891DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
1892DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
1893
Christoph Hellwiga46db602011-01-07 13:02:04 +00001894DECLARE_EVENT_CLASS(xfs_discard_class,
1895 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1896 xfs_agblock_t agbno, xfs_extlen_t len),
1897 TP_ARGS(mp, agno, agbno, len),
1898 TP_STRUCT__entry(
1899 __field(dev_t, dev)
1900 __field(xfs_agnumber_t, agno)
1901 __field(xfs_agblock_t, agbno)
1902 __field(xfs_extlen_t, len)
1903 ),
1904 TP_fast_assign(
1905 __entry->dev = mp->m_super->s_dev;
1906 __entry->agno = agno;
1907 __entry->agbno = agbno;
1908 __entry->len = len;
1909 ),
1910 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
1911 MAJOR(__entry->dev), MINOR(__entry->dev),
1912 __entry->agno,
1913 __entry->agbno,
1914 __entry->len)
1915)
1916
1917#define DEFINE_DISCARD_EVENT(name) \
1918DEFINE_EVENT(xfs_discard_class, name, \
1919 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1920 xfs_agblock_t agbno, xfs_extlen_t len), \
1921 TP_ARGS(mp, agno, agbno, len))
1922DEFINE_DISCARD_EVENT(xfs_discard_extent);
1923DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
1924DEFINE_DISCARD_EVENT(xfs_discard_exclude);
1925DEFINE_DISCARD_EVENT(xfs_discard_busy);
1926
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001927#endif /* _TRACE_XFS_H */
1928
1929#undef TRACE_INCLUDE_PATH
1930#define TRACE_INCLUDE_PATH .
1931#define TRACE_INCLUDE_FILE xfs_trace
1932#include <trace/define_trace.h>