]> git.ipfire.org Git - people/arne_f/kernel.git/blob - include/trace/events/f2fs.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[people/arne_f/kernel.git] / include / trace / events / f2fs.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM f2fs
4
5 #if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_F2FS_H
7
8 #include <linux/tracepoint.h>
9
10 #define show_dev(dev) MAJOR(dev), MINOR(dev)
11 #define show_dev_ino(entry) show_dev(entry->dev), (unsigned long)entry->ino
12
13 TRACE_DEFINE_ENUM(NODE);
14 TRACE_DEFINE_ENUM(DATA);
15 TRACE_DEFINE_ENUM(META);
16 TRACE_DEFINE_ENUM(META_FLUSH);
17 TRACE_DEFINE_ENUM(INMEM);
18 TRACE_DEFINE_ENUM(INMEM_DROP);
19 TRACE_DEFINE_ENUM(INMEM_INVALIDATE);
20 TRACE_DEFINE_ENUM(INMEM_REVOKE);
21 TRACE_DEFINE_ENUM(IPU);
22 TRACE_DEFINE_ENUM(OPU);
23 TRACE_DEFINE_ENUM(HOT);
24 TRACE_DEFINE_ENUM(WARM);
25 TRACE_DEFINE_ENUM(COLD);
26 TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
27 TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
28 TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
29 TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
30 TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
31 TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
32 TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
33 TRACE_DEFINE_ENUM(GC_GREEDY);
34 TRACE_DEFINE_ENUM(GC_CB);
35 TRACE_DEFINE_ENUM(FG_GC);
36 TRACE_DEFINE_ENUM(BG_GC);
37 TRACE_DEFINE_ENUM(LFS);
38 TRACE_DEFINE_ENUM(SSR);
39 TRACE_DEFINE_ENUM(__REQ_RAHEAD);
40 TRACE_DEFINE_ENUM(__REQ_SYNC);
41 TRACE_DEFINE_ENUM(__REQ_IDLE);
42 TRACE_DEFINE_ENUM(__REQ_PREFLUSH);
43 TRACE_DEFINE_ENUM(__REQ_FUA);
44 TRACE_DEFINE_ENUM(__REQ_PRIO);
45 TRACE_DEFINE_ENUM(__REQ_META);
46 TRACE_DEFINE_ENUM(CP_UMOUNT);
47 TRACE_DEFINE_ENUM(CP_FASTBOOT);
48 TRACE_DEFINE_ENUM(CP_SYNC);
49 TRACE_DEFINE_ENUM(CP_RECOVERY);
50 TRACE_DEFINE_ENUM(CP_DISCARD);
51 TRACE_DEFINE_ENUM(CP_TRIMMED);
52
53 #define show_block_type(type) \
54 __print_symbolic(type, \
55 { NODE, "NODE" }, \
56 { DATA, "DATA" }, \
57 { META, "META" }, \
58 { META_FLUSH, "META_FLUSH" }, \
59 { INMEM, "INMEM" }, \
60 { INMEM_DROP, "INMEM_DROP" }, \
61 { INMEM_INVALIDATE, "INMEM_INVALIDATE" }, \
62 { INMEM_REVOKE, "INMEM_REVOKE" }, \
63 { IPU, "IN-PLACE" }, \
64 { OPU, "OUT-OF-PLACE" })
65
66 #define show_block_temp(temp) \
67 __print_symbolic(temp, \
68 { HOT, "HOT" }, \
69 { WARM, "WARM" }, \
70 { COLD, "COLD" })
71
72 #define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO | \
73 REQ_PREFLUSH | REQ_FUA)
74 #define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS)
75
76 #define show_bio_type(op,op_flags) show_bio_op(op), \
77 show_bio_op_flags(op_flags)
78
79 #define show_bio_op(op) \
80 __print_symbolic(op, \
81 { REQ_OP_READ, "READ" }, \
82 { REQ_OP_WRITE, "WRITE" }, \
83 { REQ_OP_FLUSH, "FLUSH" }, \
84 { REQ_OP_DISCARD, "DISCARD" }, \
85 { REQ_OP_ZONE_REPORT, "ZONE_REPORT" }, \
86 { REQ_OP_SECURE_ERASE, "SECURE_ERASE" }, \
87 { REQ_OP_ZONE_RESET, "ZONE_RESET" }, \
88 { REQ_OP_WRITE_SAME, "WRITE_SAME" }, \
89 { REQ_OP_WRITE_ZEROES, "WRITE_ZEROES" })
90
91 #define show_bio_op_flags(flags) \
92 __print_flags(F2FS_BIO_FLAG_MASK(flags), "|", \
93 { REQ_RAHEAD, "R" }, \
94 { REQ_SYNC, "S" }, \
95 { REQ_META, "M" }, \
96 { REQ_PRIO, "P" }, \
97 { REQ_PREFLUSH, "PF" }, \
98 { REQ_FUA, "FUA" })
99
100 #define show_data_type(type) \
101 __print_symbolic(type, \
102 { CURSEG_HOT_DATA, "Hot DATA" }, \
103 { CURSEG_WARM_DATA, "Warm DATA" }, \
104 { CURSEG_COLD_DATA, "Cold DATA" }, \
105 { CURSEG_HOT_NODE, "Hot NODE" }, \
106 { CURSEG_WARM_NODE, "Warm NODE" }, \
107 { CURSEG_COLD_NODE, "Cold NODE" }, \
108 { NO_CHECK_TYPE, "No TYPE" })
109
110 #define show_file_type(type) \
111 __print_symbolic(type, \
112 { 0, "FILE" }, \
113 { 1, "DIR" })
114
115 #define show_gc_type(type) \
116 __print_symbolic(type, \
117 { FG_GC, "Foreground GC" }, \
118 { BG_GC, "Background GC" })
119
120 #define show_alloc_mode(type) \
121 __print_symbolic(type, \
122 { LFS, "LFS-mode" }, \
123 { SSR, "SSR-mode" })
124
125 #define show_victim_policy(type) \
126 __print_symbolic(type, \
127 { GC_GREEDY, "Greedy" }, \
128 { GC_CB, "Cost-Benefit" })
129
130 #define show_cpreason(type) \
131 __print_flags(type, "|", \
132 { CP_UMOUNT, "Umount" }, \
133 { CP_FASTBOOT, "Fastboot" }, \
134 { CP_SYNC, "Sync" }, \
135 { CP_RECOVERY, "Recovery" }, \
136 { CP_DISCARD, "Discard" }, \
137 { CP_UMOUNT, "Umount" }, \
138 { CP_TRIMMED, "Trimmed" })
139
140 struct victim_sel_policy;
141 struct f2fs_map_blocks;
142
143 DECLARE_EVENT_CLASS(f2fs__inode,
144
145 TP_PROTO(struct inode *inode),
146
147 TP_ARGS(inode),
148
149 TP_STRUCT__entry(
150 __field(dev_t, dev)
151 __field(ino_t, ino)
152 __field(ino_t, pino)
153 __field(umode_t, mode)
154 __field(loff_t, size)
155 __field(unsigned int, nlink)
156 __field(blkcnt_t, blocks)
157 __field(__u8, advise)
158 ),
159
160 TP_fast_assign(
161 __entry->dev = inode->i_sb->s_dev;
162 __entry->ino = inode->i_ino;
163 __entry->pino = F2FS_I(inode)->i_pino;
164 __entry->mode = inode->i_mode;
165 __entry->nlink = inode->i_nlink;
166 __entry->size = inode->i_size;
167 __entry->blocks = inode->i_blocks;
168 __entry->advise = F2FS_I(inode)->i_advise;
169 ),
170
171 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
172 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
173 show_dev_ino(__entry),
174 (unsigned long)__entry->pino,
175 __entry->mode,
176 __entry->size,
177 (unsigned int)__entry->nlink,
178 (unsigned long long)__entry->blocks,
179 (unsigned char)__entry->advise)
180 );
181
182 DECLARE_EVENT_CLASS(f2fs__inode_exit,
183
184 TP_PROTO(struct inode *inode, int ret),
185
186 TP_ARGS(inode, ret),
187
188 TP_STRUCT__entry(
189 __field(dev_t, dev)
190 __field(ino_t, ino)
191 __field(int, ret)
192 ),
193
194 TP_fast_assign(
195 __entry->dev = inode->i_sb->s_dev;
196 __entry->ino = inode->i_ino;
197 __entry->ret = ret;
198 ),
199
200 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
201 show_dev_ino(__entry),
202 __entry->ret)
203 );
204
205 DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
206
207 TP_PROTO(struct inode *inode),
208
209 TP_ARGS(inode)
210 );
211
212 TRACE_EVENT(f2fs_sync_file_exit,
213
214 TP_PROTO(struct inode *inode, int need_cp, int datasync, int ret),
215
216 TP_ARGS(inode, need_cp, datasync, ret),
217
218 TP_STRUCT__entry(
219 __field(dev_t, dev)
220 __field(ino_t, ino)
221 __field(int, need_cp)
222 __field(int, datasync)
223 __field(int, ret)
224 ),
225
226 TP_fast_assign(
227 __entry->dev = inode->i_sb->s_dev;
228 __entry->ino = inode->i_ino;
229 __entry->need_cp = need_cp;
230 __entry->datasync = datasync;
231 __entry->ret = ret;
232 ),
233
234 TP_printk("dev = (%d,%d), ino = %lu, checkpoint is %s, "
235 "datasync = %d, ret = %d",
236 show_dev_ino(__entry),
237 __entry->need_cp ? "needed" : "not needed",
238 __entry->datasync,
239 __entry->ret)
240 );
241
242 TRACE_EVENT(f2fs_sync_fs,
243
244 TP_PROTO(struct super_block *sb, int wait),
245
246 TP_ARGS(sb, wait),
247
248 TP_STRUCT__entry(
249 __field(dev_t, dev)
250 __field(int, dirty)
251 __field(int, wait)
252 ),
253
254 TP_fast_assign(
255 __entry->dev = sb->s_dev;
256 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
257 __entry->wait = wait;
258 ),
259
260 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
261 show_dev(__entry->dev),
262 __entry->dirty ? "dirty" : "not dirty",
263 __entry->wait)
264 );
265
266 DEFINE_EVENT(f2fs__inode, f2fs_iget,
267
268 TP_PROTO(struct inode *inode),
269
270 TP_ARGS(inode)
271 );
272
273 DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
274
275 TP_PROTO(struct inode *inode, int ret),
276
277 TP_ARGS(inode, ret)
278 );
279
280 DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
281
282 TP_PROTO(struct inode *inode),
283
284 TP_ARGS(inode)
285 );
286
287 DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
288
289 TP_PROTO(struct inode *inode, int ret),
290
291 TP_ARGS(inode, ret)
292 );
293
294 TRACE_EVENT(f2fs_unlink_enter,
295
296 TP_PROTO(struct inode *dir, struct dentry *dentry),
297
298 TP_ARGS(dir, dentry),
299
300 TP_STRUCT__entry(
301 __field(dev_t, dev)
302 __field(ino_t, ino)
303 __field(loff_t, size)
304 __field(blkcnt_t, blocks)
305 __field(const char *, name)
306 ),
307
308 TP_fast_assign(
309 __entry->dev = dir->i_sb->s_dev;
310 __entry->ino = dir->i_ino;
311 __entry->size = dir->i_size;
312 __entry->blocks = dir->i_blocks;
313 __entry->name = dentry->d_name.name;
314 ),
315
316 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
317 "i_blocks = %llu, name = %s",
318 show_dev_ino(__entry),
319 __entry->size,
320 (unsigned long long)__entry->blocks,
321 __entry->name)
322 );
323
324 DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
325
326 TP_PROTO(struct inode *inode, int ret),
327
328 TP_ARGS(inode, ret)
329 );
330
331 DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode,
332
333 TP_PROTO(struct inode *inode, int ret),
334
335 TP_ARGS(inode, ret)
336 );
337
338 DEFINE_EVENT(f2fs__inode, f2fs_truncate,
339
340 TP_PROTO(struct inode *inode),
341
342 TP_ARGS(inode)
343 );
344
345 TRACE_EVENT(f2fs_truncate_data_blocks_range,
346
347 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
348
349 TP_ARGS(inode, nid, ofs, free),
350
351 TP_STRUCT__entry(
352 __field(dev_t, dev)
353 __field(ino_t, ino)
354 __field(nid_t, nid)
355 __field(unsigned int, ofs)
356 __field(int, free)
357 ),
358
359 TP_fast_assign(
360 __entry->dev = inode->i_sb->s_dev;
361 __entry->ino = inode->i_ino;
362 __entry->nid = nid;
363 __entry->ofs = ofs;
364 __entry->free = free;
365 ),
366
367 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
368 show_dev_ino(__entry),
369 (unsigned int)__entry->nid,
370 __entry->ofs,
371 __entry->free)
372 );
373
374 DECLARE_EVENT_CLASS(f2fs__truncate_op,
375
376 TP_PROTO(struct inode *inode, u64 from),
377
378 TP_ARGS(inode, from),
379
380 TP_STRUCT__entry(
381 __field(dev_t, dev)
382 __field(ino_t, ino)
383 __field(loff_t, size)
384 __field(blkcnt_t, blocks)
385 __field(u64, from)
386 ),
387
388 TP_fast_assign(
389 __entry->dev = inode->i_sb->s_dev;
390 __entry->ino = inode->i_ino;
391 __entry->size = inode->i_size;
392 __entry->blocks = inode->i_blocks;
393 __entry->from = from;
394 ),
395
396 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
397 "start file offset = %llu",
398 show_dev_ino(__entry),
399 __entry->size,
400 (unsigned long long)__entry->blocks,
401 (unsigned long long)__entry->from)
402 );
403
404 DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
405
406 TP_PROTO(struct inode *inode, u64 from),
407
408 TP_ARGS(inode, from)
409 );
410
411 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
412
413 TP_PROTO(struct inode *inode, int ret),
414
415 TP_ARGS(inode, ret)
416 );
417
418 DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
419
420 TP_PROTO(struct inode *inode, u64 from),
421
422 TP_ARGS(inode, from)
423 );
424
425 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
426
427 TP_PROTO(struct inode *inode, int ret),
428
429 TP_ARGS(inode, ret)
430 );
431
432 DECLARE_EVENT_CLASS(f2fs__truncate_node,
433
434 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
435
436 TP_ARGS(inode, nid, blk_addr),
437
438 TP_STRUCT__entry(
439 __field(dev_t, dev)
440 __field(ino_t, ino)
441 __field(nid_t, nid)
442 __field(block_t, blk_addr)
443 ),
444
445 TP_fast_assign(
446 __entry->dev = inode->i_sb->s_dev;
447 __entry->ino = inode->i_ino;
448 __entry->nid = nid;
449 __entry->blk_addr = blk_addr;
450 ),
451
452 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
453 show_dev_ino(__entry),
454 (unsigned int)__entry->nid,
455 (unsigned long long)__entry->blk_addr)
456 );
457
458 DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
459
460 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
461
462 TP_ARGS(inode, nid, blk_addr)
463 );
464
465 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
466
467 TP_PROTO(struct inode *inode, int ret),
468
469 TP_ARGS(inode, ret)
470 );
471
472 DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
473
474 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
475
476 TP_ARGS(inode, nid, blk_addr)
477 );
478
479 TRACE_EVENT(f2fs_truncate_partial_nodes,
480
481 TP_PROTO(struct inode *inode, nid_t nid[], int depth, int err),
482
483 TP_ARGS(inode, nid, depth, err),
484
485 TP_STRUCT__entry(
486 __field(dev_t, dev)
487 __field(ino_t, ino)
488 __field(nid_t, nid[3])
489 __field(int, depth)
490 __field(int, err)
491 ),
492
493 TP_fast_assign(
494 __entry->dev = inode->i_sb->s_dev;
495 __entry->ino = inode->i_ino;
496 __entry->nid[0] = nid[0];
497 __entry->nid[1] = nid[1];
498 __entry->nid[2] = nid[2];
499 __entry->depth = depth;
500 __entry->err = err;
501 ),
502
503 TP_printk("dev = (%d,%d), ino = %lu, "
504 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
505 show_dev_ino(__entry),
506 (unsigned int)__entry->nid[0],
507 (unsigned int)__entry->nid[1],
508 (unsigned int)__entry->nid[2],
509 __entry->depth,
510 __entry->err)
511 );
512
513 TRACE_EVENT(f2fs_map_blocks,
514 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
515
516 TP_ARGS(inode, map, ret),
517
518 TP_STRUCT__entry(
519 __field(dev_t, dev)
520 __field(ino_t, ino)
521 __field(block_t, m_lblk)
522 __field(block_t, m_pblk)
523 __field(unsigned int, m_len)
524 __field(int, ret)
525 ),
526
527 TP_fast_assign(
528 __entry->dev = inode->i_sb->s_dev;
529 __entry->ino = inode->i_ino;
530 __entry->m_lblk = map->m_lblk;
531 __entry->m_pblk = map->m_pblk;
532 __entry->m_len = map->m_len;
533 __entry->ret = ret;
534 ),
535
536 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
537 "start blkaddr = 0x%llx, len = 0x%llx, err = %d",
538 show_dev_ino(__entry),
539 (unsigned long long)__entry->m_lblk,
540 (unsigned long long)__entry->m_pblk,
541 (unsigned long long)__entry->m_len,
542 __entry->ret)
543 );
544
545 TRACE_EVENT(f2fs_background_gc,
546
547 TP_PROTO(struct super_block *sb, unsigned int wait_ms,
548 unsigned int prefree, unsigned int free),
549
550 TP_ARGS(sb, wait_ms, prefree, free),
551
552 TP_STRUCT__entry(
553 __field(dev_t, dev)
554 __field(unsigned int, wait_ms)
555 __field(unsigned int, prefree)
556 __field(unsigned int, free)
557 ),
558
559 TP_fast_assign(
560 __entry->dev = sb->s_dev;
561 __entry->wait_ms = wait_ms;
562 __entry->prefree = prefree;
563 __entry->free = free;
564 ),
565
566 TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u",
567 show_dev(__entry->dev),
568 __entry->wait_ms,
569 __entry->prefree,
570 __entry->free)
571 );
572
573 TRACE_EVENT(f2fs_gc_begin,
574
575 TP_PROTO(struct super_block *sb, bool sync, bool background,
576 long long dirty_nodes, long long dirty_dents,
577 long long dirty_imeta, unsigned int free_sec,
578 unsigned int free_seg, int reserved_seg,
579 unsigned int prefree_seg),
580
581 TP_ARGS(sb, sync, background, dirty_nodes, dirty_dents, dirty_imeta,
582 free_sec, free_seg, reserved_seg, prefree_seg),
583
584 TP_STRUCT__entry(
585 __field(dev_t, dev)
586 __field(bool, sync)
587 __field(bool, background)
588 __field(long long, dirty_nodes)
589 __field(long long, dirty_dents)
590 __field(long long, dirty_imeta)
591 __field(unsigned int, free_sec)
592 __field(unsigned int, free_seg)
593 __field(int, reserved_seg)
594 __field(unsigned int, prefree_seg)
595 ),
596
597 TP_fast_assign(
598 __entry->dev = sb->s_dev;
599 __entry->sync = sync;
600 __entry->background = background;
601 __entry->dirty_nodes = dirty_nodes;
602 __entry->dirty_dents = dirty_dents;
603 __entry->dirty_imeta = dirty_imeta;
604 __entry->free_sec = free_sec;
605 __entry->free_seg = free_seg;
606 __entry->reserved_seg = reserved_seg;
607 __entry->prefree_seg = prefree_seg;
608 ),
609
610 TP_printk("dev = (%d,%d), sync = %d, background = %d, nodes = %lld, "
611 "dents = %lld, imeta = %lld, free_sec:%u, free_seg:%u, "
612 "rsv_seg:%d, prefree_seg:%u",
613 show_dev(__entry->dev),
614 __entry->sync,
615 __entry->background,
616 __entry->dirty_nodes,
617 __entry->dirty_dents,
618 __entry->dirty_imeta,
619 __entry->free_sec,
620 __entry->free_seg,
621 __entry->reserved_seg,
622 __entry->prefree_seg)
623 );
624
625 TRACE_EVENT(f2fs_gc_end,
626
627 TP_PROTO(struct super_block *sb, int ret, int seg_freed,
628 int sec_freed, long long dirty_nodes,
629 long long dirty_dents, long long dirty_imeta,
630 unsigned int free_sec, unsigned int free_seg,
631 int reserved_seg, unsigned int prefree_seg),
632
633 TP_ARGS(sb, ret, seg_freed, sec_freed, dirty_nodes, dirty_dents,
634 dirty_imeta, free_sec, free_seg, reserved_seg, prefree_seg),
635
636 TP_STRUCT__entry(
637 __field(dev_t, dev)
638 __field(int, ret)
639 __field(int, seg_freed)
640 __field(int, sec_freed)
641 __field(long long, dirty_nodes)
642 __field(long long, dirty_dents)
643 __field(long long, dirty_imeta)
644 __field(unsigned int, free_sec)
645 __field(unsigned int, free_seg)
646 __field(int, reserved_seg)
647 __field(unsigned int, prefree_seg)
648 ),
649
650 TP_fast_assign(
651 __entry->dev = sb->s_dev;
652 __entry->ret = ret;
653 __entry->seg_freed = seg_freed;
654 __entry->sec_freed = sec_freed;
655 __entry->dirty_nodes = dirty_nodes;
656 __entry->dirty_dents = dirty_dents;
657 __entry->dirty_imeta = dirty_imeta;
658 __entry->free_sec = free_sec;
659 __entry->free_seg = free_seg;
660 __entry->reserved_seg = reserved_seg;
661 __entry->prefree_seg = prefree_seg;
662 ),
663
664 TP_printk("dev = (%d,%d), ret = %d, seg_freed = %d, sec_freed = %d, "
665 "nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, "
666 "free_seg:%u, rsv_seg:%d, prefree_seg:%u",
667 show_dev(__entry->dev),
668 __entry->ret,
669 __entry->seg_freed,
670 __entry->sec_freed,
671 __entry->dirty_nodes,
672 __entry->dirty_dents,
673 __entry->dirty_imeta,
674 __entry->free_sec,
675 __entry->free_seg,
676 __entry->reserved_seg,
677 __entry->prefree_seg)
678 );
679
680 TRACE_EVENT(f2fs_get_victim,
681
682 TP_PROTO(struct super_block *sb, int type, int gc_type,
683 struct victim_sel_policy *p, unsigned int pre_victim,
684 unsigned int prefree, unsigned int free),
685
686 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
687
688 TP_STRUCT__entry(
689 __field(dev_t, dev)
690 __field(int, type)
691 __field(int, gc_type)
692 __field(int, alloc_mode)
693 __field(int, gc_mode)
694 __field(unsigned int, victim)
695 __field(unsigned int, cost)
696 __field(unsigned int, ofs_unit)
697 __field(unsigned int, pre_victim)
698 __field(unsigned int, prefree)
699 __field(unsigned int, free)
700 ),
701
702 TP_fast_assign(
703 __entry->dev = sb->s_dev;
704 __entry->type = type;
705 __entry->gc_type = gc_type;
706 __entry->alloc_mode = p->alloc_mode;
707 __entry->gc_mode = p->gc_mode;
708 __entry->victim = p->min_segno;
709 __entry->cost = p->min_cost;
710 __entry->ofs_unit = p->ofs_unit;
711 __entry->pre_victim = pre_victim;
712 __entry->prefree = prefree;
713 __entry->free = free;
714 ),
715
716 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), "
717 "victim = %u, cost = %u, ofs_unit = %u, "
718 "pre_victim_secno = %d, prefree = %u, free = %u",
719 show_dev(__entry->dev),
720 show_data_type(__entry->type),
721 show_gc_type(__entry->gc_type),
722 show_alloc_mode(__entry->alloc_mode),
723 show_victim_policy(__entry->gc_mode),
724 __entry->victim,
725 __entry->cost,
726 __entry->ofs_unit,
727 (int)__entry->pre_victim,
728 __entry->prefree,
729 __entry->free)
730 );
731
732 TRACE_EVENT(f2fs_fallocate,
733
734 TP_PROTO(struct inode *inode, int mode,
735 loff_t offset, loff_t len, int ret),
736
737 TP_ARGS(inode, mode, offset, len, ret),
738
739 TP_STRUCT__entry(
740 __field(dev_t, dev)
741 __field(ino_t, ino)
742 __field(int, mode)
743 __field(loff_t, offset)
744 __field(loff_t, len)
745 __field(loff_t, size)
746 __field(blkcnt_t, blocks)
747 __field(int, ret)
748 ),
749
750 TP_fast_assign(
751 __entry->dev = inode->i_sb->s_dev;
752 __entry->ino = inode->i_ino;
753 __entry->mode = mode;
754 __entry->offset = offset;
755 __entry->len = len;
756 __entry->size = inode->i_size;
757 __entry->blocks = inode->i_blocks;
758 __entry->ret = ret;
759 ),
760
761 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
762 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
763 show_dev_ino(__entry),
764 __entry->mode,
765 (unsigned long long)__entry->offset,
766 (unsigned long long)__entry->len,
767 (unsigned long long)__entry->size,
768 (unsigned long long)__entry->blocks,
769 __entry->ret)
770 );
771
772 TRACE_EVENT(f2fs_direct_IO_enter,
773
774 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
775
776 TP_ARGS(inode, offset, len, rw),
777
778 TP_STRUCT__entry(
779 __field(dev_t, dev)
780 __field(ino_t, ino)
781 __field(loff_t, pos)
782 __field(unsigned long, len)
783 __field(int, rw)
784 ),
785
786 TP_fast_assign(
787 __entry->dev = inode->i_sb->s_dev;
788 __entry->ino = inode->i_ino;
789 __entry->pos = offset;
790 __entry->len = len;
791 __entry->rw = rw;
792 ),
793
794 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
795 show_dev_ino(__entry),
796 __entry->pos,
797 __entry->len,
798 __entry->rw)
799 );
800
801 TRACE_EVENT(f2fs_direct_IO_exit,
802
803 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
804 int rw, int ret),
805
806 TP_ARGS(inode, offset, len, rw, ret),
807
808 TP_STRUCT__entry(
809 __field(dev_t, dev)
810 __field(ino_t, ino)
811 __field(loff_t, pos)
812 __field(unsigned long, len)
813 __field(int, rw)
814 __field(int, ret)
815 ),
816
817 TP_fast_assign(
818 __entry->dev = inode->i_sb->s_dev;
819 __entry->ino = inode->i_ino;
820 __entry->pos = offset;
821 __entry->len = len;
822 __entry->rw = rw;
823 __entry->ret = ret;
824 ),
825
826 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
827 "rw = %d ret = %d",
828 show_dev_ino(__entry),
829 __entry->pos,
830 __entry->len,
831 __entry->rw,
832 __entry->ret)
833 );
834
835 TRACE_EVENT(f2fs_reserve_new_blocks,
836
837 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
838 blkcnt_t count),
839
840 TP_ARGS(inode, nid, ofs_in_node, count),
841
842 TP_STRUCT__entry(
843 __field(dev_t, dev)
844 __field(nid_t, nid)
845 __field(unsigned int, ofs_in_node)
846 __field(blkcnt_t, count)
847 ),
848
849 TP_fast_assign(
850 __entry->dev = inode->i_sb->s_dev;
851 __entry->nid = nid;
852 __entry->ofs_in_node = ofs_in_node;
853 __entry->count = count;
854 ),
855
856 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
857 show_dev(__entry->dev),
858 (unsigned int)__entry->nid,
859 __entry->ofs_in_node,
860 (unsigned long long)__entry->count)
861 );
862
863 DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
864
865 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
866
867 TP_ARGS(page, fio),
868
869 TP_STRUCT__entry(
870 __field(dev_t, dev)
871 __field(ino_t, ino)
872 __field(pgoff_t, index)
873 __field(block_t, old_blkaddr)
874 __field(block_t, new_blkaddr)
875 __field(int, op)
876 __field(int, op_flags)
877 __field(int, temp)
878 __field(int, type)
879 ),
880
881 TP_fast_assign(
882 __entry->dev = page->mapping->host->i_sb->s_dev;
883 __entry->ino = page->mapping->host->i_ino;
884 __entry->index = page->index;
885 __entry->old_blkaddr = fio->old_blkaddr;
886 __entry->new_blkaddr = fio->new_blkaddr;
887 __entry->op = fio->op;
888 __entry->op_flags = fio->op_flags;
889 __entry->temp = fio->temp;
890 __entry->type = fio->type;
891 ),
892
893 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
894 "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
895 show_dev_ino(__entry),
896 (unsigned long)__entry->index,
897 (unsigned long long)__entry->old_blkaddr,
898 (unsigned long long)__entry->new_blkaddr,
899 show_bio_type(__entry->op, __entry->op_flags),
900 show_block_temp(__entry->temp),
901 show_block_type(__entry->type))
902 );
903
904 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
905
906 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
907
908 TP_ARGS(page, fio),
909
910 TP_CONDITION(page->mapping)
911 );
912
913 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write,
914
915 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
916
917 TP_ARGS(page, fio),
918
919 TP_CONDITION(page->mapping)
920 );
921
922 DECLARE_EVENT_CLASS(f2fs__bio,
923
924 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
925
926 TP_ARGS(sb, type, bio),
927
928 TP_STRUCT__entry(
929 __field(dev_t, dev)
930 __field(dev_t, target)
931 __field(int, op)
932 __field(int, op_flags)
933 __field(int, type)
934 __field(sector_t, sector)
935 __field(unsigned int, size)
936 ),
937
938 TP_fast_assign(
939 __entry->dev = sb->s_dev;
940 __entry->target = bio_dev(bio);
941 __entry->op = bio_op(bio);
942 __entry->op_flags = bio->bi_opf;
943 __entry->type = type;
944 __entry->sector = bio->bi_iter.bi_sector;
945 __entry->size = bio->bi_iter.bi_size;
946 ),
947
948 TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u",
949 show_dev(__entry->target),
950 show_dev(__entry->dev),
951 show_bio_type(__entry->op, __entry->op_flags),
952 show_block_type(__entry->type),
953 (unsigned long long)__entry->sector,
954 __entry->size)
955 );
956
957 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
958
959 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
960
961 TP_ARGS(sb, type, bio),
962
963 TP_CONDITION(bio)
964 );
965
966 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
967
968 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
969
970 TP_ARGS(sb, type, bio),
971
972 TP_CONDITION(bio)
973 );
974
975 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio,
976
977 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
978
979 TP_ARGS(sb, type, bio),
980
981 TP_CONDITION(bio)
982 );
983
984 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
985
986 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
987
988 TP_ARGS(sb, type, bio),
989
990 TP_CONDITION(bio)
991 );
992
993 TRACE_EVENT(f2fs_write_begin,
994
995 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
996 unsigned int flags),
997
998 TP_ARGS(inode, pos, len, flags),
999
1000 TP_STRUCT__entry(
1001 __field(dev_t, dev)
1002 __field(ino_t, ino)
1003 __field(loff_t, pos)
1004 __field(unsigned int, len)
1005 __field(unsigned int, flags)
1006 ),
1007
1008 TP_fast_assign(
1009 __entry->dev = inode->i_sb->s_dev;
1010 __entry->ino = inode->i_ino;
1011 __entry->pos = pos;
1012 __entry->len = len;
1013 __entry->flags = flags;
1014 ),
1015
1016 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
1017 show_dev_ino(__entry),
1018 (unsigned long long)__entry->pos,
1019 __entry->len,
1020 __entry->flags)
1021 );
1022
1023 TRACE_EVENT(f2fs_write_end,
1024
1025 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1026 unsigned int copied),
1027
1028 TP_ARGS(inode, pos, len, copied),
1029
1030 TP_STRUCT__entry(
1031 __field(dev_t, dev)
1032 __field(ino_t, ino)
1033 __field(loff_t, pos)
1034 __field(unsigned int, len)
1035 __field(unsigned int, copied)
1036 ),
1037
1038 TP_fast_assign(
1039 __entry->dev = inode->i_sb->s_dev;
1040 __entry->ino = inode->i_ino;
1041 __entry->pos = pos;
1042 __entry->len = len;
1043 __entry->copied = copied;
1044 ),
1045
1046 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
1047 show_dev_ino(__entry),
1048 (unsigned long long)__entry->pos,
1049 __entry->len,
1050 __entry->copied)
1051 );
1052
1053 DECLARE_EVENT_CLASS(f2fs__page,
1054
1055 TP_PROTO(struct page *page, int type),
1056
1057 TP_ARGS(page, type),
1058
1059 TP_STRUCT__entry(
1060 __field(dev_t, dev)
1061 __field(ino_t, ino)
1062 __field(int, type)
1063 __field(int, dir)
1064 __field(pgoff_t, index)
1065 __field(int, dirty)
1066 __field(int, uptodate)
1067 ),
1068
1069 TP_fast_assign(
1070 __entry->dev = page->mapping->host->i_sb->s_dev;
1071 __entry->ino = page->mapping->host->i_ino;
1072 __entry->type = type;
1073 __entry->dir = S_ISDIR(page->mapping->host->i_mode);
1074 __entry->index = page->index;
1075 __entry->dirty = PageDirty(page);
1076 __entry->uptodate = PageUptodate(page);
1077 ),
1078
1079 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
1080 "dirty = %d, uptodate = %d",
1081 show_dev_ino(__entry),
1082 show_block_type(__entry->type),
1083 show_file_type(__entry->dir),
1084 (unsigned long)__entry->index,
1085 __entry->dirty,
1086 __entry->uptodate)
1087 );
1088
1089 DEFINE_EVENT(f2fs__page, f2fs_writepage,
1090
1091 TP_PROTO(struct page *page, int type),
1092
1093 TP_ARGS(page, type)
1094 );
1095
1096 DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
1097
1098 TP_PROTO(struct page *page, int type),
1099
1100 TP_ARGS(page, type)
1101 );
1102
1103 DEFINE_EVENT(f2fs__page, f2fs_readpage,
1104
1105 TP_PROTO(struct page *page, int type),
1106
1107 TP_ARGS(page, type)
1108 );
1109
1110 DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
1111
1112 TP_PROTO(struct page *page, int type),
1113
1114 TP_ARGS(page, type)
1115 );
1116
1117 DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
1118
1119 TP_PROTO(struct page *page, int type),
1120
1121 TP_ARGS(page, type)
1122 );
1123
1124 DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
1125
1126 TP_PROTO(struct page *page, int type),
1127
1128 TP_ARGS(page, type)
1129 );
1130
1131 DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
1132
1133 TP_PROTO(struct page *page, int type),
1134
1135 TP_ARGS(page, type)
1136 );
1137
1138 TRACE_EVENT(f2fs_writepages,
1139
1140 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
1141
1142 TP_ARGS(inode, wbc, type),
1143
1144 TP_STRUCT__entry(
1145 __field(dev_t, dev)
1146 __field(ino_t, ino)
1147 __field(int, type)
1148 __field(int, dir)
1149 __field(long, nr_to_write)
1150 __field(long, pages_skipped)
1151 __field(loff_t, range_start)
1152 __field(loff_t, range_end)
1153 __field(pgoff_t, writeback_index)
1154 __field(int, sync_mode)
1155 __field(char, for_kupdate)
1156 __field(char, for_background)
1157 __field(char, tagged_writepages)
1158 __field(char, for_reclaim)
1159 __field(char, range_cyclic)
1160 __field(char, for_sync)
1161 ),
1162
1163 TP_fast_assign(
1164 __entry->dev = inode->i_sb->s_dev;
1165 __entry->ino = inode->i_ino;
1166 __entry->type = type;
1167 __entry->dir = S_ISDIR(inode->i_mode);
1168 __entry->nr_to_write = wbc->nr_to_write;
1169 __entry->pages_skipped = wbc->pages_skipped;
1170 __entry->range_start = wbc->range_start;
1171 __entry->range_end = wbc->range_end;
1172 __entry->writeback_index = inode->i_mapping->writeback_index;
1173 __entry->sync_mode = wbc->sync_mode;
1174 __entry->for_kupdate = wbc->for_kupdate;
1175 __entry->for_background = wbc->for_background;
1176 __entry->tagged_writepages = wbc->tagged_writepages;
1177 __entry->for_reclaim = wbc->for_reclaim;
1178 __entry->range_cyclic = wbc->range_cyclic;
1179 __entry->for_sync = wbc->for_sync;
1180 ),
1181
1182 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1183 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1184 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1185 show_dev_ino(__entry),
1186 show_block_type(__entry->type),
1187 show_file_type(__entry->dir),
1188 __entry->nr_to_write,
1189 __entry->pages_skipped,
1190 __entry->range_start,
1191 __entry->range_end,
1192 (unsigned long)__entry->writeback_index,
1193 __entry->sync_mode,
1194 __entry->for_kupdate,
1195 __entry->for_background,
1196 __entry->tagged_writepages,
1197 __entry->for_reclaim,
1198 __entry->range_cyclic,
1199 __entry->for_sync)
1200 );
1201
1202 TRACE_EVENT(f2fs_readpages,
1203
1204 TP_PROTO(struct inode *inode, struct page *page, unsigned int nrpage),
1205
1206 TP_ARGS(inode, page, nrpage),
1207
1208 TP_STRUCT__entry(
1209 __field(dev_t, dev)
1210 __field(ino_t, ino)
1211 __field(pgoff_t, start)
1212 __field(unsigned int, nrpage)
1213 ),
1214
1215 TP_fast_assign(
1216 __entry->dev = inode->i_sb->s_dev;
1217 __entry->ino = inode->i_ino;
1218 __entry->start = page->index;
1219 __entry->nrpage = nrpage;
1220 ),
1221
1222 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1223 show_dev_ino(__entry),
1224 (unsigned long)__entry->start,
1225 __entry->nrpage)
1226 );
1227
1228 TRACE_EVENT(f2fs_write_checkpoint,
1229
1230 TP_PROTO(struct super_block *sb, int reason, char *msg),
1231
1232 TP_ARGS(sb, reason, msg),
1233
1234 TP_STRUCT__entry(
1235 __field(dev_t, dev)
1236 __field(int, reason)
1237 __field(char *, msg)
1238 ),
1239
1240 TP_fast_assign(
1241 __entry->dev = sb->s_dev;
1242 __entry->reason = reason;
1243 __entry->msg = msg;
1244 ),
1245
1246 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1247 show_dev(__entry->dev),
1248 show_cpreason(__entry->reason),
1249 __entry->msg)
1250 );
1251
1252 DECLARE_EVENT_CLASS(f2fs_discard,
1253
1254 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1255
1256 TP_ARGS(dev, blkstart, blklen),
1257
1258 TP_STRUCT__entry(
1259 __field(dev_t, dev)
1260 __field(block_t, blkstart)
1261 __field(block_t, blklen)
1262 ),
1263
1264 TP_fast_assign(
1265 __entry->dev = dev->bd_dev;
1266 __entry->blkstart = blkstart;
1267 __entry->blklen = blklen;
1268 ),
1269
1270 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1271 show_dev(__entry->dev),
1272 (unsigned long long)__entry->blkstart,
1273 (unsigned long long)__entry->blklen)
1274 );
1275
1276 DEFINE_EVENT(f2fs_discard, f2fs_queue_discard,
1277
1278 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1279
1280 TP_ARGS(dev, blkstart, blklen)
1281 );
1282
1283 DEFINE_EVENT(f2fs_discard, f2fs_issue_discard,
1284
1285 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1286
1287 TP_ARGS(dev, blkstart, blklen)
1288 );
1289
1290 TRACE_EVENT(f2fs_issue_reset_zone,
1291
1292 TP_PROTO(struct block_device *dev, block_t blkstart),
1293
1294 TP_ARGS(dev, blkstart),
1295
1296 TP_STRUCT__entry(
1297 __field(dev_t, dev)
1298 __field(block_t, blkstart)
1299 ),
1300
1301 TP_fast_assign(
1302 __entry->dev = dev->bd_dev;
1303 __entry->blkstart = blkstart;
1304 ),
1305
1306 TP_printk("dev = (%d,%d), reset zone at block = 0x%llx",
1307 show_dev(__entry->dev),
1308 (unsigned long long)__entry->blkstart)
1309 );
1310
1311 TRACE_EVENT(f2fs_issue_flush,
1312
1313 TP_PROTO(struct block_device *dev, unsigned int nobarrier,
1314 unsigned int flush_merge, int ret),
1315
1316 TP_ARGS(dev, nobarrier, flush_merge, ret),
1317
1318 TP_STRUCT__entry(
1319 __field(dev_t, dev)
1320 __field(unsigned int, nobarrier)
1321 __field(unsigned int, flush_merge)
1322 __field(int, ret)
1323 ),
1324
1325 TP_fast_assign(
1326 __entry->dev = dev->bd_dev;
1327 __entry->nobarrier = nobarrier;
1328 __entry->flush_merge = flush_merge;
1329 __entry->ret = ret;
1330 ),
1331
1332 TP_printk("dev = (%d,%d), %s %s, ret = %d",
1333 show_dev(__entry->dev),
1334 __entry->nobarrier ? "skip (nobarrier)" : "issue",
1335 __entry->flush_merge ? " with flush_merge" : "",
1336 __entry->ret)
1337 );
1338
1339 TRACE_EVENT(f2fs_lookup_extent_tree_start,
1340
1341 TP_PROTO(struct inode *inode, unsigned int pgofs),
1342
1343 TP_ARGS(inode, pgofs),
1344
1345 TP_STRUCT__entry(
1346 __field(dev_t, dev)
1347 __field(ino_t, ino)
1348 __field(unsigned int, pgofs)
1349 ),
1350
1351 TP_fast_assign(
1352 __entry->dev = inode->i_sb->s_dev;
1353 __entry->ino = inode->i_ino;
1354 __entry->pgofs = pgofs;
1355 ),
1356
1357 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1358 show_dev_ino(__entry),
1359 __entry->pgofs)
1360 );
1361
1362 TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1363
1364 TP_PROTO(struct inode *inode, unsigned int pgofs,
1365 struct extent_info *ei),
1366
1367 TP_ARGS(inode, pgofs, ei),
1368
1369 TP_CONDITION(ei),
1370
1371 TP_STRUCT__entry(
1372 __field(dev_t, dev)
1373 __field(ino_t, ino)
1374 __field(unsigned int, pgofs)
1375 __field(unsigned int, fofs)
1376 __field(u32, blk)
1377 __field(unsigned int, len)
1378 ),
1379
1380 TP_fast_assign(
1381 __entry->dev = inode->i_sb->s_dev;
1382 __entry->ino = inode->i_ino;
1383 __entry->pgofs = pgofs;
1384 __entry->fofs = ei->fofs;
1385 __entry->blk = ei->blk;
1386 __entry->len = ei->len;
1387 ),
1388
1389 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1390 "ext_info(fofs: %u, blk: %u, len: %u)",
1391 show_dev_ino(__entry),
1392 __entry->pgofs,
1393 __entry->fofs,
1394 __entry->blk,
1395 __entry->len)
1396 );
1397
1398 TRACE_EVENT(f2fs_update_extent_tree_range,
1399
1400 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1401 unsigned int len),
1402
1403 TP_ARGS(inode, pgofs, blkaddr, len),
1404
1405 TP_STRUCT__entry(
1406 __field(dev_t, dev)
1407 __field(ino_t, ino)
1408 __field(unsigned int, pgofs)
1409 __field(u32, blk)
1410 __field(unsigned int, len)
1411 ),
1412
1413 TP_fast_assign(
1414 __entry->dev = inode->i_sb->s_dev;
1415 __entry->ino = inode->i_ino;
1416 __entry->pgofs = pgofs;
1417 __entry->blk = blkaddr;
1418 __entry->len = len;
1419 ),
1420
1421 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1422 "blkaddr = %u, len = %u",
1423 show_dev_ino(__entry),
1424 __entry->pgofs,
1425 __entry->blk,
1426 __entry->len)
1427 );
1428
1429 TRACE_EVENT(f2fs_shrink_extent_tree,
1430
1431 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1432 unsigned int tree_cnt),
1433
1434 TP_ARGS(sbi, node_cnt, tree_cnt),
1435
1436 TP_STRUCT__entry(
1437 __field(dev_t, dev)
1438 __field(unsigned int, node_cnt)
1439 __field(unsigned int, tree_cnt)
1440 ),
1441
1442 TP_fast_assign(
1443 __entry->dev = sbi->sb->s_dev;
1444 __entry->node_cnt = node_cnt;
1445 __entry->tree_cnt = tree_cnt;
1446 ),
1447
1448 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
1449 show_dev(__entry->dev),
1450 __entry->node_cnt,
1451 __entry->tree_cnt)
1452 );
1453
1454 TRACE_EVENT(f2fs_destroy_extent_tree,
1455
1456 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1457
1458 TP_ARGS(inode, node_cnt),
1459
1460 TP_STRUCT__entry(
1461 __field(dev_t, dev)
1462 __field(ino_t, ino)
1463 __field(unsigned int, node_cnt)
1464 ),
1465
1466 TP_fast_assign(
1467 __entry->dev = inode->i_sb->s_dev;
1468 __entry->ino = inode->i_ino;
1469 __entry->node_cnt = node_cnt;
1470 ),
1471
1472 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1473 show_dev_ino(__entry),
1474 __entry->node_cnt)
1475 );
1476
1477 DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1478
1479 TP_PROTO(struct super_block *sb, int type, s64 count),
1480
1481 TP_ARGS(sb, type, count),
1482
1483 TP_STRUCT__entry(
1484 __field(dev_t, dev)
1485 __field(int, type)
1486 __field(s64, count)
1487 ),
1488
1489 TP_fast_assign(
1490 __entry->dev = sb->s_dev;
1491 __entry->type = type;
1492 __entry->count = count;
1493 ),
1494
1495 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
1496 show_dev(__entry->dev),
1497 show_file_type(__entry->type),
1498 __entry->count)
1499 );
1500
1501 DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1502
1503 TP_PROTO(struct super_block *sb, int type, s64 count),
1504
1505 TP_ARGS(sb, type, count)
1506 );
1507
1508 DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1509
1510 TP_PROTO(struct super_block *sb, int type, s64 count),
1511
1512 TP_ARGS(sb, type, count)
1513 );
1514
1515 #endif /* _TRACE_F2FS_H */
1516
1517 /* This part must be outside protection */
1518 #include <trace/define_trace.h>