blob: 00b4a6308249ea5bd90df0b2f161d189fc326312 [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);
34TRACE_DEFINE_ENUM(__REQ_WRITE);
35TRACE_DEFINE_ENUM(__REQ_SYNC);
36TRACE_DEFINE_ENUM(__REQ_NOIDLE);
37TRACE_DEFINE_ENUM(__REQ_FLUSH);
38TRACE_DEFINE_ENUM(__REQ_FUA);
39TRACE_DEFINE_ENUM(__REQ_PRIO);
40TRACE_DEFINE_ENUM(__REQ_META);
41TRACE_DEFINE_ENUM(CP_UMOUNT);
42TRACE_DEFINE_ENUM(CP_FASTBOOT);
43TRACE_DEFINE_ENUM(CP_SYNC);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070044TRACE_DEFINE_ENUM(CP_RECOVERY);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040045TRACE_DEFINE_ENUM(CP_DISCARD);
46
Namjae Jeon6ec178d2013-04-23 17:51:43 +090047#define show_block_type(type) \
48 __print_symbolic(type, \
49 { NODE, "NODE" }, \
50 { DATA, "DATA" }, \
51 { META, "META" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070052 { META_FLUSH, "META_FLUSH" }, \
53 { INMEM, "INMEM" }, \
54 { INMEM_DROP, "INMEM_DROP" }, \
55 { IPU, "IN-PLACE" }, \
56 { OPU, "OUT-OF-PLACE" })
Namjae Jeon6ec178d2013-04-23 17:51:43 +090057
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090058#define F2FS_BIO_MASK(t) (t & (READA | WRITE_FLUSH_FUA))
59#define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO))
60
61#define show_bio_type(type) show_bio_base(type), show_bio_extra(type)
62
63#define show_bio_base(type) \
64 __print_symbolic(F2FS_BIO_MASK(type), \
Chao Yud4d288b2013-11-24 12:36:42 +090065 { READ, "READ" }, \
66 { READA, "READAHEAD" }, \
67 { READ_SYNC, "READ_SYNC" }, \
68 { WRITE, "WRITE" }, \
69 { WRITE_SYNC, "WRITE_SYNC" }, \
70 { WRITE_FLUSH, "WRITE_FLUSH" }, \
71 { WRITE_FUA, "WRITE_FUA" }, \
72 { WRITE_FLUSH_FUA, "WRITE_FLUSH_FUA" })
Namjae Jeona2a4a7e2013-04-20 01:28:40 +090073
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090074#define show_bio_extra(type) \
75 __print_symbolic(F2FS_BIO_EXTRA_MASK(type), \
76 { REQ_META, "(M)" }, \
77 { REQ_PRIO, "(P)" }, \
78 { REQ_META | REQ_PRIO, "(MP)" }, \
79 { 0, " \b" })
80
Namjae Jeon8e46b3e2013-04-23 16:42:53 +090081#define show_data_type(type) \
82 __print_symbolic(type, \
83 { CURSEG_HOT_DATA, "Hot DATA" }, \
84 { CURSEG_WARM_DATA, "Warm DATA" }, \
85 { CURSEG_COLD_DATA, "Cold DATA" }, \
86 { CURSEG_HOT_NODE, "Hot NODE" }, \
87 { CURSEG_WARM_NODE, "Warm NODE" }, \
88 { CURSEG_COLD_NODE, "Cold NODE" }, \
89 { NO_CHECK_TYPE, "No TYPE" })
90
Jaegeuk Kim26c6b882013-10-24 17:53:29 +090091#define show_file_type(type) \
92 __print_symbolic(type, \
93 { 0, "FILE" }, \
94 { 1, "DIR" })
95
Namjae Jeon8e46b3e2013-04-23 16:42:53 +090096#define show_gc_type(type) \
97 __print_symbolic(type, \
98 { FG_GC, "Foreground GC" }, \
99 { BG_GC, "Background GC" })
100
101#define show_alloc_mode(type) \
102 __print_symbolic(type, \
103 { LFS, "LFS-mode" }, \
104 { SSR, "SSR-mode" })
105
106#define show_victim_policy(type) \
107 __print_symbolic(type, \
108 { GC_GREEDY, "Greedy" }, \
109 { GC_CB, "Cost-Benefit" })
110
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700111#define show_cpreason(type) \
112 __print_symbolic(type, \
113 { CP_UMOUNT, "Umount" }, \
Jaegeuk Kim119ee912015-01-29 11:45:33 -0800114 { CP_FASTBOOT, "Fastboot" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700115 { CP_SYNC, "Sync" }, \
Jaegeuk Kim10027552015-04-09 17:03:53 -0700116 { CP_RECOVERY, "Recovery" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700117 { CP_DISCARD, "Discard" })
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700118
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900119struct victim_sel_policy;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700120struct f2fs_map_blocks;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900121
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900122DECLARE_EVENT_CLASS(f2fs__inode,
123
124 TP_PROTO(struct inode *inode),
125
126 TP_ARGS(inode),
127
128 TP_STRUCT__entry(
129 __field(dev_t, dev)
130 __field(ino_t, ino)
131 __field(ino_t, pino)
132 __field(umode_t, mode)
133 __field(loff_t, size)
134 __field(unsigned int, nlink)
135 __field(blkcnt_t, blocks)
136 __field(__u8, advise)
137 ),
138
139 TP_fast_assign(
140 __entry->dev = inode->i_sb->s_dev;
141 __entry->ino = inode->i_ino;
142 __entry->pino = F2FS_I(inode)->i_pino;
143 __entry->mode = inode->i_mode;
144 __entry->nlink = inode->i_nlink;
145 __entry->size = inode->i_size;
146 __entry->blocks = inode->i_blocks;
147 __entry->advise = F2FS_I(inode)->i_advise;
148 ),
149
150 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
151 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
152 show_dev_ino(__entry),
153 (unsigned long)__entry->pino,
154 __entry->mode,
155 __entry->size,
156 (unsigned int)__entry->nlink,
157 (unsigned long long)__entry->blocks,
158 (unsigned char)__entry->advise)
159);
160
161DECLARE_EVENT_CLASS(f2fs__inode_exit,
162
163 TP_PROTO(struct inode *inode, int ret),
164
165 TP_ARGS(inode, ret),
166
167 TP_STRUCT__entry(
168 __field(dev_t, dev)
169 __field(ino_t, ino)
170 __field(int, ret)
171 ),
172
173 TP_fast_assign(
174 __entry->dev = inode->i_sb->s_dev;
175 __entry->ino = inode->i_ino;
176 __entry->ret = ret;
177 ),
178
179 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
180 show_dev_ino(__entry),
181 __entry->ret)
182);
183
184DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
185
186 TP_PROTO(struct inode *inode),
187
188 TP_ARGS(inode)
189);
190
191TRACE_EVENT(f2fs_sync_file_exit,
192
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800193 TP_PROTO(struct inode *inode, int need_cp, int datasync, int ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900194
195 TP_ARGS(inode, need_cp, datasync, ret),
196
197 TP_STRUCT__entry(
198 __field(dev_t, dev)
199 __field(ino_t, ino)
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800200 __field(int, need_cp)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900201 __field(int, datasync)
202 __field(int, ret)
203 ),
204
205 TP_fast_assign(
206 __entry->dev = inode->i_sb->s_dev;
207 __entry->ino = inode->i_ino;
208 __entry->need_cp = need_cp;
209 __entry->datasync = datasync;
210 __entry->ret = ret;
211 ),
212
213 TP_printk("dev = (%d,%d), ino = %lu, checkpoint is %s, "
214 "datasync = %d, ret = %d",
215 show_dev_ino(__entry),
216 __entry->need_cp ? "needed" : "not needed",
217 __entry->datasync,
218 __entry->ret)
219);
220
221TRACE_EVENT(f2fs_sync_fs,
222
223 TP_PROTO(struct super_block *sb, int wait),
224
225 TP_ARGS(sb, wait),
226
227 TP_STRUCT__entry(
228 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800229 __field(int, dirty)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900230 __field(int, wait)
231 ),
232
233 TP_fast_assign(
234 __entry->dev = sb->s_dev;
Chao Yucaf00472015-01-28 17:48:42 +0800235 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900236 __entry->wait = wait;
237 ),
238
239 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
240 show_dev(__entry),
241 __entry->dirty ? "dirty" : "not dirty",
242 __entry->wait)
243);
244
245DEFINE_EVENT(f2fs__inode, f2fs_iget,
246
247 TP_PROTO(struct inode *inode),
248
249 TP_ARGS(inode)
250);
251
252DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
253
254 TP_PROTO(struct inode *inode, int ret),
255
256 TP_ARGS(inode, ret)
257);
258
259DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
260
261 TP_PROTO(struct inode *inode),
262
263 TP_ARGS(inode)
264);
265
Jaegeuk Kimd70b4f52013-04-25 13:24:33 +0900266DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
267
268 TP_PROTO(struct inode *inode, int ret),
269
270 TP_ARGS(inode, ret)
271);
272
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900273TRACE_EVENT(f2fs_unlink_enter,
274
275 TP_PROTO(struct inode *dir, struct dentry *dentry),
276
277 TP_ARGS(dir, dentry),
278
279 TP_STRUCT__entry(
280 __field(dev_t, dev)
281 __field(ino_t, ino)
282 __field(loff_t, size)
283 __field(blkcnt_t, blocks)
284 __field(const char *, name)
285 ),
286
287 TP_fast_assign(
288 __entry->dev = dir->i_sb->s_dev;
289 __entry->ino = dir->i_ino;
290 __entry->size = dir->i_size;
291 __entry->blocks = dir->i_blocks;
292 __entry->name = dentry->d_name.name;
293 ),
294
295 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
296 "i_blocks = %llu, name = %s",
297 show_dev_ino(__entry),
298 __entry->size,
299 (unsigned long long)__entry->blocks,
300 __entry->name)
301);
302
303DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
304
305 TP_PROTO(struct inode *inode, int ret),
306
307 TP_ARGS(inode, ret)
308);
Namjae Jeon51dd6242013-04-20 01:28:52 +0900309
310DEFINE_EVENT(f2fs__inode, f2fs_truncate,
311
312 TP_PROTO(struct inode *inode),
313
314 TP_ARGS(inode)
315);
316
317TRACE_EVENT(f2fs_truncate_data_blocks_range,
318
319 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
320
321 TP_ARGS(inode, nid, ofs, free),
322
323 TP_STRUCT__entry(
324 __field(dev_t, dev)
325 __field(ino_t, ino)
326 __field(nid_t, nid)
327 __field(unsigned int, ofs)
328 __field(int, free)
329 ),
330
331 TP_fast_assign(
332 __entry->dev = inode->i_sb->s_dev;
333 __entry->ino = inode->i_ino;
334 __entry->nid = nid;
335 __entry->ofs = ofs;
336 __entry->free = free;
337 ),
338
339 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
340 show_dev_ino(__entry),
341 (unsigned int)__entry->nid,
342 __entry->ofs,
343 __entry->free)
344);
345
346DECLARE_EVENT_CLASS(f2fs__truncate_op,
347
348 TP_PROTO(struct inode *inode, u64 from),
349
350 TP_ARGS(inode, from),
351
352 TP_STRUCT__entry(
353 __field(dev_t, dev)
354 __field(ino_t, ino)
355 __field(loff_t, size)
356 __field(blkcnt_t, blocks)
357 __field(u64, from)
358 ),
359
360 TP_fast_assign(
361 __entry->dev = inode->i_sb->s_dev;
362 __entry->ino = inode->i_ino;
363 __entry->size = inode->i_size;
364 __entry->blocks = inode->i_blocks;
365 __entry->from = from;
366 ),
367
368 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
369 "start file offset = %llu",
370 show_dev_ino(__entry),
371 __entry->size,
372 (unsigned long long)__entry->blocks,
373 (unsigned long long)__entry->from)
374);
375
376DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
377
378 TP_PROTO(struct inode *inode, u64 from),
379
380 TP_ARGS(inode, from)
381);
382
383DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
384
385 TP_PROTO(struct inode *inode, int ret),
386
387 TP_ARGS(inode, ret)
388);
389
390DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
391
392 TP_PROTO(struct inode *inode, u64 from),
393
394 TP_ARGS(inode, from)
395);
396
397DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
398
399 TP_PROTO(struct inode *inode, int ret),
400
401 TP_ARGS(inode, ret)
402);
403
404DECLARE_EVENT_CLASS(f2fs__truncate_node,
405
406 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
407
408 TP_ARGS(inode, nid, blk_addr),
409
410 TP_STRUCT__entry(
411 __field(dev_t, dev)
412 __field(ino_t, ino)
413 __field(nid_t, nid)
414 __field(block_t, blk_addr)
415 ),
416
417 TP_fast_assign(
418 __entry->dev = inode->i_sb->s_dev;
419 __entry->ino = inode->i_ino;
420 __entry->nid = nid;
421 __entry->blk_addr = blk_addr;
422 ),
423
424 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
425 show_dev_ino(__entry),
426 (unsigned int)__entry->nid,
427 (unsigned long long)__entry->blk_addr)
428);
429
430DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
431
432 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
433
434 TP_ARGS(inode, nid, blk_addr)
435);
436
437DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
438
439 TP_PROTO(struct inode *inode, int ret),
440
441 TP_ARGS(inode, ret)
442);
443
444DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
445
446 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
447
448 TP_ARGS(inode, nid, blk_addr)
449);
450
451TRACE_EVENT(f2fs_truncate_partial_nodes,
452
453 TP_PROTO(struct inode *inode, nid_t nid[], int depth, int err),
454
455 TP_ARGS(inode, nid, depth, err),
456
457 TP_STRUCT__entry(
458 __field(dev_t, dev)
459 __field(ino_t, ino)
460 __field(nid_t, nid[3])
461 __field(int, depth)
462 __field(int, err)
463 ),
464
465 TP_fast_assign(
466 __entry->dev = inode->i_sb->s_dev;
467 __entry->ino = inode->i_ino;
468 __entry->nid[0] = nid[0];
469 __entry->nid[1] = nid[1];
470 __entry->nid[2] = nid[2];
471 __entry->depth = depth;
472 __entry->err = err;
473 ),
474
475 TP_printk("dev = (%d,%d), ino = %lu, "
476 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
477 show_dev_ino(__entry),
478 (unsigned int)__entry->nid[0],
479 (unsigned int)__entry->nid[1],
480 (unsigned int)__entry->nid[2],
481 __entry->depth,
482 __entry->err)
483);
484
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700485TRACE_EVENT(f2fs_map_blocks,
486 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900487
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700488 TP_ARGS(inode, map, ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900489
490 TP_STRUCT__entry(
491 __field(dev_t, dev)
492 __field(ino_t, ino)
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700493 __field(block_t, m_lblk)
494 __field(block_t, m_pblk)
495 __field(unsigned int, m_len)
Namjae Jeon848753a2013-04-23 16:38:02 +0900496 __field(int, ret)
497 ),
498
499 TP_fast_assign(
500 __entry->dev = inode->i_sb->s_dev;
501 __entry->ino = inode->i_ino;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700502 __entry->m_lblk = map->m_lblk;
503 __entry->m_pblk = map->m_pblk;
504 __entry->m_len = map->m_len;
Namjae Jeon848753a2013-04-23 16:38:02 +0900505 __entry->ret = ret;
506 ),
507
508 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700509 "start blkaddr = 0x%llx, len = 0x%llx, err = %d",
Namjae Jeon848753a2013-04-23 16:38:02 +0900510 show_dev_ino(__entry),
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700511 (unsigned long long)__entry->m_lblk,
512 (unsigned long long)__entry->m_pblk,
513 (unsigned long long)__entry->m_len,
Namjae Jeon848753a2013-04-23 16:38:02 +0900514 __entry->ret)
515);
516
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700517TRACE_EVENT(f2fs_background_gc,
518
519 TP_PROTO(struct super_block *sb, long wait_ms,
520 unsigned int prefree, unsigned int free),
521
522 TP_ARGS(sb, wait_ms, prefree, free),
523
524 TP_STRUCT__entry(
525 __field(dev_t, dev)
526 __field(long, wait_ms)
527 __field(unsigned int, prefree)
528 __field(unsigned int, free)
529 ),
530
531 TP_fast_assign(
532 __entry->dev = sb->s_dev;
533 __entry->wait_ms = wait_ms;
534 __entry->prefree = prefree;
535 __entry->free = free;
536 ),
537
538 TP_printk("dev = (%d,%d), wait_ms = %ld, prefree = %u, free = %u",
539 show_dev(__entry),
540 __entry->wait_ms,
541 __entry->prefree,
542 __entry->free)
543);
544
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900545TRACE_EVENT(f2fs_get_victim,
546
547 TP_PROTO(struct super_block *sb, int type, int gc_type,
548 struct victim_sel_policy *p, unsigned int pre_victim,
549 unsigned int prefree, unsigned int free),
550
551 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
552
553 TP_STRUCT__entry(
554 __field(dev_t, dev)
555 __field(int, type)
556 __field(int, gc_type)
557 __field(int, alloc_mode)
558 __field(int, gc_mode)
559 __field(unsigned int, victim)
560 __field(unsigned int, ofs_unit)
561 __field(unsigned int, pre_victim)
562 __field(unsigned int, prefree)
563 __field(unsigned int, free)
564 ),
565
566 TP_fast_assign(
567 __entry->dev = sb->s_dev;
568 __entry->type = type;
569 __entry->gc_type = gc_type;
570 __entry->alloc_mode = p->alloc_mode;
571 __entry->gc_mode = p->gc_mode;
572 __entry->victim = p->min_segno;
573 __entry->ofs_unit = p->ofs_unit;
574 __entry->pre_victim = pre_victim;
575 __entry->prefree = prefree;
576 __entry->free = free;
577 ),
578
579 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), victim = %u "
580 "ofs_unit = %u, pre_victim_secno = %d, prefree = %u, free = %u",
581 show_dev(__entry),
582 show_data_type(__entry->type),
583 show_gc_type(__entry->gc_type),
584 show_alloc_mode(__entry->alloc_mode),
585 show_victim_policy(__entry->gc_mode),
586 __entry->victim,
587 __entry->ofs_unit,
588 (int)__entry->pre_victim,
589 __entry->prefree,
590 __entry->free)
591);
592
Namjae Jeonc01e2852013-04-23 17:00:52 +0900593TRACE_EVENT(f2fs_fallocate,
594
595 TP_PROTO(struct inode *inode, int mode,
596 loff_t offset, loff_t len, int ret),
597
598 TP_ARGS(inode, mode, offset, len, ret),
599
600 TP_STRUCT__entry(
601 __field(dev_t, dev)
602 __field(ino_t, ino)
603 __field(int, mode)
604 __field(loff_t, offset)
605 __field(loff_t, len)
606 __field(loff_t, size)
607 __field(blkcnt_t, blocks)
608 __field(int, ret)
609 ),
610
611 TP_fast_assign(
612 __entry->dev = inode->i_sb->s_dev;
613 __entry->ino = inode->i_ino;
614 __entry->mode = mode;
615 __entry->offset = offset;
616 __entry->len = len;
617 __entry->size = inode->i_size;
618 __entry->blocks = inode->i_blocks;
619 __entry->ret = ret;
620 ),
621
622 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
623 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
624 show_dev_ino(__entry),
625 __entry->mode,
626 (unsigned long long)__entry->offset,
627 (unsigned long long)__entry->len,
628 (unsigned long long)__entry->size,
629 (unsigned long long)__entry->blocks,
630 __entry->ret)
631);
632
Chao Yu70407fa2014-07-31 21:11:22 +0800633TRACE_EVENT(f2fs_direct_IO_enter,
634
635 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
636
637 TP_ARGS(inode, offset, len, rw),
638
639 TP_STRUCT__entry(
640 __field(dev_t, dev)
641 __field(ino_t, ino)
642 __field(loff_t, pos)
643 __field(unsigned long, len)
644 __field(int, rw)
645 ),
646
647 TP_fast_assign(
648 __entry->dev = inode->i_sb->s_dev;
649 __entry->ino = inode->i_ino;
650 __entry->pos = offset;
651 __entry->len = len;
652 __entry->rw = rw;
653 ),
654
655 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
656 show_dev_ino(__entry),
657 __entry->pos,
658 __entry->len,
659 __entry->rw)
660);
661
662TRACE_EVENT(f2fs_direct_IO_exit,
663
664 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
665 int rw, int ret),
666
667 TP_ARGS(inode, offset, len, rw, ret),
668
669 TP_STRUCT__entry(
670 __field(dev_t, dev)
671 __field(ino_t, ino)
672 __field(loff_t, pos)
673 __field(unsigned long, len)
674 __field(int, rw)
675 __field(int, ret)
676 ),
677
678 TP_fast_assign(
679 __entry->dev = inode->i_sb->s_dev;
680 __entry->ino = inode->i_ino;
681 __entry->pos = offset;
682 __entry->len = len;
683 __entry->rw = rw;
684 __entry->ret = ret;
685 ),
686
687 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
688 "rw = %d ret = %d",
689 show_dev_ino(__entry),
690 __entry->pos,
691 __entry->len,
692 __entry->rw,
693 __entry->ret)
694);
695
Namjae Jeonc01e2852013-04-23 17:00:52 +0900696TRACE_EVENT(f2fs_reserve_new_block,
697
698 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node),
699
700 TP_ARGS(inode, nid, ofs_in_node),
701
702 TP_STRUCT__entry(
703 __field(dev_t, dev)
704 __field(nid_t, nid)
705 __field(unsigned int, ofs_in_node)
706 ),
707
708 TP_fast_assign(
709 __entry->dev = inode->i_sb->s_dev;
710 __entry->nid = nid;
711 __entry->ofs_in_node = ofs_in_node;
712 ),
713
714 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u",
715 show_dev(__entry),
716 (unsigned int)__entry->nid,
717 __entry->ofs_in_node)
718);
719
Chao Yu3e1c8f12014-12-23 16:35:21 +0800720DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
721
Chao Yu2ace38e2014-12-24 16:08:14 +0800722 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800723
Chao Yu2ace38e2014-12-24 16:08:14 +0800724 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800725
726 TP_STRUCT__entry(
727 __field(dev_t, dev)
728 __field(ino_t, ino)
729 __field(pgoff_t, index)
730 __field(block_t, blkaddr)
731 __field(int, rw)
732 __field(int, type)
733 ),
734
735 TP_fast_assign(
736 __entry->dev = page->mapping->host->i_sb->s_dev;
737 __entry->ino = page->mapping->host->i_ino;
738 __entry->index = page->index;
Chao Yu2ace38e2014-12-24 16:08:14 +0800739 __entry->blkaddr = fio->blk_addr;
740 __entry->rw = fio->rw;
741 __entry->type = fio->type;
Chao Yu3e1c8f12014-12-23 16:35:21 +0800742 ),
743
744 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
745 "blkaddr = 0x%llx, rw = %s%s, type = %s",
746 show_dev_ino(__entry),
747 (unsigned long)__entry->index,
748 (unsigned long long)__entry->blkaddr,
749 show_bio_type(__entry->rw),
750 show_block_type(__entry->type))
751);
752
753DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
754
Chao Yu2ace38e2014-12-24 16:08:14 +0800755 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800756
Chao Yu2ace38e2014-12-24 16:08:14 +0800757 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800758
759 TP_CONDITION(page->mapping)
760);
761
762DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_mbio,
763
Chao Yu2ace38e2014-12-24 16:08:14 +0800764 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800765
Chao Yu2ace38e2014-12-24 16:08:14 +0800766 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +0800767
768 TP_CONDITION(page->mapping)
769);
770
Chao Yud4d288b2013-11-24 12:36:42 +0900771DECLARE_EVENT_CLASS(f2fs__submit_bio,
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900772
Chao Yu2ace38e2014-12-24 16:08:14 +0800773 TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
774 struct bio *bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900775
Chao Yu2ace38e2014-12-24 16:08:14 +0800776 TP_ARGS(sb, fio, bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900777
778 TP_STRUCT__entry(
779 __field(dev_t, dev)
Chao Yud4d288b2013-11-24 12:36:42 +0900780 __field(int, rw)
781 __field(int, type)
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900782 __field(sector_t, sector)
783 __field(unsigned int, size)
784 ),
785
786 TP_fast_assign(
787 __entry->dev = sb->s_dev;
Chao Yu2ace38e2014-12-24 16:08:14 +0800788 __entry->rw = fio->rw;
789 __entry->type = fio->type;
Kent Overstreet4f024f32013-10-11 15:44:27 -0700790 __entry->sector = bio->bi_iter.bi_sector;
791 __entry->size = bio->bi_iter.bi_size;
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900792 ),
793
Jaegeuk Kima709f4a2013-11-24 14:42:23 +0900794 TP_printk("dev = (%d,%d), %s%s, %s, sector = %lld, size = %u",
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900795 show_dev(__entry),
Chao Yud4d288b2013-11-24 12:36:42 +0900796 show_bio_type(__entry->rw),
797 show_block_type(__entry->type),
Namjae Jeon6ec178d2013-04-23 17:51:43 +0900798 (unsigned long long)__entry->sector,
799 __entry->size)
800);
801
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +0900802DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_write_bio,
Chao Yud4d288b2013-11-24 12:36:42 +0900803
Chao Yu2ace38e2014-12-24 16:08:14 +0800804 TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
805 struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +0900806
Chao Yu2ace38e2014-12-24 16:08:14 +0800807 TP_ARGS(sb, fio, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +0900808
809 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +0900810);
811
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +0900812DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio,
Chao Yud4d288b2013-11-24 12:36:42 +0900813
Chao Yu2ace38e2014-12-24 16:08:14 +0800814 TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
815 struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +0900816
Chao Yu2ace38e2014-12-24 16:08:14 +0800817 TP_ARGS(sb, fio, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +0900818
819 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +0900820);
821
Chao Yu62aed042014-05-06 16:46:04 +0800822TRACE_EVENT(f2fs_write_begin,
823
824 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
825 unsigned int flags),
826
827 TP_ARGS(inode, pos, len, flags),
828
829 TP_STRUCT__entry(
830 __field(dev_t, dev)
831 __field(ino_t, ino)
832 __field(loff_t, pos)
833 __field(unsigned int, len)
834 __field(unsigned int, flags)
835 ),
836
837 TP_fast_assign(
838 __entry->dev = inode->i_sb->s_dev;
839 __entry->ino = inode->i_ino;
840 __entry->pos = pos;
841 __entry->len = len;
842 __entry->flags = flags;
843 ),
844
845 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
846 show_dev_ino(__entry),
847 (unsigned long long)__entry->pos,
848 __entry->len,
849 __entry->flags)
850);
851
Chao Yudfb2bf32014-05-06 16:47:23 +0800852TRACE_EVENT(f2fs_write_end,
853
854 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
855 unsigned int copied),
856
857 TP_ARGS(inode, pos, len, copied),
858
859 TP_STRUCT__entry(
860 __field(dev_t, dev)
861 __field(ino_t, ino)
862 __field(loff_t, pos)
863 __field(unsigned int, len)
864 __field(unsigned int, copied)
865 ),
866
867 TP_fast_assign(
868 __entry->dev = inode->i_sb->s_dev;
869 __entry->ino = inode->i_ino;
870 __entry->pos = pos;
871 __entry->len = len;
872 __entry->copied = copied;
873 ),
874
875 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
876 show_dev_ino(__entry),
877 (unsigned long long)__entry->pos,
878 __entry->len,
879 __entry->copied)
880);
881
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900882DECLARE_EVENT_CLASS(f2fs__page,
883
884 TP_PROTO(struct page *page, int type),
885
886 TP_ARGS(page, type),
887
888 TP_STRUCT__entry(
889 __field(dev_t, dev)
890 __field(ino_t, ino)
891 __field(int, type)
892 __field(int, dir)
893 __field(pgoff_t, index)
894 __field(int, dirty)
Chao Yuc20e89c2014-05-06 16:53:08 +0800895 __field(int, uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900896 ),
897
898 TP_fast_assign(
899 __entry->dev = page->mapping->host->i_sb->s_dev;
900 __entry->ino = page->mapping->host->i_ino;
901 __entry->type = type;
902 __entry->dir = S_ISDIR(page->mapping->host->i_mode);
903 __entry->index = page->index;
904 __entry->dirty = PageDirty(page);
Chao Yuc20e89c2014-05-06 16:53:08 +0800905 __entry->uptodate = PageUptodate(page);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900906 ),
907
Chao Yuc20e89c2014-05-06 16:53:08 +0800908 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
909 "dirty = %d, uptodate = %d",
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900910 show_dev_ino(__entry),
911 show_block_type(__entry->type),
912 show_file_type(__entry->dir),
913 (unsigned long)__entry->index,
Chao Yuc20e89c2014-05-06 16:53:08 +0800914 __entry->dirty,
915 __entry->uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900916);
917
Chao Yuecda0de2014-05-06 16:48:26 +0800918DEFINE_EVENT(f2fs__page, f2fs_writepage,
919
920 TP_PROTO(struct page *page, int type),
921
922 TP_ARGS(page, type)
923);
924
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -0700925DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
926
927 TP_PROTO(struct page *page, int type),
928
929 TP_ARGS(page, type)
930);
931
Chao Yuc20e89c2014-05-06 16:53:08 +0800932DEFINE_EVENT(f2fs__page, f2fs_readpage,
933
934 TP_PROTO(struct page *page, int type),
935
936 TP_ARGS(page, type)
937);
938
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900939DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
940
941 TP_PROTO(struct page *page, int type),
942
943 TP_ARGS(page, type)
944);
945
Jaegeuk Kime943a102013-10-25 14:26:31 +0900946DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
947
948 TP_PROTO(struct page *page, int type),
949
950 TP_ARGS(page, type)
951);
952
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -0700953DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
954
955 TP_PROTO(struct page *page, int type),
956
957 TP_ARGS(page, type)
958);
959
960DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
961
962 TP_PROTO(struct page *page, int type),
963
964 TP_ARGS(page, type)
965);
966
Chao Yue5748432014-05-06 16:51:24 +0800967TRACE_EVENT(f2fs_writepages,
968
969 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
970
971 TP_ARGS(inode, wbc, type),
972
973 TP_STRUCT__entry(
974 __field(dev_t, dev)
975 __field(ino_t, ino)
976 __field(int, type)
977 __field(int, dir)
978 __field(long, nr_to_write)
979 __field(long, pages_skipped)
980 __field(loff_t, range_start)
981 __field(loff_t, range_end)
982 __field(pgoff_t, writeback_index)
983 __field(int, sync_mode)
984 __field(char, for_kupdate)
985 __field(char, for_background)
986 __field(char, tagged_writepages)
987 __field(char, for_reclaim)
988 __field(char, range_cyclic)
989 __field(char, for_sync)
990 ),
991
992 TP_fast_assign(
993 __entry->dev = inode->i_sb->s_dev;
994 __entry->ino = inode->i_ino;
995 __entry->type = type;
996 __entry->dir = S_ISDIR(inode->i_mode);
997 __entry->nr_to_write = wbc->nr_to_write;
998 __entry->pages_skipped = wbc->pages_skipped;
999 __entry->range_start = wbc->range_start;
1000 __entry->range_end = wbc->range_end;
1001 __entry->writeback_index = inode->i_mapping->writeback_index;
1002 __entry->sync_mode = wbc->sync_mode;
1003 __entry->for_kupdate = wbc->for_kupdate;
1004 __entry->for_background = wbc->for_background;
1005 __entry->tagged_writepages = wbc->tagged_writepages;
1006 __entry->for_reclaim = wbc->for_reclaim;
1007 __entry->range_cyclic = wbc->range_cyclic;
1008 __entry->for_sync = wbc->for_sync;
1009 ),
1010
1011 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1012 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1013 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1014 show_dev_ino(__entry),
1015 show_block_type(__entry->type),
1016 show_file_type(__entry->dir),
1017 __entry->nr_to_write,
1018 __entry->pages_skipped,
1019 __entry->range_start,
1020 __entry->range_end,
1021 (unsigned long)__entry->writeback_index,
1022 __entry->sync_mode,
1023 __entry->for_kupdate,
1024 __entry->for_background,
1025 __entry->tagged_writepages,
1026 __entry->for_reclaim,
1027 __entry->range_cyclic,
1028 __entry->for_sync)
1029);
1030
Chao Yub8c29402015-10-12 17:02:26 +08001031TRACE_EVENT(f2fs_readpages,
1032
1033 TP_PROTO(struct inode *inode, struct page *page, unsigned int nrpage),
1034
1035 TP_ARGS(inode, page, nrpage),
1036
1037 TP_STRUCT__entry(
1038 __field(dev_t, dev)
1039 __field(ino_t, ino)
1040 __field(pgoff_t, start)
1041 __field(unsigned int, nrpage)
1042 ),
1043
1044 TP_fast_assign(
1045 __entry->dev = inode->i_sb->s_dev;
1046 __entry->ino = inode->i_ino;
1047 __entry->start = page->index;
1048 __entry->nrpage = nrpage;
1049 ),
1050
1051 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1052 show_dev_ino(__entry),
1053 (unsigned long)__entry->start,
1054 __entry->nrpage)
1055);
1056
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001057TRACE_EVENT(f2fs_write_checkpoint,
1058
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001059 TP_PROTO(struct super_block *sb, int reason, char *msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001060
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001061 TP_ARGS(sb, reason, msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001062
1063 TP_STRUCT__entry(
1064 __field(dev_t, dev)
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001065 __field(int, reason)
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001066 __field(char *, msg)
1067 ),
1068
1069 TP_fast_assign(
1070 __entry->dev = sb->s_dev;
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001071 __entry->reason = reason;
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001072 __entry->msg = msg;
1073 ),
1074
1075 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1076 show_dev(__entry),
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001077 show_cpreason(__entry->reason),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001078 __entry->msg)
1079);
1080
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001081TRACE_EVENT(f2fs_issue_discard,
1082
1083 TP_PROTO(struct super_block *sb, block_t blkstart, block_t blklen),
1084
1085 TP_ARGS(sb, blkstart, blklen),
1086
1087 TP_STRUCT__entry(
1088 __field(dev_t, dev)
1089 __field(block_t, blkstart)
1090 __field(block_t, blklen)
1091 ),
1092
1093 TP_fast_assign(
1094 __entry->dev = sb->s_dev;
1095 __entry->blkstart = blkstart;
1096 __entry->blklen = blklen;
1097 ),
1098
1099 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1100 show_dev(__entry),
1101 (unsigned long long)__entry->blkstart,
1102 (unsigned long long)__entry->blklen)
1103);
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001104
1105TRACE_EVENT(f2fs_issue_flush,
1106
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001107 TP_PROTO(struct super_block *sb, unsigned int nobarrier,
1108 unsigned int flush_merge),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001109
1110 TP_ARGS(sb, nobarrier, flush_merge),
1111
1112 TP_STRUCT__entry(
1113 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001114 __field(unsigned int, nobarrier)
1115 __field(unsigned int, flush_merge)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001116 ),
1117
1118 TP_fast_assign(
1119 __entry->dev = sb->s_dev;
1120 __entry->nobarrier = nobarrier;
1121 __entry->flush_merge = flush_merge;
1122 ),
1123
1124 TP_printk("dev = (%d,%d), %s %s",
1125 show_dev(__entry),
1126 __entry->nobarrier ? "skip (nobarrier)" : "issue",
1127 __entry->flush_merge ? " with flush_merge" : "")
1128);
Chao Yu1ec46102015-02-05 17:59:59 +08001129
1130TRACE_EVENT(f2fs_lookup_extent_tree_start,
1131
1132 TP_PROTO(struct inode *inode, unsigned int pgofs),
1133
1134 TP_ARGS(inode, pgofs),
1135
1136 TP_STRUCT__entry(
1137 __field(dev_t, dev)
1138 __field(ino_t, ino)
1139 __field(unsigned int, pgofs)
1140 ),
1141
1142 TP_fast_assign(
1143 __entry->dev = inode->i_sb->s_dev;
1144 __entry->ino = inode->i_ino;
1145 __entry->pgofs = pgofs;
1146 ),
1147
1148 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1149 show_dev_ino(__entry),
1150 __entry->pgofs)
1151);
1152
1153TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1154
1155 TP_PROTO(struct inode *inode, unsigned int pgofs,
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001156 struct extent_info *ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001157
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001158 TP_ARGS(inode, pgofs, ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001159
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001160 TP_CONDITION(ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001161
1162 TP_STRUCT__entry(
1163 __field(dev_t, dev)
1164 __field(ino_t, ino)
1165 __field(unsigned int, pgofs)
1166 __field(unsigned int, fofs)
1167 __field(u32, blk)
1168 __field(unsigned int, len)
1169 ),
1170
1171 TP_fast_assign(
1172 __entry->dev = inode->i_sb->s_dev;
1173 __entry->ino = inode->i_ino;
1174 __entry->pgofs = pgofs;
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001175 __entry->fofs = ei->fofs;
1176 __entry->blk = ei->blk;
1177 __entry->len = ei->len;
Chao Yu1ec46102015-02-05 17:59:59 +08001178 ),
1179
1180 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1181 "ext_info(fofs: %u, blk: %u, len: %u)",
1182 show_dev_ino(__entry),
1183 __entry->pgofs,
1184 __entry->fofs,
1185 __entry->blk,
1186 __entry->len)
1187);
1188
Chao Yu744288c2015-09-06 17:50:13 +08001189TRACE_EVENT(f2fs_update_extent_tree_range,
Chao Yu1ec46102015-02-05 17:59:59 +08001190
Chao Yu744288c2015-09-06 17:50:13 +08001191 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1192 unsigned int len),
Chao Yu1ec46102015-02-05 17:59:59 +08001193
Chao Yu744288c2015-09-06 17:50:13 +08001194 TP_ARGS(inode, pgofs, blkaddr, len),
Chao Yu1ec46102015-02-05 17:59:59 +08001195
1196 TP_STRUCT__entry(
1197 __field(dev_t, dev)
1198 __field(ino_t, ino)
1199 __field(unsigned int, pgofs)
1200 __field(u32, blk)
Chao Yu744288c2015-09-06 17:50:13 +08001201 __field(unsigned int, len)
Chao Yu1ec46102015-02-05 17:59:59 +08001202 ),
1203
1204 TP_fast_assign(
1205 __entry->dev = inode->i_sb->s_dev;
1206 __entry->ino = inode->i_ino;
1207 __entry->pgofs = pgofs;
1208 __entry->blk = blkaddr;
Chao Yu744288c2015-09-06 17:50:13 +08001209 __entry->len = len;
Chao Yu1ec46102015-02-05 17:59:59 +08001210 ),
1211
Chao Yu744288c2015-09-06 17:50:13 +08001212 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1213 "blkaddr = %u, len = %u",
Chao Yu1ec46102015-02-05 17:59:59 +08001214 show_dev_ino(__entry),
1215 __entry->pgofs,
Chao Yu744288c2015-09-06 17:50:13 +08001216 __entry->blk,
1217 __entry->len)
Chao Yu1ec46102015-02-05 17:59:59 +08001218);
1219
1220TRACE_EVENT(f2fs_shrink_extent_tree,
1221
1222 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1223 unsigned int tree_cnt),
1224
1225 TP_ARGS(sbi, node_cnt, tree_cnt),
1226
1227 TP_STRUCT__entry(
1228 __field(dev_t, dev)
1229 __field(unsigned int, node_cnt)
1230 __field(unsigned int, tree_cnt)
1231 ),
1232
1233 TP_fast_assign(
1234 __entry->dev = sbi->sb->s_dev;
1235 __entry->node_cnt = node_cnt;
1236 __entry->tree_cnt = tree_cnt;
1237 ),
1238
1239 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
1240 show_dev(__entry),
1241 __entry->node_cnt,
1242 __entry->tree_cnt)
1243);
1244
1245TRACE_EVENT(f2fs_destroy_extent_tree,
1246
1247 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1248
1249 TP_ARGS(inode, node_cnt),
1250
1251 TP_STRUCT__entry(
1252 __field(dev_t, dev)
1253 __field(ino_t, ino)
1254 __field(unsigned int, node_cnt)
1255 ),
1256
1257 TP_fast_assign(
1258 __entry->dev = inode->i_sb->s_dev;
1259 __entry->ino = inode->i_ino;
1260 __entry->node_cnt = node_cnt;
1261 ),
1262
1263 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1264 show_dev_ino(__entry),
1265 __entry->node_cnt)
1266);
1267
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09001268#endif /* _TRACE_F2FS_H */
1269
1270 /* This part must be outside protection */
1271#include <trace/define_trace.h>