blob: 30efa44a473cc49face44e0713124110e331f4fb [file] [log] [blame]
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM f2fs
3
4#if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_F2FS_H
6
7#include <linux/tracepoint.h>
8
9#define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev)
10#define show_dev_ino(entry) show_dev(entry), (unsigned long)entry->ino
Namjae Jeon6ec178d2013-04-23 17:51:43 +090011
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040012TRACE_DEFINE_ENUM(NODE);
13TRACE_DEFINE_ENUM(DATA);
14TRACE_DEFINE_ENUM(META);
15TRACE_DEFINE_ENUM(META_FLUSH);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070016TRACE_DEFINE_ENUM(INMEM);
17TRACE_DEFINE_ENUM(INMEM_DROP);
18TRACE_DEFINE_ENUM(IPU);
19TRACE_DEFINE_ENUM(OPU);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040020TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
21TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
22TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
23TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
24TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
25TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
26TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
27TRACE_DEFINE_ENUM(GC_GREEDY);
28TRACE_DEFINE_ENUM(GC_CB);
29TRACE_DEFINE_ENUM(FG_GC);
30TRACE_DEFINE_ENUM(BG_GC);
31TRACE_DEFINE_ENUM(LFS);
32TRACE_DEFINE_ENUM(SSR);
33TRACE_DEFINE_ENUM(__REQ_RAHEAD);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040034TRACE_DEFINE_ENUM(__REQ_SYNC);
35TRACE_DEFINE_ENUM(__REQ_NOIDLE);
36TRACE_DEFINE_ENUM(__REQ_FLUSH);
37TRACE_DEFINE_ENUM(__REQ_FUA);
38TRACE_DEFINE_ENUM(__REQ_PRIO);
39TRACE_DEFINE_ENUM(__REQ_META);
40TRACE_DEFINE_ENUM(CP_UMOUNT);
41TRACE_DEFINE_ENUM(CP_FASTBOOT);
42TRACE_DEFINE_ENUM(CP_SYNC);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070043TRACE_DEFINE_ENUM(CP_RECOVERY);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040044TRACE_DEFINE_ENUM(CP_DISCARD);
45
Namjae Jeon6ec178d2013-04-23 17:51:43 +090046#define show_block_type(type) \
47 __print_symbolic(type, \
48 { NODE, "NODE" }, \
49 { DATA, "DATA" }, \
50 { META, "META" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070051 { META_FLUSH, "META_FLUSH" }, \
52 { INMEM, "INMEM" }, \
53 { INMEM_DROP, "INMEM_DROP" }, \
Chao Yu28bc1062016-02-06 14:40:34 +080054 { INMEM_REVOKE, "INMEM_REVOKE" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070055 { IPU, "IN-PLACE" }, \
56 { OPU, "OUT-OF-PLACE" })
Namjae Jeon6ec178d2013-04-23 17:51:43 +090057
Mike Christie04d328d2016-06-05 14:31:55 -050058#define F2FS_BIO_FLAG_MASK(t) (t & (READA | WRITE_FLUSH_FUA))
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090059#define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO))
60
Mike Christie04d328d2016-06-05 14:31:55 -050061#define show_bio_type(op, op_flags) show_bio_op(op), \
62 show_bio_op_flags(op_flags), show_bio_extra(op_flags)
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090063
Mike Christie04d328d2016-06-05 14:31:55 -050064#define show_bio_op(op) \
65 __print_symbolic(op, \
Chao Yud4d288b2013-11-24 12:36:42 +090066 { READ, "READ" }, \
Mike Christie04d328d2016-06-05 14:31:55 -050067 { WRITE, "WRITE" })
68
69#define show_bio_op_flags(flags) \
70 __print_symbolic(F2FS_BIO_FLAG_MASK(flags), \
Chao Yud4d288b2013-11-24 12:36:42 +090071 { READA, "READAHEAD" }, \
72 { READ_SYNC, "READ_SYNC" }, \
Chao Yud4d288b2013-11-24 12:36:42 +090073 { WRITE_SYNC, "WRITE_SYNC" }, \
74 { WRITE_FLUSH, "WRITE_FLUSH" }, \
75 { WRITE_FUA, "WRITE_FUA" }, \
76 { WRITE_FLUSH_FUA, "WRITE_FLUSH_FUA" })
Namjae Jeona2a4a7e2013-04-20 01:28:40 +090077
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090078#define show_bio_extra(type) \
79 __print_symbolic(F2FS_BIO_EXTRA_MASK(type), \
80 { REQ_META, "(M)" }, \
81 { REQ_PRIO, "(P)" }, \
82 { REQ_META | REQ_PRIO, "(MP)" }, \
83 { 0, " \b" })
84
Namjae Jeon8e46b3e2013-04-23 16:42:53 +090085#define show_data_type(type) \
86 __print_symbolic(type, \
87 { CURSEG_HOT_DATA, "Hot DATA" }, \
88 { CURSEG_WARM_DATA, "Warm DATA" }, \
89 { CURSEG_COLD_DATA, "Cold DATA" }, \
90 { CURSEG_HOT_NODE, "Hot NODE" }, \
91 { CURSEG_WARM_NODE, "Warm NODE" }, \
92 { CURSEG_COLD_NODE, "Cold NODE" }, \
93 { NO_CHECK_TYPE, "No TYPE" })
94
Jaegeuk Kim26c6b882013-10-24 17:53:29 +090095#define show_file_type(type) \
96 __print_symbolic(type, \
97 { 0, "FILE" }, \
98 { 1, "DIR" })
99
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900100#define show_gc_type(type) \
101 __print_symbolic(type, \
102 { FG_GC, "Foreground GC" }, \
103 { BG_GC, "Background GC" })
104
105#define show_alloc_mode(type) \
106 __print_symbolic(type, \
107 { LFS, "LFS-mode" }, \
108 { SSR, "SSR-mode" })
109
110#define show_victim_policy(type) \
111 __print_symbolic(type, \
112 { GC_GREEDY, "Greedy" }, \
113 { GC_CB, "Cost-Benefit" })
114
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700115#define show_cpreason(type) \
116 __print_symbolic(type, \
117 { CP_UMOUNT, "Umount" }, \
Jaegeuk Kim119ee912015-01-29 11:45:33 -0800118 { CP_FASTBOOT, "Fastboot" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700119 { CP_SYNC, "Sync" }, \
Jaegeuk Kim10027552015-04-09 17:03:53 -0700120 { CP_RECOVERY, "Recovery" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700121 { CP_DISCARD, "Discard" })
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700122
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900123struct victim_sel_policy;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700124struct f2fs_map_blocks;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900125
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900126DECLARE_EVENT_CLASS(f2fs__inode,
127
128 TP_PROTO(struct inode *inode),
129
130 TP_ARGS(inode),
131
132 TP_STRUCT__entry(
133 __field(dev_t, dev)
134 __field(ino_t, ino)
135 __field(ino_t, pino)
136 __field(umode_t, mode)
137 __field(loff_t, size)
138 __field(unsigned int, nlink)
139 __field(blkcnt_t, blocks)
140 __field(__u8, advise)
141 ),
142
143 TP_fast_assign(
144 __entry->dev = inode->i_sb->s_dev;
145 __entry->ino = inode->i_ino;
146 __entry->pino = F2FS_I(inode)->i_pino;
147 __entry->mode = inode->i_mode;
148 __entry->nlink = inode->i_nlink;
149 __entry->size = inode->i_size;
150 __entry->blocks = inode->i_blocks;
151 __entry->advise = F2FS_I(inode)->i_advise;
152 ),
153
154 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
155 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
156 show_dev_ino(__entry),
157 (unsigned long)__entry->pino,
158 __entry->mode,
159 __entry->size,
160 (unsigned int)__entry->nlink,
161 (unsigned long long)__entry->blocks,
162 (unsigned char)__entry->advise)
163);
164
165DECLARE_EVENT_CLASS(f2fs__inode_exit,
166
167 TP_PROTO(struct inode *inode, int ret),
168
169 TP_ARGS(inode, ret),
170
171 TP_STRUCT__entry(
172 __field(dev_t, dev)
173 __field(ino_t, ino)
174 __field(int, ret)
175 ),
176
177 TP_fast_assign(
178 __entry->dev = inode->i_sb->s_dev;
179 __entry->ino = inode->i_ino;
180 __entry->ret = ret;
181 ),
182
183 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
184 show_dev_ino(__entry),
185 __entry->ret)
186);
187
188DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
189
190 TP_PROTO(struct inode *inode),
191
192 TP_ARGS(inode)
193);
194
195TRACE_EVENT(f2fs_sync_file_exit,
196
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800197 TP_PROTO(struct inode *inode, int need_cp, int datasync, int ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900198
199 TP_ARGS(inode, need_cp, datasync, ret),
200
201 TP_STRUCT__entry(
202 __field(dev_t, dev)
203 __field(ino_t, ino)
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800204 __field(int, need_cp)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900205 __field(int, datasync)
206 __field(int, ret)
207 ),
208
209 TP_fast_assign(
210 __entry->dev = inode->i_sb->s_dev;
211 __entry->ino = inode->i_ino;
212 __entry->need_cp = need_cp;
213 __entry->datasync = datasync;
214 __entry->ret = ret;
215 ),
216
217 TP_printk("dev = (%d,%d), ino = %lu, checkpoint is %s, "
218 "datasync = %d, ret = %d",
219 show_dev_ino(__entry),
220 __entry->need_cp ? "needed" : "not needed",
221 __entry->datasync,
222 __entry->ret)
223);
224
225TRACE_EVENT(f2fs_sync_fs,
226
227 TP_PROTO(struct super_block *sb, int wait),
228
229 TP_ARGS(sb, wait),
230
231 TP_STRUCT__entry(
232 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800233 __field(int, dirty)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900234 __field(int, wait)
235 ),
236
237 TP_fast_assign(
238 __entry->dev = sb->s_dev;
Chao Yucaf00472015-01-28 17:48:42 +0800239 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900240 __entry->wait = wait;
241 ),
242
243 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
244 show_dev(__entry),
245 __entry->dirty ? "dirty" : "not dirty",
246 __entry->wait)
247);
248
249DEFINE_EVENT(f2fs__inode, f2fs_iget,
250
251 TP_PROTO(struct inode *inode),
252
253 TP_ARGS(inode)
254);
255
256DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
257
258 TP_PROTO(struct inode *inode, int ret),
259
260 TP_ARGS(inode, ret)
261);
262
263DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
264
265 TP_PROTO(struct inode *inode),
266
267 TP_ARGS(inode)
268);
269
Jaegeuk Kimd70b4f52013-04-25 13:24:33 +0900270DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
271
272 TP_PROTO(struct inode *inode, int ret),
273
274 TP_ARGS(inode, ret)
275);
276
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900277TRACE_EVENT(f2fs_unlink_enter,
278
279 TP_PROTO(struct inode *dir, struct dentry *dentry),
280
281 TP_ARGS(dir, dentry),
282
283 TP_STRUCT__entry(
284 __field(dev_t, dev)
285 __field(ino_t, ino)
286 __field(loff_t, size)
287 __field(blkcnt_t, blocks)
288 __field(const char *, name)
289 ),
290
291 TP_fast_assign(
292 __entry->dev = dir->i_sb->s_dev;
293 __entry->ino = dir->i_ino;
294 __entry->size = dir->i_size;
295 __entry->blocks = dir->i_blocks;
296 __entry->name = dentry->d_name.name;
297 ),
298
299 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
300 "i_blocks = %llu, name = %s",
301 show_dev_ino(__entry),
302 __entry->size,
303 (unsigned long long)__entry->blocks,
304 __entry->name)
305);
306
307DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
308
309 TP_PROTO(struct inode *inode, int ret),
310
311 TP_ARGS(inode, ret)
312);
Namjae Jeon51dd6242013-04-20 01:28:52 +0900313
314DEFINE_EVENT(f2fs__inode, f2fs_truncate,
315
316 TP_PROTO(struct inode *inode),
317
318 TP_ARGS(inode)
319);
320
321TRACE_EVENT(f2fs_truncate_data_blocks_range,
322
323 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
324
325 TP_ARGS(inode, nid, ofs, free),
326
327 TP_STRUCT__entry(
328 __field(dev_t, dev)
329 __field(ino_t, ino)
330 __field(nid_t, nid)
331 __field(unsigned int, ofs)
332 __field(int, free)
333 ),
334
335 TP_fast_assign(
336 __entry->dev = inode->i_sb->s_dev;
337 __entry->ino = inode->i_ino;
338 __entry->nid = nid;
339 __entry->ofs = ofs;
340 __entry->free = free;
341 ),
342
343 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
344 show_dev_ino(__entry),
345 (unsigned int)__entry->nid,
346 __entry->ofs,
347 __entry->free)
348);
349
350DECLARE_EVENT_CLASS(f2fs__truncate_op,
351
352 TP_PROTO(struct inode *inode, u64 from),
353
354 TP_ARGS(inode, from),
355
356 TP_STRUCT__entry(
357 __field(dev_t, dev)
358 __field(ino_t, ino)
359 __field(loff_t, size)
360 __field(blkcnt_t, blocks)
361 __field(u64, from)
362 ),
363
364 TP_fast_assign(
365 __entry->dev = inode->i_sb->s_dev;
366 __entry->ino = inode->i_ino;
367 __entry->size = inode->i_size;
368 __entry->blocks = inode->i_blocks;
369 __entry->from = from;
370 ),
371
372 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
373 "start file offset = %llu",
374 show_dev_ino(__entry),
375 __entry->size,
376 (unsigned long long)__entry->blocks,
377 (unsigned long long)__entry->from)
378);
379
380DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
381
382 TP_PROTO(struct inode *inode, u64 from),
383
384 TP_ARGS(inode, from)
385);
386
387DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
388
389 TP_PROTO(struct inode *inode, int ret),
390
391 TP_ARGS(inode, ret)
392);
393
394DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
395
396 TP_PROTO(struct inode *inode, u64 from),
397
398 TP_ARGS(inode, from)
399);
400
401DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
402
403 TP_PROTO(struct inode *inode, int ret),
404
405 TP_ARGS(inode, ret)
406);
407
408DECLARE_EVENT_CLASS(f2fs__truncate_node,
409
410 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
411
412 TP_ARGS(inode, nid, blk_addr),
413
414 TP_STRUCT__entry(
415 __field(dev_t, dev)
416 __field(ino_t, ino)
417 __field(nid_t, nid)
418 __field(block_t, blk_addr)
419 ),
420
421 TP_fast_assign(
422 __entry->dev = inode->i_sb->s_dev;
423 __entry->ino = inode->i_ino;
424 __entry->nid = nid;
425 __entry->blk_addr = blk_addr;
426 ),
427
428 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
429 show_dev_ino(__entry),
430 (unsigned int)__entry->nid,
431 (unsigned long long)__entry->blk_addr)
432);
433
434DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
435
436 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
437
438 TP_ARGS(inode, nid, blk_addr)
439);
440
441DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
442
443 TP_PROTO(struct inode *inode, int ret),
444
445 TP_ARGS(inode, ret)
446);
447
448DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
449
450 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
451
452 TP_ARGS(inode, nid, blk_addr)
453);
454
455TRACE_EVENT(f2fs_truncate_partial_nodes,
456
457 TP_PROTO(struct inode *inode, nid_t nid[], int depth, int err),
458
459 TP_ARGS(inode, nid, depth, err),
460
461 TP_STRUCT__entry(
462 __field(dev_t, dev)
463 __field(ino_t, ino)
464 __field(nid_t, nid[3])
465 __field(int, depth)
466 __field(int, err)
467 ),
468
469 TP_fast_assign(
470 __entry->dev = inode->i_sb->s_dev;
471 __entry->ino = inode->i_ino;
472 __entry->nid[0] = nid[0];
473 __entry->nid[1] = nid[1];
474 __entry->nid[2] = nid[2];
475 __entry->depth = depth;
476 __entry->err = err;
477 ),
478
479 TP_printk("dev = (%d,%d), ino = %lu, "
480 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
481 show_dev_ino(__entry),
482 (unsigned int)__entry->nid[0],
483 (unsigned int)__entry->nid[1],
484 (unsigned int)__entry->nid[2],
485 __entry->depth,
486 __entry->err)
487);
488
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700489TRACE_EVENT(f2fs_map_blocks,
490 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900491
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700492 TP_ARGS(inode, map, ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900493
494 TP_STRUCT__entry(
495 __field(dev_t, dev)
496 __field(ino_t, ino)
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700497 __field(block_t, m_lblk)
498 __field(block_t, m_pblk)
499 __field(unsigned int, m_len)
Namjae Jeon848753a2013-04-23 16:38:02 +0900500 __field(int, ret)
501 ),
502
503 TP_fast_assign(
504 __entry->dev = inode->i_sb->s_dev;
505 __entry->ino = inode->i_ino;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700506 __entry->m_lblk = map->m_lblk;
507 __entry->m_pblk = map->m_pblk;
508 __entry->m_len = map->m_len;
Namjae Jeon848753a2013-04-23 16:38:02 +0900509 __entry->ret = ret;
510 ),
511
512 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700513 "start blkaddr = 0x%llx, len = 0x%llx, err = %d",
Namjae Jeon848753a2013-04-23 16:38:02 +0900514 show_dev_ino(__entry),
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700515 (unsigned long long)__entry->m_lblk,
516 (unsigned long long)__entry->m_pblk,
517 (unsigned long long)__entry->m_len,
Namjae Jeon848753a2013-04-23 16:38:02 +0900518 __entry->ret)
519);
520
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700521TRACE_EVENT(f2fs_background_gc,
522
523 TP_PROTO(struct super_block *sb, long wait_ms,
524 unsigned int prefree, unsigned int free),
525
526 TP_ARGS(sb, wait_ms, prefree, free),
527
528 TP_STRUCT__entry(
529 __field(dev_t, dev)
530 __field(long, wait_ms)
531 __field(unsigned int, prefree)
532 __field(unsigned int, free)
533 ),
534
535 TP_fast_assign(
536 __entry->dev = sb->s_dev;
537 __entry->wait_ms = wait_ms;
538 __entry->prefree = prefree;
539 __entry->free = free;
540 ),
541
542 TP_printk("dev = (%d,%d), wait_ms = %ld, prefree = %u, free = %u",
543 show_dev(__entry),
544 __entry->wait_ms,
545 __entry->prefree,
546 __entry->free)
547);
548
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900549TRACE_EVENT(f2fs_get_victim,
550
551 TP_PROTO(struct super_block *sb, int type, int gc_type,
552 struct victim_sel_policy *p, unsigned int pre_victim,
553 unsigned int prefree, unsigned int free),
554
555 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
556
557 TP_STRUCT__entry(
558 __field(dev_t, dev)
559 __field(int, type)
560 __field(int, gc_type)
561 __field(int, alloc_mode)
562 __field(int, gc_mode)
563 __field(unsigned int, victim)
564 __field(unsigned int, ofs_unit)
565 __field(unsigned int, pre_victim)
566 __field(unsigned int, prefree)
567 __field(unsigned int, free)
568 ),
569
570 TP_fast_assign(
571 __entry->dev = sb->s_dev;
572 __entry->type = type;
573 __entry->gc_type = gc_type;
574 __entry->alloc_mode = p->alloc_mode;
575 __entry->gc_mode = p->gc_mode;
576 __entry->victim = p->min_segno;
577 __entry->ofs_unit = p->ofs_unit;
578 __entry->pre_victim = pre_victim;
579 __entry->prefree = prefree;
580 __entry->free = free;
581 ),
582
583 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), victim = %u "
584 "ofs_unit = %u, pre_victim_secno = %d, prefree = %u, free = %u",
585 show_dev(__entry),
586 show_data_type(__entry->type),
587 show_gc_type(__entry->gc_type),
588 show_alloc_mode(__entry->alloc_mode),
589 show_victim_policy(__entry->gc_mode),
590 __entry->victim,
591 __entry->ofs_unit,
592 (int)__entry->pre_victim,
593 __entry->prefree,
594 __entry->free)
595);
596
Namjae Jeonc01e2852013-04-23 17:00:52 +0900597TRACE_EVENT(f2fs_fallocate,
598
599 TP_PROTO(struct inode *inode, int mode,
600 loff_t offset, loff_t len, int ret),
601
602 TP_ARGS(inode, mode, offset, len, ret),
603
604 TP_STRUCT__entry(
605 __field(dev_t, dev)
606 __field(ino_t, ino)
607 __field(int, mode)
608 __field(loff_t, offset)
609 __field(loff_t, len)
610 __field(loff_t, size)
611 __field(blkcnt_t, blocks)
612 __field(int, ret)
613 ),
614
615 TP_fast_assign(
616 __entry->dev = inode->i_sb->s_dev;
617 __entry->ino = inode->i_ino;
618 __entry->mode = mode;
619 __entry->offset = offset;
620 __entry->len = len;
621 __entry->size = inode->i_size;
622 __entry->blocks = inode->i_blocks;
623 __entry->ret = ret;
624 ),
625
626 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
627 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
628 show_dev_ino(__entry),
629 __entry->mode,
630 (unsigned long long)__entry->offset,
631 (unsigned long long)__entry->len,
632 (unsigned long long)__entry->size,
633 (unsigned long long)__entry->blocks,
634 __entry->ret)
635);
636
Chao Yu70407fad2014-07-31 21:11:22 +0800637TRACE_EVENT(f2fs_direct_IO_enter,
638
639 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
640
641 TP_ARGS(inode, offset, len, rw),
642
643 TP_STRUCT__entry(
644 __field(dev_t, dev)
645 __field(ino_t, ino)
646 __field(loff_t, pos)
647 __field(unsigned long, len)
648 __field(int, rw)
649 ),
650
651 TP_fast_assign(
652 __entry->dev = inode->i_sb->s_dev;
653 __entry->ino = inode->i_ino;
654 __entry->pos = offset;
655 __entry->len = len;
656 __entry->rw = rw;
657 ),
658
659 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
660 show_dev_ino(__entry),
661 __entry->pos,
662 __entry->len,
663 __entry->rw)
664);
665
666TRACE_EVENT(f2fs_direct_IO_exit,
667
668 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
669 int rw, int ret),
670
671 TP_ARGS(inode, offset, len, rw, ret),
672
673 TP_STRUCT__entry(
674 __field(dev_t, dev)
675 __field(ino_t, ino)
676 __field(loff_t, pos)
677 __field(unsigned long, len)
678 __field(int, rw)
679 __field(int, ret)
680 ),
681
682 TP_fast_assign(
683 __entry->dev = inode->i_sb->s_dev;
684 __entry->ino = inode->i_ino;
685 __entry->pos = offset;
686 __entry->len = len;
687 __entry->rw = rw;
688 __entry->ret = ret;
689 ),
690
691 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
692 "rw = %d ret = %d",
693 show_dev_ino(__entry),
694 __entry->pos,
695 __entry->len,
696 __entry->rw,
697 __entry->ret)
698);
699
Chao Yu46008c62016-05-09 19:56:30 +0800700TRACE_EVENT(f2fs_reserve_new_blocks,
Namjae Jeonc01e2852013-04-23 17:00:52 +0900701
Chao Yu46008c62016-05-09 19:56:30 +0800702 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
703 blkcnt_t count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900704
Chao Yu46008c62016-05-09 19:56:30 +0800705 TP_ARGS(inode, nid, ofs_in_node, count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900706
707 TP_STRUCT__entry(
708 __field(dev_t, dev)
709 __field(nid_t, nid)
710 __field(unsigned int, ofs_in_node)
Chao Yu46008c62016-05-09 19:56:30 +0800711 __field(blkcnt_t, count)
Namjae Jeonc01e2852013-04-23 17:00:52 +0900712 ),
713
714 TP_fast_assign(
715 __entry->dev = inode->i_sb->s_dev;
716 __entry->nid = nid;
717 __entry->ofs_in_node = ofs_in_node;
Chao Yu46008c62016-05-09 19:56:30 +0800718 __entry->count = count;
Namjae Jeonc01e2852013-04-23 17:00:52 +0900719 ),
720
Chao Yu46008c62016-05-09 19:56:30 +0800721 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
Namjae Jeonc01e2852013-04-23 17:00:52 +0900722 show_dev(__entry),
723 (unsigned int)__entry->nid,
Chao Yu46008c62016-05-09 19:56:30 +0800724 __entry->ofs_in_node,
725 (unsigned long long)__entry->count)
Namjae Jeonc01e2852013-04-23 17:00:52 +0900726);
727
Chao Yu3e1c8f12014-12-23 16:35:21 +0800728DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
729
Chao Yu2ace38e2014-12-24 16:08:14 +0800730 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800731
Chao Yu2ace38e2014-12-24 16:08:14 +0800732 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800733
734 TP_STRUCT__entry(
735 __field(dev_t, dev)
736 __field(ino_t, ino)
737 __field(pgoff_t, index)
Chao Yu7a9d7542016-02-22 18:36:38 +0800738 __field(block_t, old_blkaddr)
739 __field(block_t, new_blkaddr)
Mike Christie04d328d2016-06-05 14:31:55 -0500740 __field(int, op)
741 __field(int, op_flags)
Chao Yu3e1c8f12014-12-23 16:35:21 +0800742 __field(int, type)
743 ),
744
745 TP_fast_assign(
746 __entry->dev = page->mapping->host->i_sb->s_dev;
747 __entry->ino = page->mapping->host->i_ino;
748 __entry->index = page->index;
Chao Yu7a9d7542016-02-22 18:36:38 +0800749 __entry->old_blkaddr = fio->old_blkaddr;
750 __entry->new_blkaddr = fio->new_blkaddr;
Mike Christie04d328d2016-06-05 14:31:55 -0500751 __entry->op = fio->op;
752 __entry->op_flags = fio->op_flags;
Chao Yu2ace38e2014-12-24 16:08:14 +0800753 __entry->type = fio->type;
Chao Yu3e1c8f12014-12-23 16:35:21 +0800754 ),
755
756 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
Mike Christie04d328d2016-06-05 14:31:55 -0500757 "oldaddr = 0x%llx, newaddr = 0x%llx rw = %s%si%s, type = %s",
Chao Yu3e1c8f12014-12-23 16:35:21 +0800758 show_dev_ino(__entry),
759 (unsigned long)__entry->index,
Chao Yu7a9d7542016-02-22 18:36:38 +0800760 (unsigned long long)__entry->old_blkaddr,
761 (unsigned long long)__entry->new_blkaddr,
Mike Christie04d328d2016-06-05 14:31:55 -0500762 show_bio_type(__entry->op, __entry->op_flags),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800763 show_block_type(__entry->type))
764);
765
766DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
767
Chao Yu2ace38e2014-12-24 16:08:14 +0800768 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800769
Chao Yu2ace38e2014-12-24 16:08:14 +0800770 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800771
772 TP_CONDITION(page->mapping)
773);
774
775DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_mbio,
776
Chao Yu2ace38e2014-12-24 16:08:14 +0800777 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800778
Chao Yu2ace38e2014-12-24 16:08:14 +0800779 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800780
781 TP_CONDITION(page->mapping)
782);
783
Chao Yud4d288b2013-11-24 12:36:42 +0900784DECLARE_EVENT_CLASS(f2fs__submit_bio,
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900785
Chao Yu2ace38e2014-12-24 16:08:14 +0800786 TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
787 struct bio *bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900788
Chao Yu2ace38e2014-12-24 16:08:14 +0800789 TP_ARGS(sb, fio, bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900790
791 TP_STRUCT__entry(
792 __field(dev_t, dev)
Mike Christie04d328d2016-06-05 14:31:55 -0500793 __field(int, op)
794 __field(int, op_flags)
Chao Yud4d288b2013-11-24 12:36:42 +0900795 __field(int, type)
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900796 __field(sector_t, sector)
797 __field(unsigned int, size)
798 ),
799
800 TP_fast_assign(
801 __entry->dev = sb->s_dev;
Mike Christie04d328d2016-06-05 14:31:55 -0500802 __entry->op = fio->op;
803 __entry->op_flags = fio->op_flags;
Chao Yu2ace38e2014-12-24 16:08:14 +0800804 __entry->type = fio->type;
Kent Overstreet4f024f32013-10-11 15:44:27 -0700805 __entry->sector = bio->bi_iter.bi_sector;
806 __entry->size = bio->bi_iter.bi_size;
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900807 ),
808
Mike Christie04d328d2016-06-05 14:31:55 -0500809 TP_printk("dev = (%d,%d), %s%s%s, %s, sector = %lld, size = %u",
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900810 show_dev(__entry),
Mike Christie04d328d2016-06-05 14:31:55 -0500811 show_bio_type(__entry->op, __entry->op_flags),
Chao Yud4d288b2013-11-24 12:36:42 +0900812 show_block_type(__entry->type),
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900813 (unsigned long long)__entry->sector,
814 __entry->size)
815);
816
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +0900817DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_write_bio,
Chao Yud4d288b2013-11-24 12:36:42 +0900818
Chao Yu2ace38e2014-12-24 16:08:14 +0800819 TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
820 struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +0900821
Chao Yu2ace38e2014-12-24 16:08:14 +0800822 TP_ARGS(sb, fio, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +0900823
824 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +0900825);
826
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +0900827DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio,
Chao Yud4d288b2013-11-24 12:36:42 +0900828
Chao Yu2ace38e2014-12-24 16:08:14 +0800829 TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
830 struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +0900831
Chao Yu2ace38e2014-12-24 16:08:14 +0800832 TP_ARGS(sb, fio, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +0900833
834 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +0900835);
836
Chao Yu62aed042014-05-06 16:46:04 +0800837TRACE_EVENT(f2fs_write_begin,
838
839 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
840 unsigned int flags),
841
842 TP_ARGS(inode, pos, len, flags),
843
844 TP_STRUCT__entry(
845 __field(dev_t, dev)
846 __field(ino_t, ino)
847 __field(loff_t, pos)
848 __field(unsigned int, len)
849 __field(unsigned int, flags)
850 ),
851
852 TP_fast_assign(
853 __entry->dev = inode->i_sb->s_dev;
854 __entry->ino = inode->i_ino;
855 __entry->pos = pos;
856 __entry->len = len;
857 __entry->flags = flags;
858 ),
859
860 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
861 show_dev_ino(__entry),
862 (unsigned long long)__entry->pos,
863 __entry->len,
864 __entry->flags)
865);
866
Chao Yudfb2bf32014-05-06 16:47:23 +0800867TRACE_EVENT(f2fs_write_end,
868
869 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
870 unsigned int copied),
871
872 TP_ARGS(inode, pos, len, copied),
873
874 TP_STRUCT__entry(
875 __field(dev_t, dev)
876 __field(ino_t, ino)
877 __field(loff_t, pos)
878 __field(unsigned int, len)
879 __field(unsigned int, copied)
880 ),
881
882 TP_fast_assign(
883 __entry->dev = inode->i_sb->s_dev;
884 __entry->ino = inode->i_ino;
885 __entry->pos = pos;
886 __entry->len = len;
887 __entry->copied = copied;
888 ),
889
890 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
891 show_dev_ino(__entry),
892 (unsigned long long)__entry->pos,
893 __entry->len,
894 __entry->copied)
895);
896
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900897DECLARE_EVENT_CLASS(f2fs__page,
898
899 TP_PROTO(struct page *page, int type),
900
901 TP_ARGS(page, type),
902
903 TP_STRUCT__entry(
904 __field(dev_t, dev)
905 __field(ino_t, ino)
906 __field(int, type)
907 __field(int, dir)
908 __field(pgoff_t, index)
909 __field(int, dirty)
Chao Yuc20e89c2014-05-06 16:53:08 +0800910 __field(int, uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900911 ),
912
913 TP_fast_assign(
914 __entry->dev = page->mapping->host->i_sb->s_dev;
915 __entry->ino = page->mapping->host->i_ino;
916 __entry->type = type;
917 __entry->dir = S_ISDIR(page->mapping->host->i_mode);
918 __entry->index = page->index;
919 __entry->dirty = PageDirty(page);
Chao Yuc20e89c2014-05-06 16:53:08 +0800920 __entry->uptodate = PageUptodate(page);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900921 ),
922
Chao Yuc20e89c2014-05-06 16:53:08 +0800923 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
924 "dirty = %d, uptodate = %d",
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900925 show_dev_ino(__entry),
926 show_block_type(__entry->type),
927 show_file_type(__entry->dir),
928 (unsigned long)__entry->index,
Chao Yuc20e89c2014-05-06 16:53:08 +0800929 __entry->dirty,
930 __entry->uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900931);
932
Chao Yuecda0de2014-05-06 16:48:26 +0800933DEFINE_EVENT(f2fs__page, f2fs_writepage,
934
935 TP_PROTO(struct page *page, int type),
936
937 TP_ARGS(page, type)
938);
939
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -0700940DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
941
942 TP_PROTO(struct page *page, int type),
943
944 TP_ARGS(page, type)
945);
946
Chao Yuc20e89c2014-05-06 16:53:08 +0800947DEFINE_EVENT(f2fs__page, f2fs_readpage,
948
949 TP_PROTO(struct page *page, int type),
950
951 TP_ARGS(page, type)
952);
953
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900954DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
955
956 TP_PROTO(struct page *page, int type),
957
958 TP_ARGS(page, type)
959);
960
Jaegeuk Kime943a102013-10-25 14:26:31 +0900961DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
962
963 TP_PROTO(struct page *page, int type),
964
965 TP_ARGS(page, type)
966);
967
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -0700968DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
969
970 TP_PROTO(struct page *page, int type),
971
972 TP_ARGS(page, type)
973);
974
975DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
976
977 TP_PROTO(struct page *page, int type),
978
979 TP_ARGS(page, type)
980);
981
Chao Yue5748432014-05-06 16:51:24 +0800982TRACE_EVENT(f2fs_writepages,
983
984 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
985
986 TP_ARGS(inode, wbc, type),
987
988 TP_STRUCT__entry(
989 __field(dev_t, dev)
990 __field(ino_t, ino)
991 __field(int, type)
992 __field(int, dir)
993 __field(long, nr_to_write)
994 __field(long, pages_skipped)
995 __field(loff_t, range_start)
996 __field(loff_t, range_end)
997 __field(pgoff_t, writeback_index)
998 __field(int, sync_mode)
999 __field(char, for_kupdate)
1000 __field(char, for_background)
1001 __field(char, tagged_writepages)
1002 __field(char, for_reclaim)
1003 __field(char, range_cyclic)
1004 __field(char, for_sync)
1005 ),
1006
1007 TP_fast_assign(
1008 __entry->dev = inode->i_sb->s_dev;
1009 __entry->ino = inode->i_ino;
1010 __entry->type = type;
1011 __entry->dir = S_ISDIR(inode->i_mode);
1012 __entry->nr_to_write = wbc->nr_to_write;
1013 __entry->pages_skipped = wbc->pages_skipped;
1014 __entry->range_start = wbc->range_start;
1015 __entry->range_end = wbc->range_end;
1016 __entry->writeback_index = inode->i_mapping->writeback_index;
1017 __entry->sync_mode = wbc->sync_mode;
1018 __entry->for_kupdate = wbc->for_kupdate;
1019 __entry->for_background = wbc->for_background;
1020 __entry->tagged_writepages = wbc->tagged_writepages;
1021 __entry->for_reclaim = wbc->for_reclaim;
1022 __entry->range_cyclic = wbc->range_cyclic;
1023 __entry->for_sync = wbc->for_sync;
1024 ),
1025
1026 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1027 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1028 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1029 show_dev_ino(__entry),
1030 show_block_type(__entry->type),
1031 show_file_type(__entry->dir),
1032 __entry->nr_to_write,
1033 __entry->pages_skipped,
1034 __entry->range_start,
1035 __entry->range_end,
1036 (unsigned long)__entry->writeback_index,
1037 __entry->sync_mode,
1038 __entry->for_kupdate,
1039 __entry->for_background,
1040 __entry->tagged_writepages,
1041 __entry->for_reclaim,
1042 __entry->range_cyclic,
1043 __entry->for_sync)
1044);
1045
Chao Yub8c29402015-10-12 17:02:26 +08001046TRACE_EVENT(f2fs_readpages,
1047
1048 TP_PROTO(struct inode *inode, struct page *page, unsigned int nrpage),
1049
1050 TP_ARGS(inode, page, nrpage),
1051
1052 TP_STRUCT__entry(
1053 __field(dev_t, dev)
1054 __field(ino_t, ino)
1055 __field(pgoff_t, start)
1056 __field(unsigned int, nrpage)
1057 ),
1058
1059 TP_fast_assign(
1060 __entry->dev = inode->i_sb->s_dev;
1061 __entry->ino = inode->i_ino;
1062 __entry->start = page->index;
1063 __entry->nrpage = nrpage;
1064 ),
1065
1066 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1067 show_dev_ino(__entry),
1068 (unsigned long)__entry->start,
1069 __entry->nrpage)
1070);
1071
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001072TRACE_EVENT(f2fs_write_checkpoint,
1073
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001074 TP_PROTO(struct super_block *sb, int reason, char *msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001075
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001076 TP_ARGS(sb, reason, msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001077
1078 TP_STRUCT__entry(
1079 __field(dev_t, dev)
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001080 __field(int, reason)
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001081 __field(char *, msg)
1082 ),
1083
1084 TP_fast_assign(
1085 __entry->dev = sb->s_dev;
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001086 __entry->reason = reason;
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001087 __entry->msg = msg;
1088 ),
1089
1090 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1091 show_dev(__entry),
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001092 show_cpreason(__entry->reason),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001093 __entry->msg)
1094);
1095
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001096TRACE_EVENT(f2fs_issue_discard,
1097
1098 TP_PROTO(struct super_block *sb, block_t blkstart, block_t blklen),
1099
1100 TP_ARGS(sb, blkstart, blklen),
1101
1102 TP_STRUCT__entry(
1103 __field(dev_t, dev)
1104 __field(block_t, blkstart)
1105 __field(block_t, blklen)
1106 ),
1107
1108 TP_fast_assign(
1109 __entry->dev = sb->s_dev;
1110 __entry->blkstart = blkstart;
1111 __entry->blklen = blklen;
1112 ),
1113
1114 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1115 show_dev(__entry),
1116 (unsigned long long)__entry->blkstart,
1117 (unsigned long long)__entry->blklen)
1118);
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001119
1120TRACE_EVENT(f2fs_issue_flush,
1121
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001122 TP_PROTO(struct super_block *sb, unsigned int nobarrier,
1123 unsigned int flush_merge),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001124
1125 TP_ARGS(sb, nobarrier, flush_merge),
1126
1127 TP_STRUCT__entry(
1128 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001129 __field(unsigned int, nobarrier)
1130 __field(unsigned int, flush_merge)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001131 ),
1132
1133 TP_fast_assign(
1134 __entry->dev = sb->s_dev;
1135 __entry->nobarrier = nobarrier;
1136 __entry->flush_merge = flush_merge;
1137 ),
1138
1139 TP_printk("dev = (%d,%d), %s %s",
1140 show_dev(__entry),
1141 __entry->nobarrier ? "skip (nobarrier)" : "issue",
1142 __entry->flush_merge ? " with flush_merge" : "")
1143);
Chao Yu1ec46102015-02-05 17:59:59 +08001144
1145TRACE_EVENT(f2fs_lookup_extent_tree_start,
1146
1147 TP_PROTO(struct inode *inode, unsigned int pgofs),
1148
1149 TP_ARGS(inode, pgofs),
1150
1151 TP_STRUCT__entry(
1152 __field(dev_t, dev)
1153 __field(ino_t, ino)
1154 __field(unsigned int, pgofs)
1155 ),
1156
1157 TP_fast_assign(
1158 __entry->dev = inode->i_sb->s_dev;
1159 __entry->ino = inode->i_ino;
1160 __entry->pgofs = pgofs;
1161 ),
1162
1163 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1164 show_dev_ino(__entry),
1165 __entry->pgofs)
1166);
1167
1168TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1169
1170 TP_PROTO(struct inode *inode, unsigned int pgofs,
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001171 struct extent_info *ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001172
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001173 TP_ARGS(inode, pgofs, ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001174
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001175 TP_CONDITION(ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001176
1177 TP_STRUCT__entry(
1178 __field(dev_t, dev)
1179 __field(ino_t, ino)
1180 __field(unsigned int, pgofs)
1181 __field(unsigned int, fofs)
1182 __field(u32, blk)
1183 __field(unsigned int, len)
1184 ),
1185
1186 TP_fast_assign(
1187 __entry->dev = inode->i_sb->s_dev;
1188 __entry->ino = inode->i_ino;
1189 __entry->pgofs = pgofs;
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001190 __entry->fofs = ei->fofs;
1191 __entry->blk = ei->blk;
1192 __entry->len = ei->len;
Chao Yu1ec46102015-02-05 17:59:59 +08001193 ),
1194
1195 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1196 "ext_info(fofs: %u, blk: %u, len: %u)",
1197 show_dev_ino(__entry),
1198 __entry->pgofs,
1199 __entry->fofs,
1200 __entry->blk,
1201 __entry->len)
1202);
1203
Chao Yu744288c2015-09-06 17:50:13 +08001204TRACE_EVENT(f2fs_update_extent_tree_range,
Chao Yu1ec46102015-02-05 17:59:59 +08001205
Chao Yu744288c2015-09-06 17:50:13 +08001206 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1207 unsigned int len),
Chao Yu1ec46102015-02-05 17:59:59 +08001208
Chao Yu744288c2015-09-06 17:50:13 +08001209 TP_ARGS(inode, pgofs, blkaddr, len),
Chao Yu1ec46102015-02-05 17:59:59 +08001210
1211 TP_STRUCT__entry(
1212 __field(dev_t, dev)
1213 __field(ino_t, ino)
1214 __field(unsigned int, pgofs)
1215 __field(u32, blk)
Chao Yu744288c2015-09-06 17:50:13 +08001216 __field(unsigned int, len)
Chao Yu1ec46102015-02-05 17:59:59 +08001217 ),
1218
1219 TP_fast_assign(
1220 __entry->dev = inode->i_sb->s_dev;
1221 __entry->ino = inode->i_ino;
1222 __entry->pgofs = pgofs;
1223 __entry->blk = blkaddr;
Chao Yu744288c2015-09-06 17:50:13 +08001224 __entry->len = len;
Chao Yu1ec46102015-02-05 17:59:59 +08001225 ),
1226
Chao Yu744288c2015-09-06 17:50:13 +08001227 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1228 "blkaddr = %u, len = %u",
Chao Yu1ec46102015-02-05 17:59:59 +08001229 show_dev_ino(__entry),
1230 __entry->pgofs,
Chao Yu744288c2015-09-06 17:50:13 +08001231 __entry->blk,
1232 __entry->len)
Chao Yu1ec46102015-02-05 17:59:59 +08001233);
1234
1235TRACE_EVENT(f2fs_shrink_extent_tree,
1236
1237 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1238 unsigned int tree_cnt),
1239
1240 TP_ARGS(sbi, node_cnt, tree_cnt),
1241
1242 TP_STRUCT__entry(
1243 __field(dev_t, dev)
1244 __field(unsigned int, node_cnt)
1245 __field(unsigned int, tree_cnt)
1246 ),
1247
1248 TP_fast_assign(
1249 __entry->dev = sbi->sb->s_dev;
1250 __entry->node_cnt = node_cnt;
1251 __entry->tree_cnt = tree_cnt;
1252 ),
1253
1254 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
1255 show_dev(__entry),
1256 __entry->node_cnt,
1257 __entry->tree_cnt)
1258);
1259
1260TRACE_EVENT(f2fs_destroy_extent_tree,
1261
1262 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1263
1264 TP_ARGS(inode, node_cnt),
1265
1266 TP_STRUCT__entry(
1267 __field(dev_t, dev)
1268 __field(ino_t, ino)
1269 __field(unsigned int, node_cnt)
1270 ),
1271
1272 TP_fast_assign(
1273 __entry->dev = inode->i_sb->s_dev;
1274 __entry->ino = inode->i_ino;
1275 __entry->node_cnt = node_cnt;
1276 ),
1277
1278 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1279 show_dev_ino(__entry),
1280 __entry->node_cnt)
1281);
1282
Chao Yu4cf18532015-12-17 17:17:16 +08001283DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1284
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001285 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001286
1287 TP_ARGS(sb, type, count),
1288
1289 TP_STRUCT__entry(
1290 __field(dev_t, dev)
1291 __field(int, type)
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001292 __field(s64, count)
Chao Yu4cf18532015-12-17 17:17:16 +08001293 ),
1294
1295 TP_fast_assign(
1296 __entry->dev = sb->s_dev;
1297 __entry->type = type;
1298 __entry->count = count;
1299 ),
1300
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001301 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
Chao Yu4cf18532015-12-17 17:17:16 +08001302 show_dev(__entry),
1303 show_file_type(__entry->type),
1304 __entry->count)
1305);
1306
1307DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1308
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001309 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001310
1311 TP_ARGS(sb, type, count)
1312);
1313
1314DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1315
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001316 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001317
1318 TP_ARGS(sb, type, count)
1319);
1320
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09001321#endif /* _TRACE_F2FS_H */
1322
1323 /* This part must be outside protection */
1324#include <trace/define_trace.h>